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

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

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


##########
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('(');

Review Comment:
   Can it be stored with extra whitespace characters, like `varchar (50)`? 
   
   To be honest, I'm a pretty surprised that we don't have existing code to split the type name and the length. 



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