Skip to content

HIVE-30035: Upgrade to Parquet 1.18.0 - #6774

Open
abstractdog wants to merge 2 commits into
apache:masterfrom
abstractdog:HIVE-30035
Open

abstractdog wants to merge 2 commits into
apache:masterfrom
abstractdog:HIVE-30035

Conversation

@abstractdog

@abstractdog abstractdog commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Bump parquet.version from 1.16.0 → 1.18.0 in the root pom.xml, and pin parquet-avro to the same version in iceberg/pom.xml's <dependencyManagement> via a new iceberg.parquet.version property (defaulting to ${parquet.version}).

Also update TestHiveSchemaConverter:

  • Drop (MAP_KEY_VALUE) from the 5 expected schema strings.
  • Expect a null annotation instead of MapKeyValueTypeAnnotation.getInstance() in testMapOriginalType.

Why are the changes needed?

iceberg-data brings parquet-avro transitively, and iceberg-shading bundles org.apache.parquet:* into the shaded Iceberg jar without relocating it:

<!-- iceberg/iceberg-shading/pom.xml -->
<relocations>
  <relocation><pattern>org.apache.avro</pattern>...</relocation>
  <relocation><pattern>org.apache.orc</pattern>...</relocation>
  <relocation><pattern>shaded.parquet</pattern>...</relocation>   <!-- parquet-hadoop internals only -->
  <relocation><pattern>com.google</pattern>...</relocation>
  <relocation><pattern>com.fasterxml</pattern>...</relocation>
  <!-- no entry for org.apache.parquet -->
</relocations>
<artifactSet>
  <includes>
    ...
    <include>org.apache.parquet:*</include>
    ...

Confirmed on the built shaded jar:

Package Unrelocated Under org/apache/hive/iceberg/… prefix
org/apache/parquet/… 2018 0
org/apache/avro/… (control) 0 481

Left alone, iceberg-data's transitive Parquet 1.17.1 classes would sit at org.apache.parquet.* next to Hive's 1.18.0 classes at the same coordinates. Pinning parquet-avro (the root of the subtree the bundle embeds) in the Iceberg pom forces the two onto one version. Managing it at the root would spread Parquet artifact overrides across the whole build for what is really an Iceberg-bundle concern.

The TestHiveSchemaConverter changes follow from a Parquet 1.18 behavior change: ConversionPatterns.mapType no longer stamps the deprecated MAP_KEY_VALUE annotation on a MAP's inner key_value group — the Parquet MAP standard treats it as redundant.

Does this PR introduce any user-facing change?

  • Newer Parquet library version on the classpath.
  • Parquet files Hive writes for a MAP<K,V> column no longer stamp the deprecated MAP_KEY_VALUE annotation on the inner key_value group — following Parquet 1.18's ConversionPatterns.mapType, which the Parquet MAP standard treats as redundant. Old files remain readable; standards-compliant readers rely on the outer MAP annotation and are unaffected. Tools that inspect the raw schema (e.g. parquet-tools) will show repeated group key_value { … } instead of repeated group key_value (MAP_KEY_VALUE) { … }.

How was this patch tested?

mvn -pl ql test -Dtest=TestHiveSchemaConverter:

Tests run: 30, Failures: 0, Errors: 0, Skipped: 0

@deniskuzZ

deniskuzZ commented Sep 12, 2026

Copy link
Copy Markdown
Member

@abstractdog, we need this in iceberg pom.xml

    <iceberg.avro.version>${avro.version}</iceberg.avro.version>
    <iceberg.parquet.version>${parquet.version}</iceberg.parquet.version>
.....
      <!-- iceberg-data pulls parquet-avro, the root of the Parquet subtree the bundle embeds. -->
      <dependency>
        <groupId>org.apache.parquet</groupId>
        <artifactId>parquet-avro</artifactId>
        <version>${iceberg.parquet.version}</version>
      </dependency>

or drop the iceberg.avro.version & iceberg.parquet.version and use root pom vars

@abstractdog

Copy link
Copy Markdown
Contributor Author

@deniskuzZ : this is now ready for review

Comment thread iceberg/pom.xml Outdated

@deniskuzZ deniskuzZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@deniskuzZ

Copy link
Copy Markdown
Member

restarted CI

iceberg-data brings parquet-avro, and iceberg-shading bundles org.apache.parquet
into the shaded Iceberg jar without relocating it. Left alone that puts Parquet
1.17.1 classes on the classpath beside Hive's 1.18.0. Pin parquet-avro, the root
of that subtree, in the Iceberg pom where the bundle is built, rather than
managing Parquet artifacts for the whole build.

The version comes from iceberg.parquet.version, alongside the existing
iceberg.avro.version. It defaults to parquet.version and has to stay equal to
it, since the embedded classes keep their original package names.

Update TestHiveSchemaConverter for Parquet 1.18: ConversionPatterns.mapType no
longer stamps the deprecated MAP_KEY_VALUE annotation on the inner key_value
group of a MAP (the Parquet MAP standard treats it as redundant), so drop it
from the expected schema strings and expect a null annotation in
testMapOriginalType.
@sonarqubecloud

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants