Skip to content

Do not fail when HMS returns new stats types#28833

Merged
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/do-not-fail-when-hms-returns-new-stats-types-3bee6a
Mar 25, 2026
Merged

Do not fail when HMS returns new stats types#28833
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/do-not-fail-when-hms-returns-new-stats-types-3bee6a

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Mar 24, 2026

HMS API can evolve. Adding new statistics type should be a backwards compatible change. Inability to infer statistics for such column is better than failing.

@cla-bot cla-bot bot added the cla-signed label Mar 24, 2026
@github-actions github-actions bot added the hive Hive connector label Mar 24, 2026
@wendigo
Copy link
Copy Markdown
Contributor

wendigo commented Mar 24, 2026

@findepi this is orthogonal to the other fix so could be merged as well, right?

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Mar 24, 2026
}
throw new TrinoException(HIVE_INVALID_METADATA, "Invalid column statistics data: " + columnStatistics);
log.warn("Unsupported column statistics data: %s", columnStatistics);
return new HiveColumnStatistics(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pls add test coverage in io.trino.plugin.hive.metastore.thrift.TestThriftMetastoreUtil

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's covered by product test. I will need your help with more coverage. Do you want to take over this PR?

nullsCount);
}
throw new TrinoException(HIVE_INVALID_METADATA, "Invalid column statistics data: " + columnStatistics);
log.warn("Unsupported column statistics data: %s", columnStatistics);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be worthwhile to have the schema and table name to locate the table in the data lake that is generating this log statement.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done!

@findepi findepi force-pushed the findepi/do-not-fail-when-hms-returns-new-stats-types-3bee6a branch 2 times, most recently from 9f6feaf to e4a4e29 Compare March 25, 2026 08:51
@findepi findepi force-pushed the findepi/do-not-fail-when-hms-returns-new-stats-types-3bee6a branch from e4a4e29 to 0c24f5a Compare March 25, 2026 16:11
findepi added 2 commits March 25, 2026 17:11
HMS API can evolve. Adding new statistics type should be a backwards
compatible change. Inability to infer statistics for such column is
better than failing.
@findepi findepi force-pushed the findepi/do-not-fail-when-hms-returns-new-stats-types-3bee6a branch from 0c24f5a to b3c671e Compare March 25, 2026 16:11
@findepi findepi merged commit 03634ac into trinodb:master Mar 25, 2026
2 checks passed
@findepi findepi deleted the findepi/do-not-fail-when-hms-returns-new-stats-types-3bee6a branch March 25, 2026 16:11
@github-actions github-actions bot added this to the 481 milestone Mar 25, 2026
@ebyhr ebyhr mentioned this pull request Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed hive Hive connector no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

Hive4 Partition Overwrite fails for non-managed tables

5 participants