You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "veghlaci05 (via GitHub)" <gi...@apache.org> on 2023/03/24 11:33:10 UTC

[GitHub] [hive] veghlaci05 commented on a diff in pull request #4144: HIVE-27168: Use basename of the datatype when fetching partition metadata using partition filters

veghlaci05 commented on code in PR #4144:
URL: https://github.com/apache/hive/pull/4144#discussion_r1147456482


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java:
##########
@@ -1251,4 +1251,19 @@ public static String getHttpPath(String httpPath) {
     }
     return httpPath;
   }
+
+  /**
+   * Function to get the base name of the column type.
+   * @param colType column type
+   * @return base name of the column type
+   */
+  public static String getBaseNameOfColType(String colType) {
+    // char, varchar types can have parameters such as
+    // char/varchar length. We only need the base name.
+    int idx = colType.indexOf('(');
+    if (idx != -1) {
+      return colType.substring(0, idx);

Review Comment:
   Is coltype already trimmed here? what if there are whitespaces at the end? 
   For example `varchar(30)  `
   If this could be an issue, a test case also should be added in `TestHiveMetaStore.testPartitionFilter()`



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org