[jira] [Commented] (HIVE-22816) QueryCache: Queries using views can have them cached after CTE expansion

2020-02-03 Thread Jesus Camacho Rodriguez (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-22816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17029427#comment-17029427
 ] 

Jesus Camacho Rodriguez commented on HIVE-22816:


+1

> QueryCache: Queries using views can have them cached after CTE expansion
> 
>
> Key: HIVE-22816
> URL: https://issues.apache.org/jira/browse/HIVE-22816
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Reporter: Gopal Vijayaraghavan
>Assignee: Gopal Vijayaraghavan
>Priority: Major
> Attachments: HIVE-22816.1.patch
>
>
> {code}
> create view ss_null as select * from store_Sales where ss_Sold_date_sk is 
> null;
> select count(ss_ticket_number) from ss_null;
> with ss_null_cte as 
> (select * from store_Sales where ss_Sold_date_sk is null)
> select count(ss_ticket_number) from ss_null_cte;
> {code}
> Are treated differently by the query cache, however their execution is 
> identical.
> CBO rewrites the view query into AST form as follows
> {code}
> SELECT COUNT(`ss_ticket_number`) AS `$f0`
> FROM `tpcds_bin_partitioned_acid_orc_1`.`store_sales`
> WHERE `ss_sold_date_sk` IS NULL
> {code}
> But retains the write-entity for the VIRTUAL_VIEW for Ranger authorization 
> {code}
> 0: jdbc:hive2://localhost:10013> explain dependency select count(distinct 
> ss_ticket_number) from ss_null;
> ++
> |  Explain   |
> ++
> | 
> {"input_tables":[{"tablename":"tpcds_bin_partitioned_acid_orc_1@ss_null","tabletype":"VIRTUAL_VIEW"},{"tablename":"tpcds_bin_partitioned_acid_orc_1@store_sales","tabletype":"MANAGED_TABLE","tableParents":"[tpcds_bin_partitioned_acid_orc_1@ss_null]"}],"input_partitions":[{"partitionName":"tpcds_bin_partitioned_acid_orc_1@store_sales@ss_sold_date_sk=__HIVE_DEFAULT_PARTITION__"}]}
>  |
> ++
> {code}
> Causing Query cache to print out
> {code}
> parse.CalcitePlanner: Not eligible for results caching - query contains 
> non-transactional tables [ss_null]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (HIVE-22816) QueryCache: Queries using views can have them cached after CTE expansion

2020-02-01 Thread Hive QA (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-22816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17028021#comment-17028021
 ] 

Hive QA commented on HIVE-22816:




Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12992396/HIVE-22816.1.patch

{color:red}ERROR:{color} -1 due to no test(s) being added or modified.

{color:green}SUCCESS:{color} +1 due to 17958 tests passed

Test results: 
https://builds.apache.org/job/PreCommit-HIVE-Build/20439/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/20439/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-20439/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.YetusPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12992396 - PreCommit-HIVE-Build

> QueryCache: Queries using views can have them cached after CTE expansion
> 
>
> Key: HIVE-22816
> URL: https://issues.apache.org/jira/browse/HIVE-22816
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Reporter: Gopal Vijayaraghavan
>Assignee: Gopal Vijayaraghavan
>Priority: Major
> Attachments: HIVE-22816.1.patch
>
>
> {code}
> create view ss_null as select * from store_Sales where ss_Sold_date_sk is 
> null;
> select count(ss_ticket_number) from ss_null;
> with ss_null_cte as 
> (select * from store_Sales where ss_Sold_date_sk is null)
> select count(ss_ticket_number) from ss_null_cte;
> {code}
> Are treated differently by the query cache, however their execution is 
> identical.
> CBO rewrites the view query into AST form as follows
> {code}
> SELECT COUNT(`ss_ticket_number`) AS `$f0`
> FROM `tpcds_bin_partitioned_acid_orc_1`.`store_sales`
> WHERE `ss_sold_date_sk` IS NULL
> {code}
> But retains the write-entity for the VIRTUAL_VIEW for Ranger authorization 
> {code}
> 0: jdbc:hive2://localhost:10013> explain dependency select count(distinct 
> ss_ticket_number) from ss_null;
> ++
> |  Explain   |
> ++
> | 
> {"input_tables":[{"tablename":"tpcds_bin_partitioned_acid_orc_1@ss_null","tabletype":"VIRTUAL_VIEW"},{"tablename":"tpcds_bin_partitioned_acid_orc_1@store_sales","tabletype":"MANAGED_TABLE","tableParents":"[tpcds_bin_partitioned_acid_orc_1@ss_null]"}],"input_partitions":[{"partitionName":"tpcds_bin_partitioned_acid_orc_1@store_sales@ss_sold_date_sk=__HIVE_DEFAULT_PARTITION__"}]}
>  |
> ++
> {code}
> Causing Query cache to print out
> {code}
> parse.CalcitePlanner: Not eligible for results caching - query contains 
> non-transactional tables [ss_null]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (HIVE-22816) QueryCache: Queries using views can have them cached after CTE expansion

2020-02-01 Thread Hive QA (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-22816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17028008#comment-17028008
 ] 

Hive QA commented on HIVE-22816:


| (/) *{color:green}+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 
44s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m 
10s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
45s{color} | {color:green} master passed {color} |
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  4m 
19s{color} | {color:blue} ql in master has 1537 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 
37s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m 
14s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  1m 
14s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
48s{color} | {color:green} the patch passed {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 
32s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  1m  
3s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
14s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black} 26m 55s{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.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux |
| Build tool | maven |
| Personality | 
/data/hiveptest/working/yetus_PreCommit-HIVE-Build-20439/dev-support/hive-personality.sh
 |
| git revision | master / d4248dc |
| Default Java | 1.8.0_111 |
| findbugs | v3.0.1 |
| modules | C: ql U: ql |
| Console output | 
http://104.198.109.242/logs//PreCommit-HIVE-Build-20439/yetus.txt |
| Powered by | Apache Yetushttp://yetus.apache.org |


This message was automatically generated.



> QueryCache: Queries using views can have them cached after CTE expansion
> 
>
> Key: HIVE-22816
> URL: https://issues.apache.org/jira/browse/HIVE-22816
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Reporter: Gopal Vijayaraghavan
>Assignee: Gopal Vijayaraghavan
>Priority: Major
> Attachments: HIVE-22816.1.patch
>
>
> {code}
> create view ss_null as select * from store_Sales where ss_Sold_date_sk is 
> null;
> select count(ss_ticket_number) from ss_null;
> with ss_null_cte as 
> (select * from store_Sales where ss_Sold_date_sk is null)
> select count(ss_ticket_number) from ss_null_cte;
> {code}
> Are treated differently by the query cache, however their execution is 
> identical.
> CBO rewrites the view query into AST form as follows
> {code}
> SELECT COUNT(`ss_ticket_number`) AS `$f0`
> FROM `tpcds_bin_partitioned_acid_orc_1`.`store_sales`
> WHERE `ss_sold_date_sk` IS NULL
> {code}
> But retains the write-entity for the VIRTUAL_VIEW for Ranger authorization 
> {code}
> 0: jdbc:hive2://localhost:10013> explain dependency select count(distinct 
> ss_ticket_number) from ss_null;
> ++
> |  Explain   |
> ++
> | 
>