Skip to content

[GLUTEN-8623][CH] Support File meta and row index for parquet#8624

Merged
baibaichen merged 14 commits intoapache:mainfrom
baibaichen:feature/rowindex
Feb 5, 2025
Merged

[GLUTEN-8623][CH] Support File meta and row index for parquet#8624
baibaichen merged 14 commits intoapache:mainfrom
baibaichen:feature/rowindex

Conversation

@baibaichen
Copy link
Copy Markdown
Contributor

@baibaichen baibaichen commented Jan 26, 2025

What changes were proposed in this pull request?

(Fixes: #8623)

This PR supports file meta for all supported format and row index for parquet.

Supporting File Meta

To support File Meta, FileReaderWrapper is renamed to BaseReader, and add a member named DB::Columns addVirtualColumn(DB::Chunk dataChunk, size_t rowNum = 0) const, which is called at XXFileReader::pull.

               ┌──────────────┐
               │  BaseReader  │
               └──────┬───────┘
                      ˄
                      │
          ┌───────────┴───────────────┐
          │                           │
┌──────────────────────┐     ┌───────────────────┐
│ConstColumnsFileReader│     │ NormalFileReader  │
└──────────────────────┘     └───────────────────┘

NormalFileReader::pull is responsible for reading real data from file, and ConstColumnsFileReader::pull is responsible for generating n rows of meta data when there is no need to read real data.

After read data from file, file meta are added.

Supporting Row index for parquetParquetInputFormat::generate

To understand what a row index is, please refer to this #37228. and VirtualColumnRowIndexReader

To support row index for parquet, I refactor FormatFile::InputFormat and create a new child class ParquetInputFormat

┌───────────────┐
│  InputFormat  │
└──────┬────────┘
       ˄
       │
┌──────┴─────────────┐
│ ParquetInputFormat │
└────────────────────┘

In ParquetInputFormat::generate, we did same as XXFileReader::pull, reading real data from parquet file first, and then add row index.

How was this patch tested?

spark 35 test are added

  enableSuite[GlutenParquetFileMetadataStructRowIndexSuite]
  enableSuite[GlutenParquetRowIndexSuite]
    .excludeByPrefix("row index generation")
    .excludeByPrefix("invalid row index column type")

see https://opencicd.kyligence.com/blue/rest/organizations/jenkins/pipelines/gluten/pipelines/gluten-ci/runs/14511/nodes/151/steps/205/log/?start=0

@github-actions github-actions bot added CORE works for Gluten Core VELOX CLICKHOUSE labels Jan 26, 2025
@github-actions
Copy link
Copy Markdown

#8623

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

3 similar comments
@baibaichen
Copy link
Copy Markdown
Contributor Author

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

1 similar comment
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 1, 2025

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2025

Run Gluten Clickhouse CI on x86

Copy link
Copy Markdown
Contributor

@taiyang-li taiyang-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@baibaichen baibaichen merged commit a0a3c6f into apache:main Feb 5, 2025
@baibaichen baibaichen deleted the feature/rowindex branch February 5, 2025 05:19
baibaichen added a commit to Kyligence/gluten that referenced this pull request Feb 5, 2025
@baibaichen baibaichen requested a review from Copilot March 8, 2025 10:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 63 out of 63 changed files in this pull request and generated no comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLICKHOUSE CORE works for Gluten Core VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CH] Sopport Row Index for Parquet

3 participants