carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject carbondata git commit: [CARBONDATA-1836][Spark-2.2] Carbon Spark2.2 Integration Resolve CatalogRelation
Date Thu, 07 Dec 2017 15:32:08 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 78f8aae53 -> 6dcf4eb95


[CARBONDATA-1836][Spark-2.2] Carbon Spark2.2 Integration Resolve CatalogRelation

Code change in order to support change in CatalogRelation case class name change to HiveTableRelation

This closes #1589


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/6dcf4eb9
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/6dcf4eb9
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/6dcf4eb9

Branch: refs/heads/master
Commit: 6dcf4eb95e1560df12ece21a0a3813d073148b6b
Parents: 78f8aae
Author: sounakr <sounakr@gmail.com>
Authored: Wed Nov 29 16:41:39 2017 +0530
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Thu Dec 7 21:01:50 2017 +0530

----------------------------------------------------------------------
 .../org/apache/spark/sql/hive/CarbonFileMetastore.scala | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/6dcf4eb9/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
b/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
index 82a9302..abc58ff 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
@@ -146,10 +146,14 @@ class CarbonFileMetastore extends CarbonMetaStore {
       case LogicalRelation(
       carbonDatasourceHadoopRelation: CarbonDatasourceHadoopRelation, _, _) =>
         carbonDatasourceHadoopRelation.carbonRelation
-      case SubqueryAlias(_, c: CatalogRelation) if SPARK_VERSION.startsWith("2.2") =>
-        val catalogTable = CarbonReflectionUtils.getFieldOfCatalogTable(
-          "tableMeta",
-          c).asInstanceOf[CatalogTable]
+      case SubqueryAlias(_, c)
+        if SPARK_VERSION.startsWith("2.2") &&
+           (c.getClass.getName.equals("org.apache.spark.sql.catalyst.catalog.CatalogRelation")
||
+            c.getClass.getName.equals("org.apache.spark.sql.catalyst.catalog.HiveTableRelation")
||
+            c.getClass.getName.equals(
+              "org.apache.spark.sql.catalyst.catalog.UnresolvedCatalogRelation")) =>
+        val catalogTable =
+          CarbonReflectionUtils.getFieldOfCatalogTable("tableMeta", c).asInstanceOf[CatalogTable]
         catalogTable.provider match {
           case Some(name) if name.equals("org.apache.spark.sql.CarbonSource") => name
           case _ => throw new NoSuchTableException(database, tableIdentifier.table)


Mime
View raw message