luoyuxia commented on code in PR #20664:
URL: https://github.com/apache/flink/pull/20664#discussion_r953511250


##########
tools/azure-pipelines/build-apache-repo.yml:
##########
@@ -70,7 +70,7 @@ stages:
             name: Default
           e2e_pool_definition:
             vmImage: 'ubuntu-20.04'
-          environment: PROFILE="-Dflink.hadoop.version=2.8.5 
-Dinclude_hadoop_aws -Dscala-2.12"
+          environment: PROFILE="-Dinclude_hadoop_aws -Dscala-2.12 
-Dflink.hadoop.version=3.1.3 -Phadoop3-tests,hive3"

Review Comment:
   Why change it?



##########
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSourceStatisticsReportTest.java:
##########
@@ -292,20 +294,41 @@ private static void 
assertHiveTableOrcFormatTableStatsEquals(
         expectedColumnStatsMap.put(
                 "f_string",
                 new 
ColumnStats.Builder().setMax("def").setMin("abcd").setNullCount(0L).build());
-        expectedColumnStatsMap.put(
-                "f_decimal5",
-                new ColumnStats.Builder()
-                        .setMax(new BigDecimal("223.45"))
-                        .setMin(new BigDecimal("123.45"))
-                        .setNullCount(0L)
-                        .build());
-        expectedColumnStatsMap.put(
-                "f_decimal14",
-                new ColumnStats.Builder()
-                        .setMax(new BigDecimal("123333333355.33"))
-                        .setMin(new BigDecimal("123333333333.33"))
-                        .setNullCount(0L)
-                        .build());
+        if (hiveVersion.startsWith("3.")) {
+            // TODO For hive 3.x version, Orc format encounter decimal type 
columns (like decimal(5,
+            // 2), decimal(14, 2)) will write a wrong column stat 'min' in orc 
metadata footer

Review Comment:
   Actually, I think it may also write a wrong column stat 'max' if the data 
you write is less than 0. Seems we can refine the comment.



##########
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSourceStatisticsReportTest.java:
##########
@@ -255,7 +257,7 @@ protected Map<String, List<Object>> getDataMap() {
     }
 
     private static void assertHiveTableOrcFormatTableStatsEquals(
-            TableStats tableStats, int expectedRowCount, long nullCount) {
+            TableStats tableStats, String hiveVersion, int expectedRowCount, 
long nullCount) {

Review Comment:
   To get `hiveVersion`, you can use `String hiveVersion = 
HiveShimLoader.getHiveVersion();` directly. So that, we won't need to pass the 
`hiveVersion`.



##########
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveTableSourceStatisticsReportTest.java:
##########
@@ -292,20 +294,41 @@ private static void 
assertHiveTableOrcFormatTableStatsEquals(
         expectedColumnStatsMap.put(
                 "f_string",
                 new 
ColumnStats.Builder().setMax("def").setMin("abcd").setNullCount(0L).build());
-        expectedColumnStatsMap.put(
-                "f_decimal5",
-                new ColumnStats.Builder()
-                        .setMax(new BigDecimal("223.45"))
-                        .setMin(new BigDecimal("123.45"))
-                        .setNullCount(0L)
-                        .build());
-        expectedColumnStatsMap.put(
-                "f_decimal14",
-                new ColumnStats.Builder()
-                        .setMax(new BigDecimal("123333333355.33"))
-                        .setMin(new BigDecimal("123333333333.33"))
-                        .setNullCount(0L)
-                        .build());
+        if (hiveVersion.startsWith("3.")) {

Review Comment:
   You can follow the check logic in `HiveModuleTest#verifyNumBuiltInFunctions`.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to