use of io.trino.plugin.hive.PartitionStatistics in project trino by trinodb.
the class TestHiveGlueMetastore method testStatisticsLongColumnNames.
@Test
public void testStatisticsLongColumnNames() throws Exception {
SchemaTableName tableName = temporaryTable("test_statistics_long_column_name");
try {
String columnName1 = String.join("", Collections.nCopies(255, "x"));
String columnName2 = String.join("", Collections.nCopies(255, "ӆ"));
String columnName3 = String.join("", Collections.nCopies(255, "ö"));
List<ColumnMetadata> columns = List.of(new ColumnMetadata(columnName1, BIGINT), new ColumnMetadata(columnName2, BIGINT), new ColumnMetadata(columnName3, BIGINT));
Map<String, HiveColumnStatistics> columnStatistics = Map.of(columnName1, INTEGER_COLUMN_STATISTICS, columnName2, INTEGER_COLUMN_STATISTICS, columnName3, INTEGER_COLUMN_STATISTICS);
PartitionStatistics partitionStatistics = PartitionStatistics.builder().setBasicStatistics(HIVE_BASIC_STATISTICS).setColumnStatistics(columnStatistics).build();
doCreateEmptyTable(tableName, ORC, columns);
assertThat(metastore.getTableStatistics(tableName.getSchemaName(), tableName.getTableName())).isEqualTo(EMPTY_TABLE_STATISTICS);
testUpdateTableStatistics(tableName, EMPTY_TABLE_STATISTICS, partitionStatistics);
} finally {
dropTable(tableName);
}
}
Aggregations