Read range of files in pySpark

蹲街弑〆低调 提交于 2019-12-02 01:38:54
kathleen

Use curly braces.

file = "events.parquet/exportDay=201509{08,09,10,11,12,13,14}"

Here's a similar question on stack overflow: Pyspark select subset of files using regex glob. They suggest either using curly braces, OR performing multiple reads and then unioning the objects (whether they are RDDs or data frames or whatever, there should be some way).

Barry Loper

It uses shell globbing, I believe.

The post: How to read multiple text files into a single RDD?

Seems to suggest the below should work.

"events.parquet/exportDay=2015090[89],events.parquet/exportDay=2015091[0-4]"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!