[ 
https://issues.apache.org/jira/browse/HIVE-1862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983514#action_12983514
 ] 

Paul Yang commented on HIVE-1862:
---------------------------------

* There may be a potential bug with the string index logic: 

{code}
172           String keyEqual = FileUtils.escapePathName(keyName) + "=";
173           int keyEqualLength = keyEqual.length();
174           String valString;
175           // partitionname ==>  (key=value/)*(key=value)
176           if (partitionColumnCount == 1) {
177             valString = "partitionName.substring(partitionName.indexOf(\"" 
+ keyEqual + "\")+" + keyEqualLength + ")";
178           }
179           else {
180             valString = "partitionName.substring(partitionName.indexOf(\"" 
+ keyEqual + "\")+" + keyEqualLength + ").substring(0, 
partitionName.substring(partitionName.indexOf(\"" + keyEqual + "\")+" + 
keyEqualLength + ").indexOf(\"/\"))";
181           }
{code}

Say the partition name was ds=1/hr=2 and we want to extract the value of hr. 
Since there is no tailing '/', what will .indexOf(\"/\"))" return?

* Can you elaborate further on why it can't handle escaped partition names? It 
seems that if we escape the value that we are searching for, instead of 
unescaping the partition name, we should be able to handle that case.

If escaped partition names can't be handled, can we revert the code inside 
get_partition_names_ps() / get_partitions_ps() to return the correct, but slow 
results?

> Revive partition filtering in the Hive MetaStore
> ------------------------------------------------
>
>                 Key: HIVE-1862
>                 URL: https://issues.apache.org/jira/browse/HIVE-1862
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 0.7.0
>            Reporter: Devaraj Das
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1862.1.patch.txt, HIVE-1862.2.patch.txt, 
> invoke_runqry.sh, qry, qry-sch.Z, runqry
>
>
> HIVE-1853 downgraded the JDO version. This makes the feature of partition 
> filtering in the metastore unusable. This jira is to keep track of the lost 
> feature and discussing approaches to bring it back.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to