Skip to content

Iceberg: Fail to get table stats when column lower/upper bound has NaN value #15925

@lirui-apache

Description

@lirui-apache

Suppose we have an iceberg table populated with spark:

create table foo(d double) using iceberg;
insert into foo values (cast('NaN' as double));

Then executing show stats for foo with trino will throw exception:

Caused by: java.lang.IllegalArgumentException: min must not be NaN
	at io.trino.spi.statistics.DoubleRange.<init>(DoubleRange.java:61)
	at io.trino.spi.statistics.DoubleRange.from(DoubleRange.java:55)
	at io.trino.plugin.iceberg.TableStatisticsReader.makeTableStatistics(TableStatisticsReader.java:202)
	at io.trino.plugin.iceberg.TableStatisticsReader.getTableStatistics(TableStatisticsReader.java:101)
	at io.trino.plugin.iceberg.IcebergMetadata.lambda$getTableStatistics$65(IcebergMetadata.java:2350)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
	at io.trino.plugin.iceberg.IcebergMetadata.getTableStatistics(IcebergMetadata.java:2329)
	at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.getTableStatistics(ClassLoaderSafeConnectorMetadata.java:319)
	at io.trino.metadata.MetadataManager.getTableStatistics(MetadataManager.java:460)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions