-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix NPE in Iceberg stats reader #9719
Fix NPE in Iceberg stats reader #9719
Conversation
this.minValues = new HashMap<>(); | ||
this.maxValues = new HashMap<>(); | ||
this.nullCounts = new HashMap<>(); | ||
this.columnSizes = new HashMap<>(); | ||
this.corruptedStats = new HashSet<>(); | ||
this.hasValidColumnMetrics = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do those need to be mutable objects? Can you use emptyMap/emptySet
(or ImmutableMap/Set.of) instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the else {
branch here which creates mutable objects and then update...
methods which modifies them.
IMO there is a hope we can simplify this code ... #9716
b8c30ea
to
1132cce
Compare
1132cce
to
1488b34
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TableStatisticsMaker.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % comment from @alexjo2144
1488b34
to
8bf1185
Compare
(just rebased) |
Fixes ``` java.lang.NullPointerException at io.trino.plugin.iceberg.TableStatisticsMaker.updatePartitionedStats(TableStatisticsMaker.java:316) at io.trino.plugin.iceberg.TableStatisticsMaker.updateSummaryMin(TableStatisticsMaker.java:298) at io.trino.plugin.iceberg.TableStatisticsMaker.makeTableStatistics(TableStatisticsMaker.java:155) at io.trino.plugin.iceberg.TableStatisticsMaker.getTableStatistics(TableStatisticsMaker.java:73) at io.trino.plugin.iceberg.IcebergMetadata.getTableStatistics(IcebergMetadata.java:693) ``` However, further fixes in that code area are due.
8bf1185
to
9466aa1
Compare
Fixes #9714 but follow up #9716 is due
Currently based on #9711, #9712, #9706, #9705, #9757