[ https://issues.apache.org/jira/browse/HIVE-22957?focusedWorklogId=456616&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-456616 ]
ASF GitHub Bot logged work on HIVE-22957: ----------------------------------------- Author: ASF GitHub Bot Created on: 09/Jul/20 13:25 Start Date: 09/Jul/20 13:25 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on a change in pull request #1105: URL: https://github.com/apache/hive/pull/1105#discussion_r452211850 ########## File path: parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g ########## @@ -1942,8 +1942,8 @@ metastoreCheck @after { popMsg(state); } : KW_MSCK (repair=KW_REPAIR)? (KW_TABLE tableName - (opt=(KW_ADD|KW_DROP|KW_SYNC) (parts=KW_PARTITIONS) (filterPartitionSpec)?)?) - -> ^(TOK_MSCK $repair? tableName? $opt? (filterPartitionSpec)?) + (opt=(KW_ADD|KW_DROP|KW_SYNC) (parts=KW_PARTITIONS)? (dropPartitionSpec)?)?) Review comment: I think we are fighting with the complexity of the existing complexity :) right now this will mean that we may write `TABLE t PARTITION PARTITION ...` :D do one of the following: * either push out the `KW_PARTITION` keyword from `dropPartitionSpec` to every site it's being used * or...remove the `(parts=KW_PARTITIONS)?` from here and change the `dropPartitionSpec` to accept it optionally by using: `(KW_PARTITION | KW_PARTITIONS)?` I think we should also clean up a bit: * rename the `dropPartitionSpec` to something which doesn't have drop in its name like `partitionSelectorSpec` ########## File path: ql/src/java/org/apache/hadoop/hive/ql/ddl/misc/msck/MsckAnalyzer.java ########## @@ -71,10 +71,15 @@ public void analyzeInternal(ASTNode root) throws SemanticException { Map<Integer, List<ExprNodeGenericFuncDesc>> partitionSpecs = ParseUtils.getFullPartitionSpecs(root, table, conf, false); byte[] filterExp = null; if (partitionSpecs != null & !partitionSpecs.isEmpty()) { - // explicitly set expression proxy class to PartitionExpressionForMetastore since we intend to use the + // expression proxy class needs to be PartitionExpressionForMetastore since we intend to use the // filterPartitionsByExpr of PartitionExpressionForMetastore for partition pruning down the line. - conf.set(MetastoreConf.ConfVars.EXPRESSION_PROXY_CLASS.getVarname(), - PartitionExpressionForMetastore.class.getCanonicalName()); + // Bail out early if expressionProxyClass is not configured properly. + String expressionProxyClass = conf.get(MetastoreConf.ConfVars.EXPRESSION_PROXY_CLASS.getVarname()); + if (expressionProxyClass == null || expressionProxyClass.isEmpty() || + !expressionProxyClass.equals(PartitionExpressionForMetastore.class.getCanonicalName())) { Review comment: you could avoid the null/empty check by using: `!PartitionExpressionForMetastore.class.getCanonicalName()).equals(expressionProxyClass)` ########## File path: parser/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g ########## @@ -720,7 +720,7 @@ partitionVal dropPartitionSpec : - KW_PARTITION + KW_PARTITION | KW_PARTITIONS Review comment: I think this should be `(KW_PARTITION|KW_PARTITIONS)` ; because in it's current form it will * accept `PARTITION` * and `PARTITIONS (...)` * but not `PARTITION (...)` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 456616) Time Spent: 4h (was: 3h 50m) > Support Partition Filtering In MSCK REPAIR TABLE Command > -------------------------------------------------------- > > Key: HIVE-22957 > URL: https://issues.apache.org/jira/browse/HIVE-22957 > Project: Hive > Issue Type: Improvement > Reporter: Syed Shameerur Rahman > Assignee: Syed Shameerur Rahman > Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Attachments: Design Doc_ Partition Filtering In MSCK REPAIR > TABLE.pdf, HIVE-22957.01.patch, HIVE-22957.02.patch, HIVE-22957.03.patch > > Time Spent: 4h > Remaining Estimate: 0h > > *Design Doc:* > [^Design Doc_ Partition Filtering In MSCK REPAIR TABLE.pdf] -- This message was sent by Atlassian Jira (v8.3.4#803005)