You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/07/08 10:03:11 UTC

[GitHub] [hive] marton-bod commented on a change in pull request #2448: Handle Iceberg queries with partition clauses

marton-bod commented on a change in pull request #2448:
URL: https://github.com/apache/hive/pull/2448#discussion_r666052861



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/drop/AbstractDropPartitionAnalyzer.java
##########
@@ -90,13 +90,14 @@ protected void analyzeCommand(TableName tableName, Map<String, String> partition
         throw se;
       }
     }
+    validateAlterTableType(table, AlterTableType.DROPPARTITION, expectView());

Review comment:
       Ah, yes, thanks for asking, I wanted to provide an explanatory comment. So I think the current code flow is not perfect, because `ALTER TABLE tbl DROP PARTITION` commands should be disabled completely for non-native tables (that's what the `validateAlterTableType` checks). 
   
   However, right now the logic which parses and validates the partition clause part of the syntax tree (`ParseUtils.getFullPartitionSpecs`) runs first, therefore if you specify a partition which does not exist, e.g. `ALTER TABLE tbl DROP PARTITION('department'='does-not-exist')` on an Iceberg or HBase or whatever table, then you'll get an exception saying the `partition does not exist` instead of what I think we'd expect, which is `ALTER TABLE DROP PARTITION is not allowed for non-native tables`




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org