[ https://issues.apache.org/jira/browse/HIVE-26924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17678226#comment-17678226 ]
Stamatis Zampetakis commented on HIVE-26924: -------------------------------------------- >From the description of the ticket it is not clear what happens after the >SemanticException is raised. Will the queries following the exception be able >to exploit the view or not? Naturally I would think no but I am not sure how >to interpret the following: {noformat} >>> 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 {noformat} Can you please clarify [~dharmikt] [~kkasa]? > 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 > Labels: pull-request-available > Time Spent: 50m > 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)