Github user xubo245 commented on the issue:
https://github.com/apache/carbondata/pull/2181 @chenliang613 rebase this PR, and CI pass, please review it. --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2181 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5159/ --- |
In reply to this post by qiuchenjian-2
Github user chenliang613 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2181#discussion_r192337901 --- Diff: examples/spark2/src/main/scala/org/apache/carbondata/examples/DirectSQLExample.scala --- @@ -0,0 +1,100 @@ +/* + * 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.examples + +import java.io.File + +import org.apache.commons.io.FileUtils + +import org.apache.carbondata.core.metadata.datatype.DataTypes +import org.apache.carbondata.examples.util.ExampleUtils +import org.apache.carbondata.sdk.file.{CarbonWriter, Field, Schema} + +/** + * Running SQL on carbon files directly + * No need to create table first + * TODO: support more than one carbon file + */ +object DirectSQLExample { + + // prepare SDK writer output + def buildTestData( + path: String, + num: Int = 3, + persistSchema: Boolean = false): Any = { + + // getCanonicalPath gives path with \, so code expects /. Need to handle in code ? --- End diff -- please optimize the comment. --- |
In reply to this post by qiuchenjian-2
Github user chenliang613 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2181#discussion_r192340086 --- Diff: integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateTableUsingSparkCarbonFileFormat.scala --- @@ -153,6 +153,34 @@ class TestCreateTableUsingSparkCarbonFileFormat extends QueryTest with BeforeAnd cleanTestData() } + test("Running SQL directly and read carbondata files (sdk Writer Output) using the SparkCarbonFileFormat ") { + buildTestData(false) + assert(new File(filePath).exists()) + sql("DROP TABLE IF EXISTS sdkOutputTable") + + //data source file format + if (sqlContext.sparkContext.version.startsWith("2.1")) { + //data source file format + sql(s"""CREATE TABLE sdkOutputTable USING carbonfile OPTIONS (PATH '$filePath') """) --- End diff -- if this is a key work, should use 'carbonfile' --- |
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2181#discussion_r192343540 --- Diff: examples/spark2/src/main/scala/org/apache/carbondata/examples/DirectSQLExample.scala --- @@ -0,0 +1,100 @@ +/* + * 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.examples + +import java.io.File + +import org.apache.commons.io.FileUtils + +import org.apache.carbondata.core.metadata.datatype.DataTypes +import org.apache.carbondata.examples.util.ExampleUtils +import org.apache.carbondata.sdk.file.{CarbonWriter, Field, Schema} + +/** + * Running SQL on carbon files directly + * No need to create table first + * TODO: support more than one carbon file + */ +object DirectSQLExample { + + // prepare SDK writer output + def buildTestData( + path: String, + num: Int = 3, + persistSchema: Boolean = false): Any = { + + // getCanonicalPath gives path with \, so code expects /. Need to handle in code ? --- End diff -- ok, done. and optimize all place in the project --- |
In reply to this post by qiuchenjian-2
Github user chenliang613 commented on the issue:
https://github.com/apache/carbondata/pull/2181 LGTM --- |
In reply to this post by qiuchenjian-2
|
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2181 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/6229/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2181 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/5067/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2181 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5201/ --- |
Free forum by Nabble | Edit this page |