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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to