JingsongLi commented on a change in pull request #12424:
URL: https://github.com/apache/flink/pull/12424#discussion_r435766465
##########
File path:
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/table/catalog/hive/HiveCatalogHiveMetadataTest.java
##########
@@ -123,9 +123,10 @@ public void testAlterTableColumnStatistics() throws
Exception {
.field("third", DataTypes.BOOLEAN())
.field("fourth", DataTypes.DOUBLE())
.field("fifth", DataTypes.BIGINT())
- .field("sixth", DataTypes.BYTES());
+ .field("sixth", DataTypes.BYTES())
+ .field("seventh", DataTypes.DECIMAL(10, 3));
Review comment:
Also add precision like `30, 3`
##########
File path:
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/util/HiveStatsUtil.java
##########
@@ -171,6 +177,22 @@ private static CatalogColumnStatisticsDataBase
createTableColumnStats(DataType c
stringStats.isSetAvgColLen() ?
stringStats.getAvgColLen() : null,
stringStats.isSetNumDVs() ?
stringStats.getNumDVs() : null,
stringStats.isSetNumDVs() ?
stringStats.getNumNulls() : null);
+ } else if (stats.isSetDecimalStats()) {
+ DecimalColumnStatsData decimalStats =
stats.getDecimalStats();
+ // for now, just return
CatalogColumnStatisticsDataDouble for decimal columns
+ Double max = null;
+ if (decimalStats.isSetHighValue()) {
+ Decimal highVal = decimalStats.getHighValue();
Review comment:
NIT: add method: `toHiveDecimal(Decimal d)`
----------------------------------------------------------------
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]