Repository navigation
feat: add nested benchmark derived from TPC-H - #7044
Merged
Merged
Conversation
Adds benchmarks/nested: a spark-shell script that converts existing flat TPC-H data (Parquet or Iceberg) into a nested layout, where non-key, non-partition columns move into a single-element array<struct>, and the 22 queries rewritten for that schema.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
No issue filed. Related: #6467 was found with this benchmark.
Rationale for this change
TPC-H is flat. All eight tables are normalized and every column is primitive. Real-world data is usually nested (event logs, JSON/Avro/Protobuf records, data lake tables), and nested column pruning, struct field access and array unnesting are hot paths there. The existing TPC-H derived benchmarks exercise none of them.
This adds a nested variant that keeps the TPC-H data and queries and changes only the shape, so Comet's nested-type support can be benchmarked and compared against Spark on the same data.
What changes are included in this PR?
benchmarks/nested/scripts/nest_tpch.scala: aspark-shell -iscript that converts existing flat TPC-H data (Parquet or Iceberg, either direction) into the nested layout. Join keys and partition columns (p_brand,c_mktsegment,o_orderdate,l_shipdate) stay at the top level. All other columns move into a single-element<table>_data: array<struct<...>>. Spark is used for the conversion because the data can reach about 10 TB at SF10000.benchmarks/nested/queries/q01..q22.sql: the queries rewritten for the nested schema. Each one unnests the arrays it needs withexplode. The arrays hold exactly one element, so the results are identical to the flat queries.benchmarks/nested/README.md: motivation, schema, usage.dev/release/rat_exclude_files.txt: exclude the derived queries, likebenchmarks/tpc/queries.How are these changes tested?
Tested manually, since this is benchmark tooling and not part of the build: