This is an automated email from the ASF dual-hosted git repository.

dkuzmenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 2826a6e6dfa HIVE-29013: [Iceberg] Data type info is not correct in 
error message for tinyint, smallint (#5866)
2826a6e6dfa is described below

commit 2826a6e6dfaa5ff3c0f3e077b55b2994c98f60c4
Author: Simran Arora <[email protected]>
AuthorDate: Sat Jun 14 19:20:08 2025 +0530

    HIVE-29013: [Iceberg] Data type info is not correct in error message for 
tinyint, smallint (#5866)
---
 .../src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java      | 2 +-
 .../org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java
 
b/iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java
index e227d797430..5d912351ab0 100644
--- 
a/iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java
+++ 
b/iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/HiveSchemaConverter.java
@@ -87,7 +87,7 @@ Type convertType(TypeInfo typeInfo) {
           case SHORT:
             Preconditions.checkArgument(autoConvert, "Unsupported Hive type 
%s, use integer " +
                     "instead or enable automatic type conversion, set 
'iceberg.mr.schema.auto.conversion' to true",
-                ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory());
+                typeInfo.toString().toUpperCase());
 
             LOG.debug("Using auto conversion from SHORT/BYTE to INTEGER");
             return Types.IntegerType.get();
diff --git 
a/iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java
 
b/iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java
index 1a3856c7df8..818ee1e6014 100644
--- 
a/iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java
+++ 
b/iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java
@@ -852,7 +852,7 @@ public void testCreateTableWithNotSupportedTypes() {
                                 
testTables.propertiesForCreateTableSQL(ImmutableMap.of())))
           .isInstanceOf(IllegalArgumentException.class)
           .hasMessageStartingWith("Failed to execute Hive query")
-          .hasMessageContaining("Unsupported Hive type");
+          .hasMessageContaining("Unsupported Hive type " + 
notSupportedType.replaceAll("\\(.*\\)", ""));
     }
   }
 

Reply via email to