You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "kumar (JIRA)" <ji...@apache.org> on 2018/05/07 10:57:00 UTC
[jira] [Updated] (SPARK-24200) Read subdirectories with out
asterisks
[ https://issues.apache.org/jira/browse/SPARK-24200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
kumar updated SPARK-24200:
--------------------------
Description:
String folder = "/Users/test/data/";
sparkContext.textFile(folder, 1).toJavaRDD()
Is asterisks mandatory to read a folder -Yes, otherwise it does not read files under subdirectories.
What if I get a folder which is having more subdirectories than the number of asterisks mentioned ? How to handle this scenario ?
For example:
1) {{/Users/test/data/}} This would work ONLY if I get data as /Users/test/data/folder1/file.txt
2)How to make this expression as *generic* ? It should still work if I get a folder as: {{/Users/test/data/folder1/folder2/folder3/folder4}}
My input folder structure is not same all the time.
Is there anything exists in Spark to handle this kind of scenario ?
was:
{{String folder = "/Users/test/data/*/*"; sparkContext.textFile(folder, 1).toJavaRDD() }}
Is asterisks mandatory to read a folder -Yes, otherwise it does not read files under subdirectories.
What if I get a folder which is having more subdirectories than the number of asterisks mentioned ? How to handle this scenario ?
For example:
1) {{/Users/test/data/*/*}} This would work ONLY if I get data as /Users/test/data/folder1/file.txt
2)How to make this expression as *generic* ? It should still work if I get a folder as: {{/Users/test/data/folder1/folder2/folder3/folder4}}
My input folder structure is not same all the time.
Is there anything exists in Spark to handle this kind of scenario ?
> Read subdirectories with out asterisks
> --------------------------------------
>
> Key: SPARK-24200
> URL: https://issues.apache.org/jira/browse/SPARK-24200
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.3.0
> Reporter: kumar
> Priority: Major
>
> String folder = "/Users/test/data/";
> sparkContext.textFile(folder, 1).toJavaRDD()
> Is asterisks mandatory to read a folder -Yes, otherwise it does not read files under subdirectories.
> What if I get a folder which is having more subdirectories than the number of asterisks mentioned ? How to handle this scenario ?
> For example:
> 1) {{/Users/test/data/}} This would work ONLY if I get data as /Users/test/data/folder1/file.txt
> 2)How to make this expression as *generic* ? It should still work if I get a folder as: {{/Users/test/data/folder1/folder2/folder3/folder4}}
> My input folder structure is not same all the time.
> Is there anything exists in Spark to handle this kind of scenario ?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org