You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ve...@apache.org on 2023/03/24 16:22:16 UTC

[hive] branch master updated: HIVE-27168: Use basename of the datatype when fetching partition metadata using partition filters (Sourabh Badhya, reviewed By Laszlo Vegh, Kokila N, Akshat Mathur, Denys Kuzmenko, Zsolt Mikolczi)

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

veghlaci05 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 560ef11cf03 HIVE-27168: Use basename of the datatype when fetching partition metadata using partition filters (Sourabh Badhya, reviewed By Laszlo Vegh, Kokila N, Akshat Mathur, Denys Kuzmenko, Zsolt Mikolczi)
560ef11cf03 is described below

commit 560ef11cf035198174737136b0e9f6199e077885
Author: Sourabh Badhya <42...@users.noreply.github.com>
AuthorDate: Fri Mar 24 21:51:58 2023 +0530

    HIVE-27168: Use basename of the datatype when fetching partition metadata using partition filters (Sourabh Badhya, reviewed By Laszlo Vegh, Kokila N, Akshat Mathur, Denys Kuzmenko, Zsolt Mikolczi)
---
 .../java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java     | 2 +-
 .../java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java  | 2 +-
 .../test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
index 5789b535deb..9d884f2f48a 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
@@ -1327,7 +1327,7 @@ class MetaStoreDirectSql {
         return;
       }
 
-      String colTypeStr = partitionKeys.get(partColIndex).getType();
+      String colTypeStr = ColumnType.getTypeName(partitionKeys.get(partColIndex).getType());
       FilterType colType = FilterType.fromType(colTypeStr);
       if (colType == FilterType.Invalid) {
         filterBuffer.setError("Filter pushdown not supported for type " + colTypeStr);
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java
index 46098d39fa6..75b4d05386e 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java
@@ -465,7 +465,7 @@ public class ExpressionTree {
     private String getJdoFilterPushdownParam(int partColIndex,
                                              FilterBuilder filterBuilder, boolean canPushDownIntegral, List<FieldSchema> partitionKeys) throws MetaException {
       boolean isIntegralSupported = canPushDownIntegral && canJdoUseStringsWithIntegral();
-      String colType = partitionKeys.get(partColIndex).getType();
+      String colType = ColumnType.getTypeName(partitionKeys.get(partColIndex).getType());
       // Can only support partitions whose types are string, or maybe integers
       // Date/Timestamp data type value is considered as string hence pushing down to JDO.
       if (!ColumnType.StringTypes.contains(colType) && !ColumnType.DATE_TYPE_NAME.equalsIgnoreCase(colType)
diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java
index c9c278c54da..51aae60f704 100644
--- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java
+++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java
@@ -2299,9 +2299,9 @@ public abstract class TestHiveMetaStore {
         .addCol("c1", ColumnType.STRING_TYPE_NAME)
         .addCol("c2", ColumnType.INT_TYPE_NAME)
         .addPartCol("p1", ColumnType.STRING_TYPE_NAME)
-        .addPartCol("p2", ColumnType.VARCHAR_TYPE_NAME)
+        .addPartCol("p2", "varchar(20)")
         .addPartCol("p3", ColumnType.INT_TYPE_NAME)
-        .addPartCol("p4", ColumnType.CHAR_TYPE_NAME)
+        .addPartCol("p4", "char(20)")
         .create(client, conf);
 
     tbl = client.getTable(dbName, tblName);