Currently, all Hudi Relations bear performance gap relative to Spark's HadoopFsRelation and the reason to that is SchemaPruning optimization rule (pruning nested schemas) that is unfortunately predicated on usage of HadoopFsRelation, meaning that it's not applied in cases when any other relation is used. This change is porting this rule to Hudi relations (MOR, Incremental, etc) by the virtue of leveraging HoodieSparkSessionExtensions mechanism injecting modified version of the original SchemaPruning rule that is adopted to work w/ Hudi's custom relations. - Added customOptimizerRules to HoodieAnalysis - Added NestedSchemaPrunning Spark's Optimizer rule - Handle Spark's Optimizer pruned data schema (to effectively prune nested schemas) - Enable HoodieClientTestHarness to inject HoodieSparkSessionExtensions - Injecting Spark Session extensions for TestMORDataSource, TestCOWDataSource - Disabled fallback to HadoopFsRelation
This directory contains examples code that uses hudi.
To run the demo:
-
Configure your
SPARK_MASTERenv variable, yarn-cluster mode by default. -
For hudi write client demo and hudi data source demo, just use spark-submit as common spark app
-
For hudi delta streamer demo of custom source, run
bin/custom-delta-streamer-example.sh -
For hudi delta streamer demo of dfs source:
4.1 Prepare dfs data, we have provided
src/main/resources/delta-streamer-config/dfs/source-file.jsonfor test4.2 Run
bin/dfs-delta-streamer-example.sh -
For hudi delta streamer demo of dfs source:
5.1 Start Kafka server
5.2 Configure your Kafka properties, we have provided
src/main/resources/delta-streamer-config/kafka/kafka-source.propertiesfor test5.3 Run
bin/kafka-delta-streamer-example.sh5.4 Continuously write source data to the Kafka topic your configured with
hoodie.deltastreamer.source.kafka.topicinkafka-source.properties -
Some notes delta streamer demo:
6.1 The configuration files we provided is just the simplest demo, you can change it according to your specific needs.
6.2 You could also use IntelliJ IDEA to run the example directly by configuring parameters as "Program arguments"