hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-hudi] lamber-ken opened a new pull request #1290: [HUDI-584] Relocate spark-avro dependency by maven-shade-plugin
Date Wed, 29 Jan 2020 16:00:40 GMT
lamber-ken opened a new pull request #1290: [HUDI-584] Relocate spark-avro dependency by maven-shade-plugin
URL: https://github.com/apache/incubator-hudi/pull/1290
 
 
   ## What is the purpose of the pull request
   
   From [spark-avro-guide](http://spark.apache.org/docs/latest/sql-data-sources-avro.html),
we know that the spark-avro module is external, it is not exists in [spark-2.4.4-bin-hadoop2.7.tgz](http://mirror.bit.edu.cn/apache/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz).
   
   **Shade spark-avro:**
   - User will not use `--packages org.apache.spark:spark-avro_2.11:2.4.4`
   - User also don't need care about using the `scala-2.11` or `scala-2.12`
   
   ## Brief change log
   
     - *Relocate spark-avro dependency by maven-shade-plugin*
   
   ## Verify this pull request
   
   ```
   export SPARK_HOME=/work/BigData/install/spark/spark-2.4.4-bin-hadoop2.7
   
   ${SPARK_HOME}/bin/spark-shell \
       --jars `ls packaging/hudi-spark-bundle/target/hudi-spark-bundle_*.*-*.*.*-SNAPSHOT.jar`
\
       --conf 'spark.serializer=org.apache.spark.serializer.KryoSerializer'
   
   val basePath = "file:///tmp/hudi_mor_table"
   
   var datas = List("""{ "name": "kenken", "ts": 1574297893836, "age": 12, "location": "latitude"}""")
   val df = spark.read.json(spark.sparkContext.parallelize(datas, 2))
   df.write.format("org.apache.hudi").
       option("hoodie.datasource.write.recordkey.field", "name").
       option("hoodie.datasource.write.partitionpath.field", "location").
       option("hoodie.datasource.write.precombine.field", "ts").
       option("hoodie.table.name", "tableName").
       mode("Overwrite").
       save(basePath)
   
   spark.read.format("org.apache.hudi").load(basePath + "/*/").show()
   ```
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella
JIRA.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message