1
0
Files
hudi/hudi-examples
Alexey Kudinkin de37774e12 [HUDI-3896] Porting Nested Schema Pruning optimization for Hudi's custom Relations (#5428)
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
2022-07-21 15:06:06 +05:30
..

This directory contains examples code that uses hudi.

To run the demo:

  1. Configure your SPARK_MASTER env variable, yarn-cluster mode by default.

  2. For hudi write client demo and hudi data source demo, just use spark-submit as common spark app

  3. For hudi delta streamer demo of custom source, run bin/custom-delta-streamer-example.sh

  4. 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.json for test

    4.2 Run bin/dfs-delta-streamer-example.sh

  5. 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.properties for test

    5.3 Run bin/kafka-delta-streamer-example.sh

    5.4 Continuously write source data to the Kafka topic your configured with hoodie.deltastreamer.source.kafka.topic in kafka-source.properties

  6. 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"