-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
[SPARK-14557][SQL] Reading textfile (created though CTAS) doesn't work #12356
Conversation
…k when pathFilter is enabled. 1) A bug in HadoopFileReader. Resolved by passing the directory instead of a list of files in case of pathFilter also, since it gets triggerred in FileInputFormat. This also saves multiple filterings in the codePath. 2) Not using the applyFilterIfApplicable
ok to test |
Test build #55741 has finished for PR 12356 at commit
|
I think we can eliminate applyFilterIfNeeded method as well. |
Test build #55796 has finished for PR 12356 at commit
|
Can any of the admin verify the above fix? |
Resolved the merge conflicts for easy merging |
Test build #56660 has finished for PR 12356 at commit
|
cc @marmbrus |
Resolved the merge conflicts for easy merging |
Test build #57504 has finished for PR 12356 at commit
|
Is it possible to write unit tests for this? |
ok to test |
Test build #59146 has finished for PR 12356 at commit
|
Sure. Let me add the CTAS query in the test suite |
@kasjain Could you add a test case? Does it still fail in the latest master? |
We are closing it due to inactivity. please do reopen if you want to push it forward. Thanks! |
What changes were proposed in this pull request?
These changes fix the below broken functionality and does a small performance improvement.
Reading the CSV table (created through CTAS query) doesn't work when the pathFilter is provided.
A bug in HadoopFileReader. Currently, when the pathFilter is provided, it passes the list of filtered files to the "setInputPaths" which wrongly sets the string of incorrectly escaped comma separated files in an array-sequence of size one. This should have been a sequence of size equal to the number of files obtained after filtering. Hence the exception mentioned in the bug.
------ FileInputFormat.setInputPaths(jobConf, Seq[Path](new Path%28path%29): _*)
Secondly, in this flow, filtering is triggered twice for each file. Once in hadoopTableReader.applyFilterIfApplicable and then again in FileInputFormat.singleThreadedListStatus. This is costly and redundant.
To solve both the issues above, we can just pass the directory path itself even when the pathFilter is enabled.
How was this patch tested?
Integration tests, manual tests