[
https://issues.apache.org/jira/browse/HIVE-27168?focusedWorklogId=852789&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-852789
]
ASF GitHub Bot logged work on HIVE-27168:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Mar/23 09:02
Start Date: 24/Mar/23 09:02
Worklog Time Spent: 10m
Work Description: 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.
Issue Time Tracking
-------------------
Worklog Id: (was: 852789)
Time Spent: 1h (was: 50m)
> Use basename of the datatype when fetching partition metadata using partition
> filters
> -------------------------------------------------------------------------------------
>
> Key: HIVE-27168
> URL: https://issues.apache.org/jira/browse/HIVE-27168
> Project: Hive
> Issue Type: Bug
> Reporter: Sourabh Badhya
> Assignee: Sourabh Badhya
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> While fetching partition metadata using partition filters, we use the column
> type of the table directly. However, char/varchar types can contain extra
> information such as length of the char/varchar column and hence it skips
> fetching partition metadata due to this extra information.
> Solution: Use the basename of the column type while deciding on whether
> partition pruning can be done on the partitioned column.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)