Skip to content

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

Merged
vkorukanti merged 3 commits into
delta-io:masterfrom
vkorukanti:legacyGroups
May 10, 2024
Merged

[Kernel][Defaults] Support reading parquet files with legacy 3-level repeated types#3083
vkorukanti merged 3 commits into
delta-io:masterfrom
vkorukanti:legacyGroups

Conversation

@vkorukanti

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

return arrayVector;
}

/**

Copy link
Copy Markdown
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.

@scovich scovich left a comment

Copy link
Copy Markdown
Collaborator

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
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

Development

Successfully merging this pull request may close these issues.

[BUG][Kernel] Delta kernel read checkpoint parquet file failed with exception "list not found in optional group readerFeatures (LIST)"

3 participants