[
https://issues.apache.org/jira/browse/HIVE-27168?focusedWorklogId=852829&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-852829
]
ASF GitHub Bot logged work on HIVE-27168:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Mar/23 11:33
Start Date: 24/Mar/23 11:33
Worklog Time Spent: 10m
Work Description: 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()`
Issue Time Tracking
-------------------
Worklog Id: (was: 852829)
Time Spent: 1.5h (was: 1h 20m)
> 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: 1.5h
> 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)