bowenli86 commented on a change in pull request #8703:
[FLINK-12807][hive]Support Hive table columnstats related operations in
HiveCatalog
URL: https://github.com/apache/flink/pull/8703#discussion_r293597376
##########
File path:
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/table/catalog/hive/HiveCatalogHiveMetadataTest.java
##########
@@ -70,6 +77,35 @@ public void testCreateTable_StorageFormatSet() throws
Exception {
assertFalse(StringUtils.isNullOrWhitespaceOnly(serde));
}
+ // ------ table and column stats ------
+ @Test
+ public void testAlter_GET_TableColumnStatistics() throws Exception {
+ catalog.createDatabase(db1, createDb(), false);
+ CatalogTable catalogTable = createTable();
+ catalog.createTable(path1, catalogTable, false);
+ Map<String, CatalogColumnStatisticsDataBase>
columnStatisticsDataBaseMap = new HashMap<>();
+ columnStatisticsDataBaseMap.put("first", new
CatalogColumnStatisticsDataString(10, 5.2, 3, 100));
+ columnStatisticsDataBaseMap.put("second", new
CatalogColumnStatisticsDataLong(0, 1000, 3, 0));
+ columnStatisticsDataBaseMap.put("third", new
CatalogColumnStatisticsDataString(15, 5.2, 3, 50));
+ CatalogColumnStatistics catalogColumnStatistics = new
CatalogColumnStatistics(columnStatisticsDataBaseMap);
+ catalog.alterTableColumnStatistics(path1,
catalogColumnStatistics, false);
+ CatalogTestUtil.checkEquals(catalogColumnStatistics,
catalog.getTableColumnStatistics(path1));
Review comment:
nit: add an empty line to separate logic code and assertions to improve
readability?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services