You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Hive QA (JIRA)" <ji...@apache.org> on 2019/04/02 02:01:00 UTC
[jira] [Commented] (HIVE-21539) GroupBy + where clause on same
column results in incorrect query rewrite
[ https://issues.apache.org/jira/browse/HIVE-21539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16807348#comment-16807348 ]
Hive QA commented on HIVE-21539:
--------------------------------
| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 9m 33s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 14s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 44s{color} | {color:green} master passed {color} |
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue} 4m 28s{color} | {color:blue} ql in master has 2258 extant Findbugs warnings. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 1m 5s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 1m 38s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 13s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green} 1m 13s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} checkstyle {color} | {color:red} 0m 45s{color} | {color:red} ql: The patch generated 2 new + 1 unchanged - 0 fixed = 3 total (was 1) {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 4m 42s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 1m 9s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 15s{color} | {color:green} The patch does not generate ASF License warnings. {color} |
| {color:black}{color} | {color:black} {color} | {color:black} 27m 19s{color} | {color:black} {color} |
\\
\\
|| Subsystem || Report/Notes ||
| Optional Tests | asflicense javac javadoc findbugs checkstyle compile |
| uname | Linux hiveptest-server-upstream 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux |
| Build tool | maven |
| Personality | /data/hiveptest/working/yetus_PreCommit-HIVE-Build-16807/dev-support/hive-personality.sh |
| git revision | master / 2111c01 |
| Default Java | 1.8.0_111 |
| findbugs | v3.0.0 |
| checkstyle | http://104.198.109.242/logs//PreCommit-HIVE-Build-16807/yetus/diff-checkstyle-ql.txt |
| modules | C: ql U: ql |
| Console output | http://104.198.109.242/logs//PreCommit-HIVE-Build-16807/yetus.txt |
| Powered by | Apache Yetus http://yetus.apache.org |
This message was automatically generated.
> GroupBy + where clause on same column results in incorrect query rewrite
> ------------------------------------------------------------------------
>
> Key: HIVE-21539
> URL: https://issues.apache.org/jira/browse/HIVE-21539
> Project: Hive
> Issue Type: Bug
> Components: CBO
> Affects Versions: 4.0.0
> Reporter: anishek
> Assignee: Vineet Garg
> Priority: Major
> Attachments: HIVE-21539.1.patch
>
>
> {code}
> create table a (i int, j string);
> insert into a values ( 1, 'a'),(2,'b');
> explain extended select min(j) from a where j='a' group by j;
> +----------------------------------------------------+
> | Explain |
> +----------------------------------------------------+
> | OPTIMIZED SQL: SELECT MIN(TRUE) AS `_o__c0` |
> | FROM `default`.`a` |
> | WHERE `j` = 'a' |
> | GROUP BY TRUE |
> | STAGE DEPENDENCIES: |
> | Stage-1 is a root stage |
> | Stage-0 depends on stages: Stage-1 |
> | |
> | STAGE PLANS: |
> | Stage: Stage-1 |
> | Tez |
> | DagId: anagarwal_20190318153535_25c1f460-1986-475e-9995-9f6342029dd8:11 |
> | Edges: |
> | Reducer 2 <- Map 1 (SIMPLE_EDGE) |
> | DagName: anagarwal_20190318153535_25c1f460-1986-475e-9995-9f6342029dd8:11 |
> | Vertices: |
> | Map 1 |
> | Map Operator Tree: |
> | TableScan |
> | alias: a |
> | filterExpr: (j = 'a') (type: boolean) |
> | Statistics: Num rows: 2 Data size: 170 Basic stats: COMPLETE Column stats: COMPLETE |
> | GatherStats: false |
> | Filter Operator |
> | isSamplingPred: false |
> | predicate: (j = 'a') (type: boolean) |
> | Statistics: Num rows: 1 Data size: 85 Basic stats: COMPLETE Column stats: COMPLETE |
> | Select Operator |
> | Statistics: Num rows: 1 Data size: 85 Basic stats: COMPLETE Column stats: COMPLETE |
> | Group By Operator |
> | aggregations: min(true) |
> | keys: true (type: boolean) |
> | mode: hash |
> | outputColumnNames: _col0, _col1 |
> | Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE |
> | Reduce Output Operator |
> | key expressions: _col0 (type: boolean) |
> | null sort order: a |
> | sort order: + |
> | Map-reduce partition columns: _col0 (type: boolean) |
> | Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE |
> | tag: -1 |
> | value expressions: _col1 (type: boolean) |
> | auto parallelism: true |
> | Path -> Alias: |
> | hdfs://localhost:9000/tmp/hive/warehouse/a [a] |
> | Path -> Partition: |
> | hdfs://localhost:9000/tmp/hive/warehouse/a |
> | Partition |
> | base file name: a |
> | input format: org.apache.hadoop.mapred.TextInputFormat |
> | output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat |
> | properties: |
> | COLUMN_STATS_ACCURATE {"BASIC_STATS":"true","COLUMN_STATS":{"i":"true","j":"true"}} |
> | bucket_count -1 |
> | bucketing_version 2 |
> | column.name.delimiter , |
> | columns i,j |
> | columns.comments |
> | columns.types int:string |
> | file.inputformat org.apache.hadoop.mapred.TextInputFormat |
> | file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat |
> | location hdfs://localhost:9000/tmp/hive/warehouse/a |
> | name default.a |
> | numFiles 3 |
> | numRows 2 |
> | rawDataSize 6 |
> | serialization.ddl struct a { i32 i, string j} |
> | serialization.format 1 |
> | serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
> | totalSize 16 |
> | transient_lastDdlTime 1552903148 |
> | serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
> | |
> | input format: org.apache.hadoop.mapred.TextInputFormat |
> | output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat |
> | properties: |
> | COLUMN_STATS_ACCURATE {"BASIC_STATS":"true","COLUMN_STATS":{"i":"true","j":"true"}} |
> | bucket_count -1 |
> | bucketing_version 2 |
> | column.name.delimiter , |
> | columns i,j |
> | columns.comments |
> | columns.types int:string |
> | file.inputformat org.apache.hadoop.mapred.TextInputFormat |
> | file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat |
> | location hdfs://localhost:9000/tmp/hive/warehouse/a |
> | name default.a |
> | numFiles 3 |
> | numRows 2 |
> | rawDataSize 6 |
> | serialization.ddl struct a { i32 i, string j} |
> | serialization.format 1 |
> | serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
> | totalSize 16 |
> | transient_lastDdlTime 1552903148 |
> | serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
> | name: default.a |
> | name: default.a |
> | Truncated Path -> Alias: |
> +----------------------------------------------------+
> | Explain |
> +----------------------------------------------------+
> | /a [a] |
> | Reducer 2 |
> | Needs Tagging: false |
> | Reduce Operator Tree: |
> | Group By Operator |
> | aggregations: min(VALUE._col0) |
> | keys: KEY._col0 (type: boolean) |
> | mode: mergepartial |
> | outputColumnNames: _col0, _col1 |
> | Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE |
> | Select Operator |
> | expressions: _col1 (type: boolean) |
> | outputColumnNames: _col0 |
> | Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE |
> | File Output Operator |
> | compressed: false |
> | GlobalTableId: 0 |
> | directory: hdfs://localhost:9000/tmp/hive/anagarwal/20f7b890-606b-4815-a56e-ab3384ef58f5/hive_2019-03-18_15-35-35_644_3057456177912469405-1/-mr-10001/.hive-staging_hive_2019-03-18_15-35-35_644_3057456177912469405-1/-ext-10002 |
> | NumFilesPerFileSink: 1 |
> | Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE |
> | Stats Publishing Key Prefix: hdfs://localhost:9000/tmp/hive/anagarwal/20f7b890-606b-4815-a56e-ab3384ef58f5/hive_2019-03-18_15-35-35_644_3057456177912469405-1/-mr-10001/.hive-staging_hive_2019-03-18_15-35-35_644_3057456177912469405-1/-ext-10002/ |
> | table: |
> | input format: org.apache.hadoop.mapred.SequenceFileInputFormat |
> | output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat |
> | properties: |
> | columns _col0 |
> | columns.types boolean |
> | escape.delim \ |
> | hive.serialization.extend.additional.nesting.levels true |
> | serialization.escape.crlf true |
> | serialization.format 1 |
> | serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
> | serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
> | TotalFiles: 1 |
> | GatherStats: false |
> | MultiFileSpray: false |
> | |
> | Stage: Stage-0 |
> | Fetch Operator |
> | limit: -1 |
> | Processor Tree: |
> | ListSink |
> | |
> +----------------------------------------------------+
> {code}
> query is rewritten with *true* as the column value.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)