deniskuzZ commented on code in PR #3608:
URL: https://github.com/apache/hive/pull/3608#discussion_r1000728500
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/process/show/compactions/ShowCompactionsAnalyzer.java:
##########
@@ -40,20 +43,44 @@ public ShowCompactionsAnalyzer(QueryState queryState)
throws SemanticException {
@Override
public void analyzeInternal(ASTNode root) throws SemanticException {
+ ctx.setResFile(ctx.getLocalTmpPath());
String poolName = null;
- Tree pool = root.getChild(0);
- if (pool != null) {
- if (pool.getType() != HiveParser.TOK_COMPACT_POOL) {
- throw new SemanticException("Unknown token, 'POOL' expected.");
- } else {
- poolName = unescapeSQLString(pool.getChild(0).getText());
+ String dbName = null;
+ String tbName = null;
+ String compactionType = null;
+ String compactionStatus = null;
+ Map<String, String> partitionSpec = null;
+ if (root.getChildCount() > 6) {
+ throw new
SemanticException(ErrorMsg.INVALID_AST_TREE.getMsg(root.toStringTree()));
+ }
+ if (root.getType() == HiveParser.TOK_SHOW_COMPACTIONS &&
root.getChildCount() >= 1) {
Review Comment:
no need for `root.getChildCount() >= 1` check
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/process/show/compactions/ShowCompactionsAnalyzer.java:
##########
@@ -40,20 +43,44 @@ public ShowCompactionsAnalyzer(QueryState queryState)
throws SemanticException {
@Override
public void analyzeInternal(ASTNode root) throws SemanticException {
+ ctx.setResFile(ctx.getLocalTmpPath());
String poolName = null;
- Tree pool = root.getChild(0);
- if (pool != null) {
- if (pool.getType() != HiveParser.TOK_COMPACT_POOL) {
- throw new SemanticException("Unknown token, 'POOL' expected.");
- } else {
- poolName = unescapeSQLString(pool.getChild(0).getText());
+ String dbName = null;
+ String tbName = null;
+ String compactionType = null;
+ String compactionStatus = null;
+ Map<String, String> partitionSpec = null;
+ if (root.getChildCount() > 6) {
+ throw new
SemanticException(ErrorMsg.INVALID_AST_TREE.getMsg(root.toStringTree()));
+ }
+ if (root.getType() == HiveParser.TOK_SHOW_COMPACTIONS &&
root.getChildCount() >= 1) {
Review Comment:
redundant `root.getChildCount() >= 1` check
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]