-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][hive-source][bug] fix An error occurred reading an empty directory #5427
Conversation
PTAL: @FlechazoW @TyrantLucifer |
+ "please check the configuration parameters such as: [file_filter_pattern]"); | ||
if (this.fileNames.isEmpty()) { | ||
log.error("The current directory is empty " + path); | ||
this.fileNames.add(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This place looks strange. If there are no files in the directory, is it more appropriate to return an empty file list? I think the reader of the file list should handle the empty file list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this I made some changes plase review
PTAL: @EricJoy2048 |
Hive Source table
Mysql Sink table
Spark Demo Conf
|
+ "please check the configuration parameters such as: [file_filter_pattern]"); | ||
if (this.fileNames.isEmpty()) { | ||
log.error("The current directory is empty " + path); | ||
this.fileNames.add(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥还把文件夹的名称加进去,fileNames里面装的是可阅读的文件的名称,只要保证这个方法返回的集合里的文件不为空,如若为空则抛出异常就可以。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥还把文件夹的名称加进去,fileNames里面装的是可阅读的文件的名称,只要保证这个方法返回的集合里的文件不为空,如若为空则抛出异常就可以。
cc @zhilinli123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks the up-to-date code not add the path, just logger the error info. @ponyliuh
And we can't throw exception when size is empty. because if the table is empty, we still want it run well, just sync nothing not get an exception.
…ory (apache#5427) * [fix][hive-source][bug] fix An error occurred reading an empty directory * [fix][hive-source][bug] fix An error occurred reading an empty directory
close #5416