diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/DecimalUtil.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/DecimalUtil.java index d88f7d7..ef80059 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/DecimalUtil.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/DecimalUtil.java @@ -278,6 +278,24 @@ public static void ceiling(int i, HiveDecimalWritable input, DecimalColumnVector } } + public static void round(int i, HiveDecimal input, int decimalPlaces, DecimalColumnVector outputColVector) { + try { + outputColVector.set(i, RoundUtils.round(input, decimalPlaces)); + } catch (ArithmeticException e) { + outputColVector.noNulls = false; + outputColVector.isNull[i] = true; + } + } + + public static void round(int i, HiveDecimalWritable input, int decimalPlaces, DecimalColumnVector outputColVector) { + try { + outputColVector.set(i, RoundUtils.round(input.getHiveDecimal(), decimalPlaces)); + } catch (ArithmeticException e) { + outputColVector.noNulls = false; + outputColVector.isNull[i] = true; + } + } + public static void round(int i, HiveDecimal input, DecimalColumnVector outputColVector) { try { outputColVector.set(i, RoundUtils.round(input, outputColVector.scale)); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java index 421a737..9f3e8a3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncRoundWithNumDigitsDecimalToDecimal.java @@ -73,7 +73,7 @@ public void evaluate(VectorizedRowBatch batch) { // All must be selected otherwise size would be zero // Repeating property will not change. outputIsNull[0] = inputIsNull[0]; - DecimalUtil.round(0, vector[0], outputColVector); + DecimalUtil.round(0, vector[0], decimalPlaces, outputColVector); outputColVector.isRepeating = true; } else if (inputColVector.noNulls) { if (batch.selectedInUse) { @@ -82,14 +82,14 @@ public void evaluate(VectorizedRowBatch batch) { // Set isNull because decimal operation can yield a null. outputIsNull[i] = false; - DecimalUtil.round(i, vector[i], outputColVector); + DecimalUtil.round(i, vector[i], decimalPlaces, outputColVector); } } else { // Set isNull because decimal operation can yield a null. Arrays.fill(outputIsNull, 0, n, false); for(int i = 0; i != n; i++) { - DecimalUtil.round(i, vector[i], outputColVector); + DecimalUtil.round(i, vector[i], decimalPlaces, outputColVector); } } outputColVector.isRepeating = false; @@ -98,12 +98,12 @@ public void evaluate(VectorizedRowBatch batch) { for(int j = 0; j != n; j++) { int i = sel[j]; outputIsNull[i] = inputIsNull[i]; - DecimalUtil.round(i, vector[i], outputColVector); + DecimalUtil.round(i, vector[i], decimalPlaces, outputColVector); } } else { System.arraycopy(inputIsNull, 0, outputIsNull, 0, n); for(int i = 0; i != n; i++) { - DecimalUtil.round(i, vector[i], outputColVector); + DecimalUtil.round(i, vector[i], decimalPlaces, outputColVector); } } outputColVector.isRepeating = false; diff --git ql/src/test/queries/clientpositive/vector_decimal_round.q ql/src/test/queries/clientpositive/vector_decimal_round.q new file mode 100644 index 0000000..2b7a005 --- /dev/null +++ ql/src/test/queries/clientpositive/vector_decimal_round.q @@ -0,0 +1,55 @@ +SET hive.vectorized.execution.enabled=true; +set hive.fetch.task.conversion=minimal; + +create table decimal_tbl_txt (dec decimal(10,0)) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ' ' +STORED AS TEXTFILE; + +insert into table decimal_tbl_txt values(101); + +select * from decimal_tbl_txt; + +explain +select dec, round(dec, -1) from decimal_tbl_txt order by dec; + +select dec, round(dec, -1) from decimal_tbl_txt order by dec; + +explain +select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1); + +select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1); + +create table decimal_tbl_rc (dec decimal(10,0)) +row format serde 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe' stored as rcfile; + +insert into table decimal_tbl_rc values(101); + +select * from decimal_tbl_rc; + +explain +select dec, round(dec, -1) from decimal_tbl_rc order by dec; + +select dec, round(dec, -1) from decimal_tbl_rc order by dec; + +explain +select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1); + +select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1); + +create table decimal_tbl_orc (dec decimal(10,0)) +stored as orc; + +insert into table decimal_tbl_orc values(101); + +select * from decimal_tbl_orc; + +explain +select dec, round(dec, -1) from decimal_tbl_orc order by dec; + +select dec, round(dec, -1) from decimal_tbl_orc order by dec; + +explain +select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1); + +select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1); \ No newline at end of file diff --git ql/src/test/queries/clientpositive/vector_decimal_round_2.q ql/src/test/queries/clientpositive/vector_decimal_round_2.q new file mode 100644 index 0000000..e5f10d5 --- /dev/null +++ ql/src/test/queries/clientpositive/vector_decimal_round_2.q @@ -0,0 +1,119 @@ +SET hive.vectorized.execution.enabled=true; +set hive.fetch.task.conversion=minimal; + +create table decimal_tbl_1_orc (dec decimal(38,18)) +STORED AS ORC; + +insert into table decimal_tbl_1_orc values(55555); + +select * from decimal_tbl_1_orc; + +-- EXPLAIN +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +EXPLAIN +SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d; + +SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d; + +create table decimal_tbl_2_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC; + +insert into table decimal_tbl_2_orc values(125.315, -125.315); + +select * from decimal_tbl_2_orc; + +EXPLAIN +SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p; + +SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p; + +create table decimal_tbl_3_orc (dec decimal(38,18)) +STORED AS ORC; + +insert into table decimal_tbl_3_orc values(3.141592653589793); + +select * from decimal_tbl_3_orc; + +EXPLAIN +SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d; + +SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d; + +create table decimal_tbl_4_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC; + +insert into table decimal_tbl_4_orc values(1809242.3151111344, -1809242.3151111344); + +select * from decimal_tbl_4_orc; + +EXPLAIN +SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p; + +SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p; diff --git ql/src/test/results/clientpositive/tez/vector_decimal_round.q.out ql/src/test/results/clientpositive/tez/vector_decimal_round.q.out new file mode 100644 index 0000000..9ea95b9 --- /dev/null +++ ql/src/test/results/clientpositive/tez/vector_decimal_round.q.out @@ -0,0 +1,456 @@ +PREHOOK: query: create table decimal_tbl_txt (dec decimal(10,0)) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ' ' +STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_txt +POSTHOOK: query: create table decimal_tbl_txt (dec decimal(10,0)) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ' ' +STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_txt +PREHOOK: query: insert into table decimal_tbl_txt values(101) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__1 +PREHOOK: Output: default@decimal_tbl_txt +POSTHOOK: query: insert into table decimal_tbl_txt values(101) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__1 +POSTHOOK: Output: default@decimal_tbl_txt +POSTHOOK: Lineage: decimal_tbl_txt.dec EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_txt +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_txt +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +101 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by dec +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by dec +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_txt + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)), round(dec, -1) (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(10,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(11,0)) + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(10,0)), VALUE._col0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by dec +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by dec +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +101 100 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_txt + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: round(_col0, (- 1)) (type: decimal(11,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(10,0)) + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(10,0)), KEY.reducesinkkey0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +101 100 +PREHOOK: query: create table decimal_tbl_rc (dec decimal(10,0)) +row format serde 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe' stored as rcfile +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_rc +POSTHOOK: query: create table decimal_tbl_rc (dec decimal(10,0)) +row format serde 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe' stored as rcfile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_rc +PREHOOK: query: insert into table decimal_tbl_rc values(101) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__2 +PREHOOK: Output: default@decimal_tbl_rc +POSTHOOK: query: insert into table decimal_tbl_rc values(101) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__2 +POSTHOOK: Output: default@decimal_tbl_rc +POSTHOOK: Lineage: decimal_tbl_rc.dec EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_rc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_rc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +101 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by dec +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by dec +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_rc + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)), round(dec, -1) (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(10,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(11,0)) + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(10,0)), VALUE._col0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by dec +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by dec +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +101 100 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_rc + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: round(_col0, (- 1)) (type: decimal(11,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(10,0)) + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(10,0)), KEY.reducesinkkey0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +101 100 +PREHOOK: query: create table decimal_tbl_orc (dec decimal(10,0)) +stored as orc +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_orc +POSTHOOK: query: create table decimal_tbl_orc (dec decimal(10,0)) +stored as orc +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_orc +PREHOOK: query: insert into table decimal_tbl_orc values(101) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__3 +PREHOOK: Output: default@decimal_tbl_orc +POSTHOOK: query: insert into table decimal_tbl_orc values(101) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__3 +POSTHOOK: Output: default@decimal_tbl_orc +POSTHOOK: Lineage: decimal_tbl_orc.dec EXPRESSION [(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +101 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by dec +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by dec +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)), round(dec, -1) (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(10,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(11,0)) + Execution mode: vectorized + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(10,0)), VALUE._col0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by dec +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by dec +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +101 100 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: round(_col0, (- 1)) (type: decimal(11,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(10,0)) + Execution mode: vectorized + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(10,0)), KEY.reducesinkkey0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +101 100 diff --git ql/src/test/results/clientpositive/tez/vector_decimal_round_2.q.out ql/src/test/results/clientpositive/tez/vector_decimal_round_2.q.out new file mode 100644 index 0000000..0d00c2d --- /dev/null +++ ql/src/test/results/clientpositive/tez/vector_decimal_round_2.q.out @@ -0,0 +1,499 @@ +PREHOOK: query: create table decimal_tbl_1_orc (dec decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_1_orc +POSTHOOK: query: create table decimal_tbl_1_orc (dec decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_1_orc +PREHOOK: query: insert into table decimal_tbl_1_orc values(55555) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__1 +PREHOOK: Output: default@decimal_tbl_1_orc +POSTHOOK: query: insert into table decimal_tbl_1_orc values(55555) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__1 +POSTHOOK: Output: default@decimal_tbl_1_orc +POSTHOOK: Lineage: decimal_tbl_1_orc.dec EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_1_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_1_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +55555 +PREHOOK: query: -- EXPLAIN +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +EXPLAIN +SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +PREHOOK: type: QUERY +POSTHOOK: query: -- EXPLAIN +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +EXPLAIN +SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_1_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(dec) (type: decimal(21,0)), round(dec, 0) (type: decimal(21,0)), round(dec, 1) (type: decimal(22,1)), round(dec, 2) (type: decimal(23,2)), round(dec, 3) (type: decimal(24,3)), round(dec, -1) (type: decimal(21,0)), round(dec, -2) (type: decimal(21,0)), round(dec, -3) (type: decimal(21,0)), round(dec, -4) (type: decimal(21,0)), round(dec, -5) (type: decimal(21,0)), round(dec, -6) (type: decimal(21,0)), round(dec, -7) (type: decimal(21,0)), round(dec, -8) (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(21,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(21,0)), _col2 (type: decimal(22,1)), _col3 (type: decimal(23,2)), _col4 (type: decimal(24,3)), _col5 (type: decimal(21,0)), _col6 (type: decimal(21,0)), _col7 (type: decimal(21,0)), _col8 (type: decimal(21,0)), _col9 (type: decimal(21,0)), _col10 (type: decimal(21,0)), _col11 (type: decimal(21,0)), _col12 (type: decimal(21,0)) + Execution mode: vectorized + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(21,0)), VALUE._col0 (type: decimal(21,0)), VALUE._col1 (type: decimal(22,1)), VALUE._col2 (type: decimal(23,2)), VALUE._col3 (type: decimal(24,3)), VALUE._col4 (type: decimal(21,0)), VALUE._col5 (type: decimal(21,0)), VALUE._col6 (type: decimal(21,0)), VALUE._col7 (type: decimal(21,0)), VALUE._col8 (type: decimal(21,0)), VALUE._col9 (type: decimal(21,0)), VALUE._col10 (type: decimal(21,0)), VALUE._col11 (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +55555 55555 55555.0 55555.00 55555.000 55560 55600 56000 60000 100000 0 0 0 +PREHOOK: query: create table decimal_tbl_2_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_2_orc +POSTHOOK: query: create table decimal_tbl_2_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_2_orc +PREHOOK: query: insert into table decimal_tbl_2_orc values(125.315, -125.315) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__2 +PREHOOK: Output: default@decimal_tbl_2_orc +POSTHOOK: query: insert into table decimal_tbl_2_orc values(125.315, -125.315) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__2 +POSTHOOK: Output: default@decimal_tbl_2_orc +POSTHOOK: Lineage: decimal_tbl_2_orc.neg EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, type:string, comment:), ] +POSTHOOK: Lineage: decimal_tbl_2_orc.pos EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_2_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_2_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +125.315 -125.315 +PREHOOK: query: EXPLAIN +SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_2_orc + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(pos) (type: decimal(21,0)), round(pos, 0) (type: decimal(21,0)), round(pos, 1) (type: decimal(22,1)), round(pos, 2) (type: decimal(23,2)), round(pos, 3) (type: decimal(24,3)), round(pos, 4) (type: decimal(25,4)), round(pos, -1) (type: decimal(21,0)), round(pos, -2) (type: decimal(21,0)), round(pos, -3) (type: decimal(21,0)), round(pos, -4) (type: decimal(21,0)), round(neg) (type: decimal(21,0)), round(neg, 0) (type: decimal(21,0)), round(neg, 1) (type: decimal(22,1)), round(neg, 2) (type: decimal(23,2)), round(neg, 3) (type: decimal(24,3)), round(neg, 4) (type: decimal(25,4)), round(neg, -1) (type: decimal(21,0)), round(neg, -2) (type: decimal(21,0)), round(neg, -3) (type: decimal(21,0)), round(neg, -4) (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(21,0)) + sort order: + + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(21,0)), _col2 (type: decimal(22,1)), _col3 (type: decimal(23,2)), _col4 (type: decimal(24,3)), _col5 (type: decimal(25,4)), _col6 (type: decimal(21,0)), _col7 (type: decimal(21,0)), _col8 (type: decimal(21,0)), _col9 (type: decimal(21,0)), _col10 (type: decimal(21,0)), _col11 (type: decimal(21,0)), _col12 (type: decimal(22,1)), _col13 (type: decimal(23,2)), _col14 (type: decimal(24,3)), _col15 (type: decimal(25,4)), _col16 (type: decimal(21,0)), _col17 (type: decimal(21,0)), _col18 (type: decimal(21,0)), _col19 (type: decimal(21,0)) + Execution mode: vectorized + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(21,0)), VALUE._col0 (type: decimal(21,0)), VALUE._col1 (type: decimal(22,1)), VALUE._col2 (type: decimal(23,2)), VALUE._col3 (type: decimal(24,3)), VALUE._col4 (type: decimal(25,4)), VALUE._col5 (type: decimal(21,0)), VALUE._col6 (type: decimal(21,0)), VALUE._col7 (type: decimal(21,0)), VALUE._col8 (type: decimal(21,0)), VALUE._col9 (type: decimal(21,0)), VALUE._col10 (type: decimal(21,0)), VALUE._col11 (type: decimal(22,1)), VALUE._col12 (type: decimal(23,2)), VALUE._col13 (type: decimal(24,3)), VALUE._col14 (type: decimal(25,4)), VALUE._col15 (type: decimal(21,0)), VALUE._col16 (type: decimal(21,0)), VALUE._col17 (type: decimal(21,0)), VALUE._col18 (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +125 125 125.3 125.32 125.315 125.3150 130 100 0 0 -125 -125 -125.3 -125.32 -125.315 -125.3150 -130 -100 0 0 +PREHOOK: query: create table decimal_tbl_3_orc (dec decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_3_orc +POSTHOOK: query: create table decimal_tbl_3_orc (dec decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_3_orc +PREHOOK: query: insert into table decimal_tbl_3_orc values(3.141592653589793) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__3 +PREHOOK: Output: default@decimal_tbl_3_orc +POSTHOOK: query: insert into table decimal_tbl_3_orc values(3.141592653589793) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__3 +POSTHOOK: Output: default@decimal_tbl_3_orc +POSTHOOK: Lineage: decimal_tbl_3_orc.dec EXPRESSION [(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_3_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_3_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +3.141592653589793 +PREHOOK: query: EXPLAIN +SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_3_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(dec, -15) (type: decimal(21,0)), round(dec, -16) (type: decimal(21,0)), round(dec, -5) (type: decimal(21,0)), round(dec, -6) (type: decimal(21,0)), round(dec, -3) (type: decimal(21,0)), round(dec, -4) (type: decimal(21,0)), round(dec, -1) (type: decimal(21,0)), round(dec, -2) (type: decimal(21,0)), round(dec, 0) (type: decimal(21,0)), round(dec, 1) (type: decimal(22,1)), round(dec, 2) (type: decimal(23,2)), round(dec, 3) (type: decimal(24,3)), round(dec, -13) (type: decimal(21,0)), round(dec, 4) (type: decimal(25,4)), round(dec, 5) (type: decimal(26,5)), round(dec, 6) (type: decimal(27,6)), round(dec, 7) (type: decimal(28,7)), round(dec, 8) (type: decimal(29,8)), round(dec, 9) (type: decimal(30,9)), round(dec, 10) (type: decimal(31,10)), round(dec, 11) (type: decimal(32,11)), round(dec, 12) (type: decimal(33,12)), round(dec, 13) (type: decimal(34,13)), round(dec, -14) (type: decimal(21,0)), round(dec, 14) (type: decimal(35,14)), round(dec, 15) (type: decimal(36,15)), round(dec, 16) (type: decimal(37,16)), round(dec, -11) (type: decimal(21,0)), round(dec, -12) (type: decimal(21,0)), round(dec, -9) (type: decimal(21,0)), round(dec, -10) (type: decimal(21,0)), round(dec, -7) (type: decimal(21,0)), round(dec, -8) (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col2, _col20, _col21, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col3, _col31, _col32, _col33, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(21,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(21,0)), _col2 (type: decimal(21,0)), _col3 (type: decimal(21,0)), _col4 (type: decimal(21,0)), _col5 (type: decimal(21,0)), _col6 (type: decimal(21,0)), _col7 (type: decimal(21,0)), _col8 (type: decimal(21,0)), _col9 (type: decimal(21,0)), _col10 (type: decimal(21,0)), _col11 (type: decimal(21,0)), _col12 (type: decimal(21,0)), _col13 (type: decimal(21,0)), _col14 (type: decimal(21,0)), _col15 (type: decimal(21,0)), _col16 (type: decimal(21,0)), _col17 (type: decimal(22,1)), _col18 (type: decimal(23,2)), _col19 (type: decimal(24,3)), _col20 (type: decimal(25,4)), _col21 (type: decimal(26,5)), _col22 (type: decimal(27,6)), _col23 (type: decimal(28,7)), _col24 (type: decimal(29,8)), _col25 (type: decimal(30,9)), _col26 (type: decimal(31,10)), _col27 (type: decimal(32,11)), _col28 (type: decimal(33,12)), _col29 (type: decimal(34,13)), _col31 (type: decimal(35,14)), _col32 (type: decimal(36,15)), _col33 (type: decimal(37,16)) + Execution mode: vectorized + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(21,0)), VALUE._col0 (type: decimal(21,0)), VALUE._col1 (type: decimal(21,0)), VALUE._col2 (type: decimal(21,0)), VALUE._col3 (type: decimal(21,0)), VALUE._col4 (type: decimal(21,0)), VALUE._col5 (type: decimal(21,0)), VALUE._col6 (type: decimal(21,0)), VALUE._col7 (type: decimal(21,0)), VALUE._col8 (type: decimal(21,0)), VALUE._col9 (type: decimal(21,0)), VALUE._col10 (type: decimal(21,0)), VALUE._col11 (type: decimal(21,0)), VALUE._col12 (type: decimal(21,0)), VALUE._col13 (type: decimal(21,0)), VALUE._col14 (type: decimal(21,0)), VALUE._col15 (type: decimal(21,0)), VALUE._col16 (type: decimal(22,1)), VALUE._col17 (type: decimal(23,2)), VALUE._col18 (type: decimal(24,3)), VALUE._col19 (type: decimal(25,4)), VALUE._col20 (type: decimal(26,5)), VALUE._col21 (type: decimal(27,6)), VALUE._col22 (type: decimal(28,7)), VALUE._col23 (type: decimal(29,8)), VALUE._col24 (type: decimal(30,9)), VALUE._col25 (type: decimal(31,10)), VALUE._col26 (type: decimal(32,11)), VALUE._col27 (type: decimal(33,12)), VALUE._col28 (type: decimal(34,13)), VALUE._col28 (type: decimal(34,13)), VALUE._col29 (type: decimal(35,14)), VALUE._col30 (type: decimal(36,15)), VALUE._col31 (type: decimal(37,16)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col30, _col31, _col32, _col33 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3.1 3.14 3.142 3.1416 3.14159 3.141593 3.1415927 3.14159265 3.141592654 3.1415926536 3.14159265359 3.141592653590 3.1415926535898 3.1415926535898 3.14159265358979 3.141592653589793 3.1415926535897930 +PREHOOK: query: create table decimal_tbl_4_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_4_orc +POSTHOOK: query: create table decimal_tbl_4_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_4_orc +PREHOOK: query: insert into table decimal_tbl_4_orc values(1809242.3151111344, -1809242.3151111344) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__4 +PREHOOK: Output: default@decimal_tbl_4_orc +POSTHOOK: query: insert into table decimal_tbl_4_orc values(1809242.3151111344, -1809242.3151111344) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__4 +POSTHOOK: Output: default@decimal_tbl_4_orc +POSTHOOK: Lineage: decimal_tbl_4_orc.neg EXPRESSION [(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col2, type:string, comment:), ] +POSTHOOK: Lineage: decimal_tbl_4_orc.pos EXPRESSION [(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_4_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_4_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +1809242.3151111344 -1809242.3151111344 +PREHOOK: query: EXPLAIN +SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: decimal_tbl_4_orc + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(pos, 9) (type: decimal(30,9)), round(neg, 9) (type: decimal(30,9)), round(1809242.3151111344, 9) (type: decimal(17,9)), round((- 1809242.3151111344), 9) (type: decimal(17,9)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(30,9)) + sort order: + + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(30,9)), _col2 (type: decimal(17,9)), _col3 (type: decimal(17,9)) + Reducer 2 + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(30,9)), VALUE._col0 (type: decimal(30,9)), VALUE._col1 (type: decimal(17,9)), VALUE._col2 (type: decimal(17,9)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +1809242.315111134 -1809242.315111134 1809242.315111134 -1809242.315111134 diff --git ql/src/test/results/clientpositive/vector_decimal_round.q.out ql/src/test/results/clientpositive/vector_decimal_round.q.out new file mode 100644 index 0000000..25e5cfa --- /dev/null +++ ql/src/test/results/clientpositive/vector_decimal_round.q.out @@ -0,0 +1,414 @@ +PREHOOK: query: create table decimal_tbl_txt (dec decimal(10,0)) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ' ' +STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_txt +POSTHOOK: query: create table decimal_tbl_txt (dec decimal(10,0)) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ' ' +STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_txt +PREHOOK: query: insert into table decimal_tbl_txt values(101) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__1 +PREHOOK: Output: default@decimal_tbl_txt +POSTHOOK: query: insert into table decimal_tbl_txt values(101) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__1 +POSTHOOK: Output: default@decimal_tbl_txt +POSTHOOK: Lineage: decimal_tbl_txt.dec EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_txt +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_txt +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +101 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by dec +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by dec +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_txt + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)), round(dec, -1) (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(10,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(11,0)) + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(10,0)), VALUE._col0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by dec +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by dec +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +101 100 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_txt + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: round(_col0, (- 1)) (type: decimal(11,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(10,0)) + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(10,0)), KEY.reducesinkkey0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_txt order by round(dec, -1) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_txt +#### A masked pattern was here #### +101 100 +PREHOOK: query: create table decimal_tbl_rc (dec decimal(10,0)) +row format serde 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe' stored as rcfile +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_rc +POSTHOOK: query: create table decimal_tbl_rc (dec decimal(10,0)) +row format serde 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe' stored as rcfile +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_rc +PREHOOK: query: insert into table decimal_tbl_rc values(101) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__2 +PREHOOK: Output: default@decimal_tbl_rc +POSTHOOK: query: insert into table decimal_tbl_rc values(101) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__2 +POSTHOOK: Output: default@decimal_tbl_rc +POSTHOOK: Lineage: decimal_tbl_rc.dec EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_rc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_rc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +101 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by dec +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by dec +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_rc + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)), round(dec, -1) (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(10,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(11,0)) + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(10,0)), VALUE._col0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by dec +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by dec +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +101 100 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_rc + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: round(_col0, (- 1)) (type: decimal(11,0)) + sort order: + + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(10,0)) + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(10,0)), KEY.reducesinkkey0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_rc order by round(dec, -1) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_rc +#### A masked pattern was here #### +101 100 +PREHOOK: query: create table decimal_tbl_orc (dec decimal(10,0)) +stored as orc +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_orc +POSTHOOK: query: create table decimal_tbl_orc (dec decimal(10,0)) +stored as orc +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_orc +PREHOOK: query: insert into table decimal_tbl_orc values(101) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__3 +PREHOOK: Output: default@decimal_tbl_orc +POSTHOOK: query: insert into table decimal_tbl_orc values(101) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__3 +POSTHOOK: Output: default@decimal_tbl_orc +POSTHOOK: Lineage: decimal_tbl_orc.dec EXPRESSION [(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +101 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by dec +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by dec +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)), round(dec, -1) (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(10,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(11,0)) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(10,0)), VALUE._col0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by dec +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by dec +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +101 100 +PREHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +PREHOOK: type: QUERY +POSTHOOK: query: explain +select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: dec (type: decimal(10,0)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: round(_col0, (- 1)) (type: decimal(11,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(10,0)) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(10,0)), KEY.reducesinkkey0 (type: decimal(11,0)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +POSTHOOK: query: select dec, round(dec, -1) from decimal_tbl_orc order by round(dec, -1) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_orc +#### A masked pattern was here #### +101 100 diff --git ql/src/test/results/clientpositive/vector_decimal_round_2.q.out ql/src/test/results/clientpositive/vector_decimal_round_2.q.out new file mode 100644 index 0000000..482f536 --- /dev/null +++ ql/src/test/results/clientpositive/vector_decimal_round_2.q.out @@ -0,0 +1,471 @@ +PREHOOK: query: create table decimal_tbl_1_orc (dec decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_1_orc +POSTHOOK: query: create table decimal_tbl_1_orc (dec decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_1_orc +PREHOOK: query: insert into table decimal_tbl_1_orc values(55555) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__1 +PREHOOK: Output: default@decimal_tbl_1_orc +POSTHOOK: query: insert into table decimal_tbl_1_orc values(55555) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__1 +POSTHOOK: Output: default@decimal_tbl_1_orc +POSTHOOK: Lineage: decimal_tbl_1_orc.dec EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_1_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_1_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +55555 +PREHOOK: query: -- EXPLAIN +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +EXPLAIN +SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +PREHOOK: type: QUERY +POSTHOOK: query: -- EXPLAIN +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +-- SELECT dec, round(null), round(null, 0), round(125, null), +-- round(1.0/0.0, 0), round(power(-1.0,0.5), 0) +-- FROM decimal_tbl_1_orc ORDER BY dec; + +EXPLAIN +SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_1_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(dec) (type: decimal(21,0)), round(dec, 0) (type: decimal(21,0)), round(dec, 1) (type: decimal(22,1)), round(dec, 2) (type: decimal(23,2)), round(dec, 3) (type: decimal(24,3)), round(dec, -1) (type: decimal(21,0)), round(dec, -2) (type: decimal(21,0)), round(dec, -3) (type: decimal(21,0)), round(dec, -4) (type: decimal(21,0)), round(dec, -5) (type: decimal(21,0)), round(dec, -6) (type: decimal(21,0)), round(dec, -7) (type: decimal(21,0)), round(dec, -8) (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(21,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(21,0)), _col2 (type: decimal(22,1)), _col3 (type: decimal(23,2)), _col4 (type: decimal(24,3)), _col5 (type: decimal(21,0)), _col6 (type: decimal(21,0)), _col7 (type: decimal(21,0)), _col8 (type: decimal(21,0)), _col9 (type: decimal(21,0)), _col10 (type: decimal(21,0)), _col11 (type: decimal(21,0)), _col12 (type: decimal(21,0)) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(21,0)), VALUE._col0 (type: decimal(21,0)), VALUE._col1 (type: decimal(22,1)), VALUE._col2 (type: decimal(23,2)), VALUE._col3 (type: decimal(24,3)), VALUE._col4 (type: decimal(21,0)), VALUE._col5 (type: decimal(21,0)), VALUE._col6 (type: decimal(21,0)), VALUE._col7 (type: decimal(21,0)), VALUE._col8 (type: decimal(21,0)), VALUE._col9 (type: decimal(21,0)), VALUE._col10 (type: decimal(21,0)), VALUE._col11 (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT + round(dec) as d, round(dec, 0), round(dec, 1), round(dec, 2), round(dec, 3), + round(dec, -1), round(dec, -2), round(dec, -3), round(dec, -4), + round(dec, -5), round(dec, -6), round(dec, -7), round(dec, -8) +FROM decimal_tbl_1_orc ORDER BY d +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_1_orc +#### A masked pattern was here #### +55555 55555 55555.0 55555.00 55555.000 55560 55600 56000 60000 100000 0 0 0 +PREHOOK: query: create table decimal_tbl_2_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_2_orc +POSTHOOK: query: create table decimal_tbl_2_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_2_orc +PREHOOK: query: insert into table decimal_tbl_2_orc values(125.315, -125.315) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__2 +PREHOOK: Output: default@decimal_tbl_2_orc +POSTHOOK: query: insert into table decimal_tbl_2_orc values(125.315, -125.315) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__2 +POSTHOOK: Output: default@decimal_tbl_2_orc +POSTHOOK: Lineage: decimal_tbl_2_orc.neg EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, type:string, comment:), ] +POSTHOOK: Lineage: decimal_tbl_2_orc.pos EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_2_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_2_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +125.315 -125.315 +PREHOOK: query: EXPLAIN +SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_2_orc + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(pos) (type: decimal(21,0)), round(pos, 0) (type: decimal(21,0)), round(pos, 1) (type: decimal(22,1)), round(pos, 2) (type: decimal(23,2)), round(pos, 3) (type: decimal(24,3)), round(pos, 4) (type: decimal(25,4)), round(pos, -1) (type: decimal(21,0)), round(pos, -2) (type: decimal(21,0)), round(pos, -3) (type: decimal(21,0)), round(pos, -4) (type: decimal(21,0)), round(neg) (type: decimal(21,0)), round(neg, 0) (type: decimal(21,0)), round(neg, 1) (type: decimal(22,1)), round(neg, 2) (type: decimal(23,2)), round(neg, 3) (type: decimal(24,3)), round(neg, 4) (type: decimal(25,4)), round(neg, -1) (type: decimal(21,0)), round(neg, -2) (type: decimal(21,0)), round(neg, -3) (type: decimal(21,0)), round(neg, -4) (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(21,0)) + sort order: + + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(21,0)), _col2 (type: decimal(22,1)), _col3 (type: decimal(23,2)), _col4 (type: decimal(24,3)), _col5 (type: decimal(25,4)), _col6 (type: decimal(21,0)), _col7 (type: decimal(21,0)), _col8 (type: decimal(21,0)), _col9 (type: decimal(21,0)), _col10 (type: decimal(21,0)), _col11 (type: decimal(21,0)), _col12 (type: decimal(22,1)), _col13 (type: decimal(23,2)), _col14 (type: decimal(24,3)), _col15 (type: decimal(25,4)), _col16 (type: decimal(21,0)), _col17 (type: decimal(21,0)), _col18 (type: decimal(21,0)), _col19 (type: decimal(21,0)) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(21,0)), VALUE._col0 (type: decimal(21,0)), VALUE._col1 (type: decimal(22,1)), VALUE._col2 (type: decimal(23,2)), VALUE._col3 (type: decimal(24,3)), VALUE._col4 (type: decimal(25,4)), VALUE._col5 (type: decimal(21,0)), VALUE._col6 (type: decimal(21,0)), VALUE._col7 (type: decimal(21,0)), VALUE._col8 (type: decimal(21,0)), VALUE._col9 (type: decimal(21,0)), VALUE._col10 (type: decimal(21,0)), VALUE._col11 (type: decimal(22,1)), VALUE._col12 (type: decimal(23,2)), VALUE._col13 (type: decimal(24,3)), VALUE._col14 (type: decimal(25,4)), VALUE._col15 (type: decimal(21,0)), VALUE._col16 (type: decimal(21,0)), VALUE._col17 (type: decimal(21,0)), VALUE._col18 (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT + round(pos) as p, round(pos, 0), + round(pos, 1), round(pos, 2), round(pos, 3), round(pos, 4), + round(pos, -1), round(pos, -2), round(pos, -3), round(pos, -4), + round(neg), round(neg, 0), + round(neg, 1), round(neg, 2), round(neg, 3), round(neg, 4), + round(neg, -1), round(neg, -2), round(neg, -3), round(neg, -4) +FROM decimal_tbl_2_orc ORDER BY p +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_2_orc +#### A masked pattern was here #### +125 125 125.3 125.32 125.315 125.3150 130 100 0 0 -125 -125 -125.3 -125.32 -125.315 -125.3150 -130 -100 0 0 +PREHOOK: query: create table decimal_tbl_3_orc (dec decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_3_orc +POSTHOOK: query: create table decimal_tbl_3_orc (dec decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_3_orc +PREHOOK: query: insert into table decimal_tbl_3_orc values(3.141592653589793) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__3 +PREHOOK: Output: default@decimal_tbl_3_orc +POSTHOOK: query: insert into table decimal_tbl_3_orc values(3.141592653589793) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__3 +POSTHOOK: Output: default@decimal_tbl_3_orc +POSTHOOK: Lineage: decimal_tbl_3_orc.dec EXPRESSION [(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_3_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_3_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +3.141592653589793 +PREHOOK: query: EXPLAIN +SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_3_orc + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(dec, -15) (type: decimal(21,0)), round(dec, -16) (type: decimal(21,0)), round(dec, -5) (type: decimal(21,0)), round(dec, -6) (type: decimal(21,0)), round(dec, -3) (type: decimal(21,0)), round(dec, -4) (type: decimal(21,0)), round(dec, -1) (type: decimal(21,0)), round(dec, -2) (type: decimal(21,0)), round(dec, 0) (type: decimal(21,0)), round(dec, 1) (type: decimal(22,1)), round(dec, 2) (type: decimal(23,2)), round(dec, 3) (type: decimal(24,3)), round(dec, -13) (type: decimal(21,0)), round(dec, 4) (type: decimal(25,4)), round(dec, 5) (type: decimal(26,5)), round(dec, 6) (type: decimal(27,6)), round(dec, 7) (type: decimal(28,7)), round(dec, 8) (type: decimal(29,8)), round(dec, 9) (type: decimal(30,9)), round(dec, 10) (type: decimal(31,10)), round(dec, 11) (type: decimal(32,11)), round(dec, 12) (type: decimal(33,12)), round(dec, 13) (type: decimal(34,13)), round(dec, -14) (type: decimal(21,0)), round(dec, 14) (type: decimal(35,14)), round(dec, 15) (type: decimal(36,15)), round(dec, 16) (type: decimal(37,16)), round(dec, -11) (type: decimal(21,0)), round(dec, -12) (type: decimal(21,0)), round(dec, -9) (type: decimal(21,0)), round(dec, -10) (type: decimal(21,0)), round(dec, -7) (type: decimal(21,0)), round(dec, -8) (type: decimal(21,0)) + outputColumnNames: _col0, _col1, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col2, _col20, _col21, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col3, _col31, _col32, _col33, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(21,0)) + sort order: + + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(21,0)), _col2 (type: decimal(21,0)), _col3 (type: decimal(21,0)), _col4 (type: decimal(21,0)), _col5 (type: decimal(21,0)), _col6 (type: decimal(21,0)), _col7 (type: decimal(21,0)), _col8 (type: decimal(21,0)), _col9 (type: decimal(21,0)), _col10 (type: decimal(21,0)), _col11 (type: decimal(21,0)), _col12 (type: decimal(21,0)), _col13 (type: decimal(21,0)), _col14 (type: decimal(21,0)), _col15 (type: decimal(21,0)), _col16 (type: decimal(21,0)), _col17 (type: decimal(22,1)), _col18 (type: decimal(23,2)), _col19 (type: decimal(24,3)), _col20 (type: decimal(25,4)), _col21 (type: decimal(26,5)), _col22 (type: decimal(27,6)), _col23 (type: decimal(28,7)), _col24 (type: decimal(29,8)), _col25 (type: decimal(30,9)), _col26 (type: decimal(31,10)), _col27 (type: decimal(32,11)), _col28 (type: decimal(33,12)), _col29 (type: decimal(34,13)), _col31 (type: decimal(35,14)), _col32 (type: decimal(36,15)), _col33 (type: decimal(37,16)) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(21,0)), VALUE._col0 (type: decimal(21,0)), VALUE._col1 (type: decimal(21,0)), VALUE._col2 (type: decimal(21,0)), VALUE._col3 (type: decimal(21,0)), VALUE._col4 (type: decimal(21,0)), VALUE._col5 (type: decimal(21,0)), VALUE._col6 (type: decimal(21,0)), VALUE._col7 (type: decimal(21,0)), VALUE._col8 (type: decimal(21,0)), VALUE._col9 (type: decimal(21,0)), VALUE._col10 (type: decimal(21,0)), VALUE._col11 (type: decimal(21,0)), VALUE._col12 (type: decimal(21,0)), VALUE._col13 (type: decimal(21,0)), VALUE._col14 (type: decimal(21,0)), VALUE._col15 (type: decimal(21,0)), VALUE._col16 (type: decimal(22,1)), VALUE._col17 (type: decimal(23,2)), VALUE._col18 (type: decimal(24,3)), VALUE._col19 (type: decimal(25,4)), VALUE._col20 (type: decimal(26,5)), VALUE._col21 (type: decimal(27,6)), VALUE._col22 (type: decimal(28,7)), VALUE._col23 (type: decimal(29,8)), VALUE._col24 (type: decimal(30,9)), VALUE._col25 (type: decimal(31,10)), VALUE._col26 (type: decimal(32,11)), VALUE._col27 (type: decimal(33,12)), VALUE._col28 (type: decimal(34,13)), VALUE._col28 (type: decimal(34,13)), VALUE._col29 (type: decimal(35,14)), VALUE._col30 (type: decimal(36,15)), VALUE._col31 (type: decimal(37,16)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col30, _col31, _col32, _col33 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT + round(dec, -15) as d, round(dec, -16), + round(dec, -13), round(dec, -14), + round(dec, -11), round(dec, -12), + round(dec, -9), round(dec, -10), + round(dec, -7), round(dec, -8), + round(dec, -5), round(dec, -6), + round(dec, -3), round(dec, -4), + round(dec, -1), round(dec, -2), + round(dec, 0), round(dec, 1), + round(dec, 2), round(dec, 3), + round(dec, 4), round(dec, 5), + round(dec, 6), round(dec, 7), + round(dec, 8), round(dec, 9), + round(dec, 10), round(dec, 11), + round(dec, 12), round(dec, 13), + round(dec, 13), round(dec, 14), + round(dec, 15), round(dec, 16) +FROM decimal_tbl_3_orc ORDER BY d +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_3_orc +#### A masked pattern was here #### +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3.1 3.14 3.142 3.1416 3.14159 3.141593 3.1415927 3.14159265 3.141592654 3.1415926536 3.14159265359 3.141592653590 3.1415926535898 3.1415926535898 3.14159265358979 3.141592653589793 3.1415926535897930 +PREHOOK: query: create table decimal_tbl_4_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@decimal_tbl_4_orc +POSTHOOK: query: create table decimal_tbl_4_orc (pos decimal(38,18), neg decimal(38,18)) +STORED AS ORC +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@decimal_tbl_4_orc +PREHOOK: query: insert into table decimal_tbl_4_orc values(1809242.3151111344, -1809242.3151111344) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__4 +PREHOOK: Output: default@decimal_tbl_4_orc +POSTHOOK: query: insert into table decimal_tbl_4_orc values(1809242.3151111344, -1809242.3151111344) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__4 +POSTHOOK: Output: default@decimal_tbl_4_orc +POSTHOOK: Lineage: decimal_tbl_4_orc.neg EXPRESSION [(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col2, type:string, comment:), ] +POSTHOOK: Lineage: decimal_tbl_4_orc.pos EXPRESSION [(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +PREHOOK: query: select * from decimal_tbl_4_orc +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +POSTHOOK: query: select * from decimal_tbl_4_orc +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +1809242.3151111344 -1809242.3151111344 +PREHOOK: query: EXPLAIN +SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: decimal_tbl_4_orc + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: round(pos, 9) (type: decimal(30,9)), round(neg, 9) (type: decimal(30,9)), round(1809242.3151111344, 9) (type: decimal(17,9)), round((- 1809242.3151111344), 9) (type: decimal(17,9)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(30,9)) + sort order: + + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(30,9)), _col2 (type: decimal(17,9)), _col3 (type: decimal(17,9)) + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: decimal(30,9)), VALUE._col0 (type: decimal(30,9)), VALUE._col1 (type: decimal(17,9)), VALUE._col2 (type: decimal(17,9)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT round(pos, 9) as p, round(neg, 9), round(1809242.3151111344BD, 9), round(-1809242.3151111344BD, 9) +FROM decimal_tbl_4_orc ORDER BY p +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_tbl_4_orc +#### A masked pattern was here #### +1809242.315111134 -1809242.315111134 1809242.315111134 -1809242.315111134