saihemanth-cloudera commented on a change in pull request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r718691636
##########
File path: ql/src/test/queries/clientnegative/groupby_join_pushdown.q
##########
@@ -22,45 +22,45 @@ FROM src f JOIN src g ON(f.key = g.key)
GROUP BY f.key, g.key;
EXPLAIN
-SELECT f.ctinyint, g.ctinyint, SUM(f.cbigint)
+SELECT f.ctinyint, g.ctinyint, SUM(f.cbigint)
Review comment:
Ack
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/drop/AlterTableDropConstraintAnalyzer.java
##########
@@ -47,11 +51,18 @@ protected void analyzeCommand(TableName tableName,
Map<String, String> partition
String constraintName = unescapeIdentifier(command.getChild(0).getText());
AlterTableDropConstraintDesc desc = new
AlterTableDropConstraintDesc(tableName, null, constraintName);
- rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(),
desc)));
Table table = getTable(tableName);
+ WriteEntity.WriteType writeType = null;
if (AcidUtils.isTransactionalTable(table)) {
setAcidDdlDesc(desc);
+ writeType = WriteType.DDL_EXCLUSIVE;
+ } else {
+ writeType =
WriteEntity.determineAlterTableWriteType(AlterTableType.DROP_CONSTRAINT);
}
+ inputs.add(new ReadEntity(table));
Review comment:
AlterTableDropConstraintDesc doesn't extend
AbstractAlterTableWithConstraintsDesc as is the case with
AlterTableAddConstraintDesc, So it cannot convert the descriptor object to add
inputs and outputs. The reason why AlterTableDropConstraintDesc cannot extend
AbstractAlterTableWithConstraintsDesc is that the input command only issues the
constraint name (ALTER TABLE foo DROP CONSTRAINT foo_constraint) but not the
constraint object (which is the case with ADD constraint) and
AbstractAlterTableWithConstraintsDesc takes constraint as an argument.
##########
File path: ql/src/test/results/clientnegative/groupby_join_pushdown.q.out
##########
@@ -1358,249 +1358,15 @@ STAGE PLANS:
PREHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1
PRIMARY KEY (ctinyint) DISABLE RELY
PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT pk_alltypesorc_1
PRIMARY KEY (ctinyint) DISABLE RELY
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-PREHOOK: type: QUERY
-PREHOOK: Input: default@alltypesorc
-#### A masked pattern was here ####
-POSTHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@alltypesorc
-#### A masked pattern was here ####
-STAGE DEPENDENCIES:
- Stage-1 is a root stage
- Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
- Stage: Stage-1
- Tez
-#### A masked pattern was here ####
- Edges:
- Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
- Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
-#### A masked pattern was here ####
- Vertices:
- Map 1
- Map Operator Tree:
- TableScan
- alias: f
- Statistics: Num rows: 12288 Data size: 73392 Basic stats:
COMPLETE Column stats: COMPLETE
- Select Operator
- expressions: ctinyint (type: tinyint), cint (type: int)
- outputColumnNames: _col0, _col1
- Statistics: Num rows: 12288 Data size: 73392 Basic stats:
COMPLETE Column stats: COMPLETE
- Reduce Output Operator
- key expressions: _col0 (type: tinyint)
- null sort order: z
- sort order: +
- Map-reduce partition columns: _col0 (type: tinyint)
- Statistics: Num rows: 12288 Data size: 73392 Basic
stats: COMPLETE Column stats: COMPLETE
- value expressions: _col1 (type: int)
- Execution mode: vectorized, llap
- LLAP IO: all inputs
- Map 4
- Map Operator Tree:
- TableScan
- alias: g
- Statistics: Num rows: 12288 Data size: 36696 Basic stats:
COMPLETE Column stats: COMPLETE
- Select Operator
- expressions: ctinyint (type: tinyint)
- outputColumnNames: _col0
- Statistics: Num rows: 12288 Data size: 36696 Basic stats:
COMPLETE Column stats: COMPLETE
- Reduce Output Operator
- key expressions: _col0 (type: tinyint)
- null sort order: z
- sort order: +
- Map-reduce partition columns: _col0 (type: tinyint)
- Statistics: Num rows: 12288 Data size: 36696 Basic
stats: COMPLETE Column stats: COMPLETE
- Execution mode: vectorized, llap
- LLAP IO: all inputs
- Reducer 2
- Execution mode: llap
- Reduce Operator Tree:
- Merge Join Operator
- condition map:
- Inner Join 0 to 1
- keys:
- 0 _col0 (type: tinyint)
- 1 _col0 (type: tinyint)
- outputColumnNames: _col0, _col1
- Statistics: Num rows: 1161499 Data size: 9267080 Basic stats:
COMPLETE Column stats: COMPLETE
- Group By Operator
- aggregations: sum(_col1)
- keys: _col0 (type: tinyint)
- minReductionHashAggr: 0.99
- mode: hash
- outputColumnNames: _col0, _col1
- Statistics: Num rows: 131 Data size: 1572 Basic stats:
COMPLETE Column stats: COMPLETE
- Reduce Output Operator
- key expressions: _col0 (type: tinyint)
- null sort order: z
- sort order: +
- Map-reduce partition columns: _col0 (type: tinyint)
- Statistics: Num rows: 131 Data size: 1572 Basic stats:
COMPLETE Column stats: COMPLETE
- value expressions: _col1 (type: bigint)
- Reducer 3
- Execution mode: vectorized, llap
- Reduce Operator Tree:
- Group By Operator
- aggregations: sum(VALUE._col0)
- keys: KEY._col0 (type: tinyint)
- mode: mergepartial
- outputColumnNames: _col0, _col1
- Statistics: Num rows: 130 Data size: 1560 Basic stats:
COMPLETE Column stats: COMPLETE
- Select Operator
- expressions: _col1 (type: bigint), _col0 (type: tinyint)
- outputColumnNames: _col0, _col1
- Statistics: Num rows: 130 Data size: 1560 Basic stats:
COMPLETE Column stats: COMPLETE
- File Output Operator
- compressed: false
- Statistics: Num rows: 130 Data size: 1560 Basic stats:
COMPLETE Column stats: COMPLETE
- table:
- input format:
org.apache.hadoop.mapred.SequenceFileInputFormat
- output format:
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
- serde:
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-
- Stage: Stage-0
- Fetch Operator
- limit: -1
- Processor Tree:
- ListSink
-
-PREHOOK: query: ALTER TABLE alltypesorc DROP CONSTRAINT pk_alltypesorc_1
-PREHOOK: type: ALTERTABLE_DROPCONSTRAINT
-POSTHOOK: query: ALTER TABLE alltypesorc DROP CONSTRAINT pk_alltypesorc_1
-POSTHOOK: type: ALTERTABLE_DROPCONSTRAINT
-PREHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT uk_alltypesorc_1 UNIQUE
(ctinyint) DISABLE RELY
-PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: ALTER TABLE alltypesorc ADD CONSTRAINT uk_alltypesorc_1
UNIQUE (ctinyint) DISABLE RELY
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: explain
-SELECT sum(f.cint), f.ctinyint
-FROM alltypesorc f JOIN alltypesorc g ON(f.ctinyint = g.ctinyint)
-GROUP BY f.ctinyint, g.ctinyint
-PREHOOK: type: QUERY
PREHOOK: Input: default@alltypesorc
+PREHOOK: Output: default@alltypesorc
+FAILED: Hive Internal Error:
org.apache.hadoop.hive.ql.metadata.HiveException(Error while invoking PreHook.
hooks: java.lang.RuntimeException: Cannot overwrite read-only table: alltypesorc
Review comment:
Fixed this by test failure.
--
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]