spark datasourceV1和v2

ApacheSpark的DataSourceV2因DataFrame/SQLContext的依赖、缺乏物理存储信息传播、扩展性和操作下推限制以及写入接口无事务支持等问题而诞生。DataSourceV2旨在改进这些问题,提供高性能的列读接口和更好的优化。文章讨论了如何通过DataSourceV2解决小文件问题,特别是在AWSS3上的应用。

datasourceV2

一文理解 Apache Spark DataSource V2 诞生背景及入门实战
https://zhuanlan.zhihu.com/p/83006243

2.3 Data source API v2

https://issues.apache.org/jira/browse/SPARK-15689

Because of the above limitations/issues, the built-in data source implementations (like parquet, json, etc.) inside Spark SQL are not using this public Data Source API. Instead, they use an internal/non-public interface.

https://issues.apache.org/jira/browse/SPARK-13664

动机

Since its input arguments include DataFrame/SQLContext, the data source API compatibility depends on the upper level API.
依赖 DataFrame/SQLContext, 上层api

The physical storage information (e.g., partitioning and sorting) is not propagated from the data sources, and thus, not used in the Spark optimizer.
分区排序没有传播给spark

Extensibility is not good and operator push-down capabilities are limited.
扩展的下推能力被限制

Lacking columnar read interface for high performance.
列的读接口

The write interface is so general without transaction supports.
没有事务支持

spark FileFormatWriter

org.apache.spark.sql.execution.datasources.FileFormatWriter

// We should first sort by partition columns, then bucket id, and finally sorting columns.
val requiredOrdering = partitionColumns ++ bucketIdExpression ++ sortColumns

对写入数据的要求,可以影响logical plan

如何去解决spark sql 小文件

https://aws.amazon.com/cn/blogs/china/application-and-practice-of-spark-small-file-merging-function-on-aws-s3/

https://blog.youkuaiyun.com/zcypaicom/article/details/128250515

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值