lamber-ken commented on issue #1528:
URL: https://github.com/apache/incubator-hudi/issues/1528#issuecomment-617028414
hi @jenu9417, default parallelism is `1500`, you can adjust according to the
actual situation.
```
// parallelisms
"hoodie.insert.shuffle.parallelism" -> "10",
"hoodie.upsert.shuffle.parallelism" -> "10",
"hoodie.delete.shuffle.parallelism" -> "10",
"hoodie.bulkinsert.shuffle.parallelism" -> "10"
// demo
export SPARK_HOME=/work/BigData/install/spark/spark-2.4.4-bin-hadoop2.7
${SPARK_HOME}/bin/spark-shell \
--driver-memory 6G \
--packages
org.apache.hudi:hudi-spark-bundle_2.11:0.5.1-incubating,org.apache.spark:spark-avro_2.11:2.4.4
\
--conf 'spark.serializer=org.apache.spark.serializer.KryoSerializer'
val tableName = "hudi_mor_table"
val basePath = "file:///tmp/hudi_mor_tablen"
val hudiOptions = Map[String,String](
"hoodie.insert.shuffle.parallelism" -> "10",
"hoodie.upsert.shuffle.parallelism" -> "10",
"hoodie.delete.shuffle.parallelism" -> "10",
"hoodie.bulkinsert.shuffle.parallelism" -> "10",
"hoodie.datasource.write.recordkey.field" -> "key",
"hoodie.datasource.write.partitionpath.field" -> "dt",
"hoodie.table.name" -> tableName,
"hoodie.datasource.write.precombine.field" -> "timestamp",
"hoodie.table.base.file.format" -> "PARQUET"
)
val inputDF = spark.range(1, 5).
withColumn("key", $"id").
withColumn("data", lit("data")).
withColumn("timestamp", current_timestamp()).
withColumn("dt", date_format($"timestamp", "yyyy-MM-dd"))
inputDF.write.format("org.apache.hudi").
options(hudiOptions).
mode("Overwrite").
save(basePath)
spark.read.format("org.apache.hudi").load(basePath + "/*/*").show();
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]