diff --git a/demo/app/python/src/main.py b/demo/app/python/src/main.py index 9886a9e3..cc870682 100644 --- a/demo/app/python/src/main.py +++ b/demo/app/python/src/main.py @@ -18,35 +18,37 @@ from hudi import HudiTableBuilder import pyarrow as pa -hudi_table = HudiTableBuilder.from_base_uri( - "s3://hudi-demo/cow/v6_complexkeygen_hivestyle" -).build() -records = hudi_table.read_snapshot() +for url in [ + "s3://hudi-demo/cow/v6_complexkeygen_hivestyle", + "s3://hudi-demo/mor/v6_complexkeygen_hivestyle", +]: + hudi_table = HudiTableBuilder.from_base_uri(url).build() + records = hudi_table.read_snapshot() -arrow_table = pa.Table.from_batches(records) -assert arrow_table.schema.names == [ - "_hoodie_commit_time", - "_hoodie_commit_seqno", - "_hoodie_record_key", - "_hoodie_partition_path", - "_hoodie_file_name", - "id", - "name", - "isActive", - "intField", - "longField", - "floatField", - "doubleField", - "decimalField", - "dateField", - "timestampField", - "binaryField", - "arrayField", - "mapField", - "structField", - "byteField", - "shortField", -] -assert arrow_table.num_rows == 4 + arrow_table = pa.Table.from_batches(records) + assert arrow_table.schema.names == [ + "_hoodie_commit_time", + "_hoodie_commit_seqno", + "_hoodie_record_key", + "_hoodie_partition_path", + "_hoodie_file_name", + "id", + "name", + "isActive", + "intField", + "longField", + "floatField", + "doubleField", + "decimalField", + "dateField", + "timestampField", + "binaryField", + "arrayField", + "mapField", + "structField", + "byteField", + "shortField", + ] + assert arrow_table.num_rows == 4 print("Python API: read snapshot successfully!") diff --git a/demo/infra/mc/prepare_data.sh b/demo/infra/mc/prepare_data.sh index 81404287..c432590a 100755 --- a/demo/infra/mc/prepare_data.sh +++ b/demo/infra/mc/prepare_data.sh @@ -26,6 +26,9 @@ mc mb local/hudi-demo # unzip the data mkdir -p /tmp/tables/cow/ for zip in /opt/data/tables/cow/*.zip; do unzip -o "$zip" -d "/tmp/tables/cow/"; done +mkdir -p /tmp/tables/mor/ +for zip in /opt/data/tables/mor/*.zip; do unzip -o "$zip" -d "/tmp/tables/mor/"; done # copy the data to the bucket mc cp -r /tmp/tables/cow/* local/hudi-demo/cow/ +mc cp -r /tmp/tables/mor/* local/hudi-demo/mor/