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

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

                Author: ASF GitHub Bot
            Created on: 23/Dec/20 21:08
            Start Date: 23/Dec/20 21:08
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on a change in pull request #1782:
URL: https://github.com/apache/hive/pull/1782#discussion_r548025308



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
##########
@@ -1831,7 +1832,8 @@ public RelOptMaterialization 
getMaterializedViewForRebuild(String dbName, String
 
   private List<RelOptMaterialization> getValidMaterializedViews(List<Table> 
materializedViewTables,
       List<String> tablesUsed, boolean forceMVContentsUpToDate, boolean 
expandGroupingSets,
-      HiveTxnManager txnMgr) throws HiveException {
+      HiveTxnManager txnMgr, 
EnumSet<org.apache.hadoop.hive.ql.metadata.Materialization.RewriteAlgorithm> 
scope)

Review comment:
       nit. Import to avoid using fully-qualified class name here?

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Materialization.java
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.metadata;
+
+import org.apache.calcite.plan.RelOptMaterialization;
+
+import java.util.EnumSet;
+
+import static org.apache.commons.collections.CollectionUtils.intersection;
+
+/**
+ * Wrapper class of {@link RelOptMaterialization} and corresponding flags.
+ */
+public class Materialization {

Review comment:
       Should this class extend `RelOptMaterialization` rather than wrapping 
it? I think it would make sense since we may extend it with other properties in 
the future and may be convenient to be accessible anywhere in Calcite code.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CBOPlan.java
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.parse;
+
+import org.apache.calcite.rel.RelNode;
+
+/**
+ * Wrapper of Calcite plan.
+ */
+public class CBOPlan {
+  private final RelNode plan;
+  private final String invalidAutomaticRewritingMaterializationReason;
+
+  public CBOPlan(RelNode plan, String 
invalidAutomaticRewritingMaterializationReason) {
+    this.plan = plan;
+    this.invalidAutomaticRewritingMaterializationReason = 
invalidAutomaticRewritingMaterializationReason;
+  }
+
+  /**
+   * Root node of plan.
+   * @return Root {@link RelNode}
+   */
+  public RelNode getPlan() {
+    return plan;
+  }
+
+  /**
+   * Returns an error message if this plan can not be a definition of a 
Materialized view which is an input of
+   * Calcite based materialized view query rewrite.
+   * null or empty string otherwise.

Review comment:
       nit. null -> Null




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 527846)
    Time Spent: 20m  (was: 10m)

> Filter out materialized views for rewriting if plan pattern is not allowed
> --------------------------------------------------------------------------
>
>                 Key: HIVE-24434
>                 URL: https://issues.apache.org/jira/browse/HIVE-24434
>             Project: Hive
>          Issue Type: Improvement
>          Components: Materialized views
>    Affects Versions: 4.0.0
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Some materialized views are not enabled for Calcite based rewriting. Rules 
> for validating materialized views are implemented by HIVE-20748. 
> Since text based materialized view query rewrite doesn't have such 
> limitations some logic must be implemented to flag materialized view whether 
> they are enabled to text based rewrite only or both.



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

Reply via email to