carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [1/2] incubator-carbondata git commit: Fix the bug that table not exist exception occured when using sparksql and beeline the same time
Date Sat, 27 Aug 2016 03:06:27 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master dfa768a6f -> 8e932cba1


Fix the bug that table not exist exception occured when using sparksql and beeline the same
time


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

Branch: refs/heads/master
Commit: 27705c17838e3a1a426aee185bcf21db250315f5
Parents: dfa768a
Author: Zhangshunyu <zhangshunyu@huawei.com>
Authored: Thu Aug 25 11:40:35 2016 +0800
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Sat Aug 27 08:34:17 2016 +0530

----------------------------------------------------------------------
 .../spark/sql/execution/command/carbonTableSchema.scala       | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/27705c17/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
index 2c76126..ca95512 100644
--- a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
+++ b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
@@ -1341,6 +1341,13 @@ private[sql] case class ShowLoads(
   override def run(sqlContext: SQLContext): Seq[Row] = {
     val databaseName = getDB.getDatabaseName(databaseNameOp, sqlContext)
     val tableUniqueName = databaseName + "_" + tableName
+    // Here using checkSchemasModifiedTimeAndReloadTables in tableExists to reload metadata
if
+    // schema is changed by other process, so that tableInfoMap woulb be refilled.
+    val tableExists = CarbonEnv.getInstance(sqlContext).carbonCatalog
+      .tableExists(TableIdentifier(tableName, databaseNameOp))(sqlContext)
+    if (!tableExists) {
+      sys.error(s"$databaseName.$tableName is not found")
+    }
     val carbonTable = org.apache.carbondata.core.carbon.metadata.CarbonMetadata.getInstance()
       .getCarbonTable(tableUniqueName)
     if (carbonTable == null) {


Mime
View raw message