[GitHub] [carbondata] ravipesala commented on a change in pull request #3184: [CARBONDATA-3357] Support TableProperties from single parent table and restrict alter/delete/partition on mv

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] ravipesala commented on a change in pull request #3184: [CARBONDATA-3357] Support TableProperties from single parent table and restrict alter/delete/partition on mv

GitBox
ravipesala commented on a change in pull request #3184: [CARBONDATA-3357] Support TableProperties from single parent table and restrict alter/delete/partition on mv
URL: https://github.com/apache/carbondata/pull/3184#discussion_r279301188
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVUtil.scala
 ##########
 @@ -0,0 +1,615 @@
+/*
+ * 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.carbondata.mv.datamap
+
+import scala.collection.mutable
+import scala.collection.mutable.ArrayBuffer
+
+import org.apache.spark.sql.{CarbonDatasourceHadoopRelation, SparkSession}
+import org.apache.spark.sql.catalyst.expressions._
+import org.apache.spark.sql.catalyst.expressions.aggregate._
+import org.apache.spark.sql.catalyst.plans.logical._
+import org.apache.spark.sql.execution.command.{ColumnTableRelation, DataMapField, Field}
+import org.apache.spark.sql.execution.datasources.LogicalRelation
+import org.apache.spark.sql.types.DataType
+
+import org.apache.carbondata.core.metadata.schema.table.CarbonTable
+import org.apache.carbondata.mv.plans.util.ExtractSelectModule
+import org.apache.carbondata.spark.util.CommonUtil
+
+/**
+ * Utility class for keeping all the utility method for mv datamap
+ */
+object MVUtil {
+
+  /**
+   * Below method will be used to validate and get the required fields from select plan
+   */
+  def getFieldsAndDataMapFieldsFromPlan(plan: LogicalPlan,
+      selectStmt: String,
+      sparkSession: SparkSession): scala.collection.mutable.LinkedHashMap[Field, DataMapField] = {
+    plan match {
 
 Review comment:
   I am confused about why so much code is added for each plan. I think it should be handled generic enough for most of the plans

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services