如何使用SPARK读取某些镶木quet文件分区?
是否可以使用Spark从文件夹中读取某些分区?
我只知道: df = spark.read.parquet(“/mnt/stating/file_name/”)
是否有任何方法只能读取日期不小于今天减去3个月的那些分区?
Is it possible to read certain partitions from a folder using spark?
I only know this way:
df = spark.read.parquet("/mnt/Staging/file_Name/")
Is there any way to read only those partitions where the date is not less than today minus 3 months?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的数据帧按日期进行分区,则可以使用过滤器,Spark只能使用此日期
df = Spark.Read.Parquet(“/mnt/staging/file_name/”)。 ”)===“ 2022-02-03”)
if your dataframe is partitioned by date, you can just use filter, spark will read only partitions with this date
df = spark.read.parquet("/mnt/Staging/file_Name/").filter(col("your_date_col") === "2022-02-03")