You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ch...@apache.org on 2016/08/27 00:57:54 UTC
[1/2] incubator-carbondata git commit: describe
Repository: incubator-carbondata
Updated Branches:
refs/heads/master 5d1a177e7 -> dfa768a6f
describe
Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/2f3ac757
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/2f3ac757
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/2f3ac757
Branch: refs/heads/master
Commit: 2f3ac7576b2ef3a93d5f233351d8c5ab89139937
Parents: 5d1a177
Author: Jay357089 <li...@huawei.com>
Authored: Fri Aug 26 00:10:39 2016 +0800
Committer: chenliang613 <ch...@apache.org>
Committed: Sat Aug 27 08:56:47 2016 +0800
----------------------------------------------------------------------
.../spark/sql/hive/CarbonMetastoreCatalog.scala | 2 +
.../describeTable/TestDescribeTable.scala | 49 ++++++++++++++++++++
2 files changed, 51 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/2f3ac757/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetastoreCatalog.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetastoreCatalog.scala b/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetastoreCatalog.scala
index 810bc09..f5e9618 100644
--- a/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetastoreCatalog.scala
+++ b/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonMetastoreCatalog.scala
@@ -445,6 +445,8 @@ class CarbonMetastoreCatalog(hiveContext: HiveContext, val storePath: String,
.removeTable(dbName + "_" + tableName)
sqlContext.asInstanceOf[HiveContext].runSqlHive(s"DROP TABLE IF EXISTS $dbName.$tableName")
+ // discard cached table info in cachedDataSourceTables
+ sqlContext.catalog.refreshTable(tableIdentifier)
}
private def getTimestampFileAndType(databaseName: String, tableName: String) = {
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/2f3ac757/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/describeTable/TestDescribeTable.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/describeTable/TestDescribeTable.scala b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/describeTable/TestDescribeTable.scala
new file mode 100644
index 0000000..1b27842
--- /dev/null
+++ b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/describeTable/TestDescribeTable.scala
@@ -0,0 +1,49 @@
+/*
+ * 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.spark.testsuite.describeTable
+
+import org.apache.spark.sql.common.util.CarbonHiveContext._
+import org.apache.spark.sql.common.util.QueryTest
+import org.scalatest.BeforeAndAfterAll
+
+/**
+ * test class for describe table .
+ */
+class TestDescribeTable extends QueryTest with BeforeAndAfterAll {
+
+ override def beforeAll: Unit = {
+ sql("DROP TABLE IF EXISTS Desc1")
+ sql("DROP TABLE IF EXISTS Desc2")
+ sql("CREATE TABLE Desc1(Dec1Col1 String, Dec1Col2 String, Dec1Col3 int, Dec1Col4 double) stored by 'carbondata'")
+ sql("DESC Desc1")
+ sql("DROP TABLE Desc1")
+ sql("CREATE TABLE Desc1(Dec2Col1 BigInt, Dec2Col2 String, Dec2Col3 Bigint, Dec2Col4 Decimal) stored by 'carbondata'")
+ sql("CREATE TABLE Desc2(Dec2Col1 BigInt, Dec2Col2 String, Dec2Col3 Bigint, Dec2Col4 Decimal) stored by 'carbondata'")
+ }
+
+ test("test describe table") {
+ checkAnswer(sql("DESC Desc1"), sql("DESC Desc2"))
+ }
+
+ override def afterAll: Unit = {
+ sql("DROP TABLE Desc1")
+ sql("DROP TABLE Desc2")
+ }
+
+}
[2/2] incubator-carbondata git commit: [CARBONDATA-179] Describe
table show old table schema This closes #96
Posted by ch...@apache.org.
[CARBONDATA-179] Describe table show old table schema This closes #96
Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/dfa768a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/dfa768a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/dfa768a6
Branch: refs/heads/master
Commit: dfa768a6fb92a1af1f707f5fb2995b303f7857cf
Parents: 5d1a177 2f3ac75
Author: chenliang613 <ch...@apache.org>
Authored: Sat Aug 27 08:57:40 2016 +0800
Committer: chenliang613 <ch...@apache.org>
Committed: Sat Aug 27 08:57:40 2016 +0800
----------------------------------------------------------------------
.../spark/sql/hive/CarbonMetastoreCatalog.scala | 2 +
.../describeTable/TestDescribeTable.scala | 49 ++++++++++++++++++++
2 files changed, 51 insertions(+)
----------------------------------------------------------------------