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

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

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


##########
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:
   The `colType` that you see here is retrieved from metastore DB. I think its an optimisation to not maintain 2 column in metastore DB - one for type and one for length / other information (btw this information is only for char, varchar or other types).
   
   Also similar implementation is present in TypeInfoUtils#getBaseName(String) which does this conversion. But this would require adding `serde` module into `standalone-metastore` which seems to me like an overkill for this fix.



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