[ 
https://issues.apache.org/jira/browse/HIVE-26924?focusedWorklogId=838538&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-838538
 ]

ASF GitHub Bot logged work on HIVE-26924:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Jan/23 08:18
            Start Date: 11/Jan/23 08:18
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request, #3936:
URL: https://github.com/apache/hive/pull/3936

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: 
https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a 
faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   Check whether non-native source tables of a materialized view supports 
snapshots when enabling the mv for automatic query rewrites.
   
   ### Why are the changes needed?
   Allow such mvs to be used in automatic query rewrites.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. Enabling for rewrite is successful.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -Dtest=TestIcebergCliDriver 
-Dqfile=mv_iceberg_orc.q -pl itests/qtest-iceberg -Piceberg -Pitests -Drat.skip
   ```
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 838538)
    Remaining Estimate: 0h
            Time Spent: 10m

> Alter materialized view enable rewrite throws SemanticException for source 
> iceberg table
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-26924
>                 URL: https://issues.apache.org/jira/browse/HIVE-26924
>             Project: Hive
>          Issue Type: Bug
>          Components: Iceberg integration
>            Reporter: Dharmik Thakkar
>            Assignee: Krisztian Kasa
>            Priority: Critical
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> alter materialized view enable rewrite throws SemanticException for source 
> iceberg table
> SQL test
> {code:java}
> >>> create materialized view mv_rewrite as select t, si from all100k where 
> >>> t>115;
> >>> analyze table mv_rewrite compute statistics for columns;
> >>> set hive.explain.user=false;
> >>> explain select si,t from all100k where t>116 and t<120;
> !!! match row_contains
>           alias: iceberg_test_db_hive.mv_rewrite
> >>> alter materialized view mv_rewrite disable rewrite;
> >>> explain select si,t from all100k where t>116 and t<120;
> !!! match row_contains
>           alias: all100k
> >>> alter materialized view mv_rewrite enable rewrite;
> >>> explain select si,t from all100k where t>116 and t<120;
> !!! match row_contains
>           alias: iceberg_test_db_hive.mv_rewrite
> >>> drop materialized view mv_rewrite; {code}
>  
> Error
> {code:java}
> 2023-01-10T18:40:34,303 INFO  [pool-3-thread-1] jdbc.TestDriver: Query: alter 
> materialized view mv_rewrite enable rewrite
> 2023-01-10T18:40:34,365 INFO  [Thread-10] jdbc.TestDriver: INFO  : Compiling 
> command(queryId=hive_20230110184034_f557b4a6-40a0-42ba-8e67-2f273f50af36): 
> alter materialized view mv_rewrite enable rewrite
> 2023-01-10T18:40:34,426 INFO  [Thread-10] jdbc.TestDriver: ERROR : FAILED: 
> SemanticException Automatic rewriting for materialized view cannot be enabled 
> if the materialized view uses non-transactional tables
> 2023-01-10T18:40:34,426 INFO  [Thread-10] jdbc.TestDriver: 
> org.apache.hadoop.hive.ql.parse.SemanticException: Automatic rewriting for 
> materialized view cannot be enabled if the materialized view uses 
> non-transactional tables
> 2023-01-10T18:40:34,426 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.ddl.view.materialized.alter.rewrite.AlterMaterializedViewRewriteAnalyzer.analyzeInternal(AlterMaterializedViewRewriteAnalyzer.java:75)
> 2023-01-10T18:40:34,426 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:313)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:222)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:105)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.Driver.compile(Driver.java:201)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:657)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:603)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:597)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:127)
> 2023-01-10T18:40:34,427 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:206)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:336)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.security.AccessController.doPrivileged(Native Method)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/javax.security.auth.Subject.doAs(Subject.java:423)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:358)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> 2023-01-10T18:40:34,428 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 2023-01-10T18:40:34,429 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 2023-01-10T18:40:34,429 INFO  [Thread-10] jdbc.TestDriver:      at 
> java.base/java.lang.Thread.run(Thread.java:829)
> 2023-01-10T18:40:34,429 INFO  [Thread-10] jdbc.TestDriver:
> 2023-01-10T18:40:34,429 INFO  [Thread-10] jdbc.TestDriver: INFO  : Completed 
> compiling 
> command(queryId=hive_20230110184034_f557b4a6-40a0-42ba-8e67-2f273f50af36); 
> Time taken: 0.03 seconds
> 2023-01-10T18:40:34,520 ERROR [pool-3-thread-1] jdbc.TestDriver: Error while 
> compiling statement: FAILED: SemanticException Automatic rewriting for 
> materialized view cannot be enabled if the materialized view uses 
> non-transactional tables {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to