use of io.trino.spi.statistics.ColumnStatistics in project trino by trinodb.
the class TestDeltaLakeMetastoreStatistics method testStatisticsNegativeInfinityAndNaN.
@Test
public void testStatisticsNegativeInfinityAndNaN() {
// Stats with NaN values cannot be used
DeltaLakeTableHandle tableHandle = registerTable("negative_infinity_nan");
TableStatistics stats = deltaLakeMetastore.getTableStatistics(SESSION, tableHandle, Constraint.alwaysTrue());
ColumnStatistics columnStatistics = stats.getColumnStatistics().get(COLUMN_HANDLE);
assertEquals(columnStatistics.getRange().get().getMin(), NEGATIVE_INFINITY);
assertEquals(columnStatistics.getRange().get().getMax(), POSITIVE_INFINITY);
}
use of io.trino.spi.statistics.ColumnStatistics in project trino by trinodb.
the class TestDeltaLakeMetastoreStatistics method assertEmptyStats.
private void assertEmptyStats(TableStatistics tableStatistics) {
assertEquals(tableStatistics.getRowCount(), Estimate.of(0));
ColumnStatistics columnStatistics = tableStatistics.getColumnStatistics().get(COLUMN_HANDLE);
assertEquals(columnStatistics.getNullsFraction(), Estimate.of(0));
assertEquals(columnStatistics.getDistinctValuesCount(), Estimate.of(0));
}
use of io.trino.spi.statistics.ColumnStatistics in project trino by trinodb.
the class TestDeltaLakeMetastoreStatistics method testStatisticsNegInf.
@Test
public void testStatisticsNegInf() {
DeltaLakeTableHandle tableHandle = registerTable("negative_infinity");
TableStatistics stats = deltaLakeMetastore.getTableStatistics(SESSION, tableHandle, Constraint.alwaysTrue());
ColumnStatistics columnStatistics = stats.getColumnStatistics().get(COLUMN_HANDLE);
assertEquals(columnStatistics.getRange().get().getMin(), NEGATIVE_INFINITY);
assertEquals(columnStatistics.getRange().get().getMax(), NEGATIVE_INFINITY);
}
use of io.trino.spi.statistics.ColumnStatistics in project trino by trinodb.
the class TestDeltaLakeMetastoreStatistics method testStatisticsNegZero.
@Test
public void testStatisticsNegZero() {
DeltaLakeTableHandle tableHandle = registerTable("negative_zero");
TableStatistics stats = deltaLakeMetastore.getTableStatistics(SESSION, tableHandle, Constraint.alwaysTrue());
ColumnStatistics columnStatistics = stats.getColumnStatistics().get(COLUMN_HANDLE);
assertEquals(columnStatistics.getRange().get().getMin(), -0.0d);
assertEquals(columnStatistics.getRange().get().getMax(), -0.0d);
}
Aggregations