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

[Kernel][Defaults] Support reading parquet files with legacy 3-level repeated types #3083

Merged
merged 3 commits into from
May 10, 2024

Conversation

vkorukanti
Copy link
Collaborator

Description

When legacy mode is enabled in Spark, array physical types are stored slightly different from the standard format.

Standard mode (default):

optional group readerFeatures (LIST) {
  repeated group list {
    optional binary element (STRING);
  }
}

When write legacy mode is enabled (spark.sql.parquet.writeLegacyFormat = true):

optional group readerFeatures (LIST) {
  repeated group bag {
    optional binary array (STRING);
  }
}

TODO: We need to handle the 2-level lists. Will post a separate PR. The challenge is with generating or finding the Parquet files with 2-level lists.

How was this patch tested?

Added tests

Fixes #3082

@@ -52,15 +55,38 @@ public ColumnVector getDataColumnVector(int batchSize) {
return arrayVector;
}

/**
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same code in Spark Parquet reader.

Copy link
Collaborator

@scovich scovich left a comment

Choose a reason for hiding this comment

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

LGTM

@vkorukanti vkorukanti merged commit a5d7c69 into delta-io:master May 10, 2024
10 checks passed
vkorukanti added a commit that referenced this pull request May 10, 2024
…repeated types (#3083)

## Description
When legacy mode is enabled in Spark, array physical types are stored
slightly different from the standard format.

Standard mode (default):
```
optional group readerFeatures (LIST) {
  repeated group list {
    optional binary element (STRING);
  }
}
```

When write legacy mode is enabled (`spark.sql.parquet.writeLegacyFormat
= true`):
```
optional group readerFeatures (LIST) {
  repeated group bag {
    optional binary array (STRING);
  }
}
```

TODO: We need to handle the 2-level lists. Will post a separate PR. The
challenge is with generating or finding the Parquet files with 2-level
lists.

## How was this patch tested?
Added tests

Fixes #3082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants