Spark RewriteManifestsSparkAction sortBy throws "AnalysisException: [FIELD_NOT_FOUND] No such struct field" for nested field in partition spec
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java at sortColumn, especially around line 320, and reproduce the Spark 4.1 rewrite manifests procedure with a nested partition field whose flattened name contains a dot. Done means sorting by that partition field no longer raises FIELD_NOT_FOUND.
Written by the indexing model from the issue text.
Description
Apache Iceberg version
1.11.0 (latest release)
Query engine
Spark
Please describe the bug 🐞
In Spark 4.1, calling rewrite manifests procedure with sort by on a partition field that have a dot in the name after being flattened (for example a nested field in a struct), will throw this exception
AnalysisException: [FIELD_NOT_FOUND] No such struct field a in a.b
This is because in RewriteManifestsSpark::sortColumn builds the Spark column reference for a custom clustering field by string concatenation — col("data_file.partition." + partitionFieldName), we could fix it by quotting partitionFieldName
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
- Dominant language
- Java
- Stars
- 9.3k
- Forks
- 3.5k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 143
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
improvement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100