Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 14 commits into from
Feb 5, 2025

Conversation

baibaichen
Copy link
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
Copy link

#8623

Copy link

Run Gluten Clickhouse CI on x86

3 similar comments
@baibaichen
Copy link
Contributor Author

Run Gluten Clickhouse CI on x86

Copy link

Run Gluten Clickhouse CI on x86

Copy link

Run Gluten Clickhouse CI on x86

Copy link

Run Gluten Clickhouse CI on x86

Copy link

Run Gluten Clickhouse CI on x86

Copy link

Run Gluten Clickhouse CI on x86

1 similar comment
Copy link

Run Gluten Clickhouse CI on x86

Copy link

github-actions bot commented Feb 1, 2025

Run Gluten Clickhouse CI on x86

Copy link

github-actions bot commented Feb 4, 2025

Run Gluten Clickhouse CI on x86

Copy link
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
54 checks passed
@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
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
2 participants