如何在火花放电中导入hudi模块?
%spark.pyspark
import org.apache.hudi.DataSourceWriteOptions
import org.apache.hudi.DataSourceReadOptions
import org.apache.hudi.config.HoodieWriteConfig错误: ModuleNotFoundError:没有名为'org‘的模块
发布于 2022-01-22 15:15:07
我假设您希望导入这些选项来使用Hudi选项。
当使用pyspark时,您不需要进行这些导入,这是在使用scala或java时需要的。
在pyspark中,您可以将选项指定为key:value对。
在胡迪星火导览之后,下面是声明选项的方式:
hudi_options = {
'hoodie.table.name': tableName,
'hoodie.datasource.write.recordkey.field': 'uuid',
'hoodie.datasource.write.partitionpath.field': 'partitionpath',
'hoodie.datasource.write.table.name': tableName,
'hoodie.datasource.write.operation': 'upsert',
'hoodie.datasource.write.precombine.field': 'ts',
'hoodie.upsert.shuffle.parallelism': 2,
'hoodie.insert.shuffle.parallelism': 2
}
df.write.format("hudi").
options(**hudi_options).
mode("overwrite").
save(basePath)https://stackoverflow.com/questions/69539119
复制相似问题