You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ja...@apache.org on 2017/03/09 15:00:54 UTC

[1/2] incubator-carbondata git commit: Support the syntax of 'STORED BY PARQUET/ORC'.

Repository: incubator-carbondata
Updated Branches:
  refs/heads/master f4f852e78 -> 847ec3819


Support the syntax of 'STORED BY PARQUET/ORC'.

Fix scalastyle.

Add testcase.


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

Branch: refs/heads/master
Commit: 121ac1315374923a3faa1e7bb02635337a225361
Parents: f4f852e
Author: Yadong Qi <qi...@gmail.com>
Authored: Wed Mar 1 15:26:15 2017 +0800
Committer: jackylk <ja...@huawei.com>
Committed: Thu Mar 9 22:59:50 2017 +0800

----------------------------------------------------------------------
 .../spark/sql/parser/CarbonSparkSqlParser.scala |  8 ++++-
 .../org/apache/spark/SparkCommandSuite.scala    | 38 ++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/121ac131/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
index 2273689..9c5e6b9 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
@@ -63,7 +63,13 @@ class CarbonSqlAstBuilder(conf: SQLConf) extends SparkSqlAstBuilder(conf) {
 
   override def visitCreateTable(ctx: CreateTableContext): LogicalPlan = {
     val fileStorage = Option(ctx.createFileFormat) match {
-      case Some(value) => value.storageHandler().STRING().getSymbol.getText
+      case Some(value) =>
+        if (value.children.get(1).getText.equalsIgnoreCase("by")) {
+          value.storageHandler().STRING().getSymbol.getText
+        } else {
+          // The case of "STORED AS PARQUET/ORC"
+          ""
+        }
       case _ => ""
     }
     if (fileStorage.equalsIgnoreCase("'carbondata'") ||

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/121ac131/integration/spark2/src/test/scala/org/apache/spark/SparkCommandSuite.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/test/scala/org/apache/spark/SparkCommandSuite.scala b/integration/spark2/src/test/scala/org/apache/spark/SparkCommandSuite.scala
new file mode 100644
index 0000000..13a04c5
--- /dev/null
+++ b/integration/spark2/src/test/scala/org/apache/spark/SparkCommandSuite.scala
@@ -0,0 +1,38 @@
+/*
+ * 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.spark
+
+import org.apache.spark.sql.common.util.QueryTest
+import org.scalatest.BeforeAndAfterAll
+
+class SparkCommandSuite extends QueryTest with BeforeAndAfterAll {
+  override def beforeAll(): Unit = {
+    sql("DROP TABLE IF EXISTS src_pqt")
+    sql("DROP TABLE IF EXISTS src_orc")
+  }
+
+  override def afterAll(): Unit = {
+    sql("DROP TABLE IF EXISTS src_pqt")
+    sql("DROP TABLE IF EXISTS src_orc")
+  }
+
+  test("CARBONDATA-734: Support the syntax of 'STORED BY PARQUET/ORC'") {
+    sql("CREATE TABLE src_pqt(key INT, value STRING) STORED AS PARQUET")
+    sql("CREATE TABLE src_orc(key INT, value STRING) STORED AS ORC")
+  }
+}


[2/2] incubator-carbondata git commit: [CARBONDATA-734] Support the syntax of 'STORED BY PARQUET/ORC' in CarbonSession This closes #618

Posted by ja...@apache.org.
[CARBONDATA-734] Support the syntax of 'STORED BY PARQUET/ORC' in CarbonSession This closes #618


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

Branch: refs/heads/master
Commit: 847ec38199522c685d5a2b2de5a11268cdc3faf6
Parents: f4f852e 121ac13
Author: jackylk <ja...@huawei.com>
Authored: Thu Mar 9 23:00:35 2017 +0800
Committer: jackylk <ja...@huawei.com>
Committed: Thu Mar 9 23:00:35 2017 +0800

----------------------------------------------------------------------
 .../spark/sql/parser/CarbonSparkSqlParser.scala |  8 ++++-
 .../org/apache/spark/SparkCommandSuite.scala    | 38 ++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------