You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/11/30 20:40:14 UTC
[GitHub] [carbondata] akkio-97 opened a new pull request #4031: Presto UT optimization
akkio-97 opened a new pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031
### Why is this PR needed?
### What changes were proposed in this PR?
### Does this PR introduce any user interface change?
- No
- Yes. (please explain the change and update document)
### Is any new testcase added?
- No
- Yes
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-752366682
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3502/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] akkio-97 commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
akkio-97 commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r550019982
##########
File path: integration/presto/src/main/java/org/apache/carbondata/presto/PrestoCarbonVectorizedRecordReader.java
##########
@@ -223,8 +223,6 @@ private void initBatch() {
for (int i = 0; i < fields.length; i++) {
if (queryModel.isDirectVectorFill()) {
vectors[i] = new ColumnarVectorWrapperDirect(columnarBatch.column(i));
- } else {
- vectors[i] = new CarbonColumnVectorWrapper(columnarBatch.column(i), filteredRows);
Review comment:
done
##########
File path: integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/SparkStoreCreatorForPresto.scala
##########
@@ -0,0 +1,385 @@
+/*
+ * 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.integration.spark.testsuite.dataload
+
+import java.io.{File, PrintWriter}
+import java.util.UUID
+
+import scala.util.Random
+
+import org.apache.commons.io.FileUtils
+import org.apache.spark.sql.CarbonEnv
+import org.apache.spark.sql.test.util.QueryTest
+import org.scalatest.BeforeAndAfterAll
+
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.core.util.path.CarbonTablePath
+import org.apache.carbondata.sdk.file.{CarbonSchemaReader, CarbonWriterBuilder}
+
+class SparkStoreCreatorForPresto extends QueryTest with BeforeAndAfterAll{
+
+ private val timestampFormat = CarbonProperties.getInstance()
+ .getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT)
+ private val dateFormat = CarbonProperties.getInstance()
+ .getProperty(CarbonCommonConstants.CARBON_DATE_FORMAT)
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+
+ val storePath = storeLocation
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT,
+ CarbonCommonConstants.CARBON_DATE_DEFAULT_FORMAT)
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT,
+ CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)
+ sql("drop database if exists presto_spark_db cascade")
+ sql("create database presto_spark_db")
+ sql("use presto_spark_db")
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ override def afterAll: Unit = {
+ if (null != dateFormat) {
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, dateFormat)
+ }
+ if(null != timestampFormat) {
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, timestampFormat)
+ }
+ val source = s"$rootPath/integration/spark/target/warehouse/presto_spark_db.db/"
+ val srcDir = new File(source)
+
+ // Presto will later use this store path to query
+ val destination = s"$rootPath/integration/spark/target/spark_store/"
+ val destDir = new File(destination)
+ FileUtils.copyDirectory(srcDir, destDir)
+ FileUtils.deleteDirectory(srcDir)
+ sql("drop table update_table")
Review comment:
done
##########
File path: integration/presto/src/main/prestosql/org/apache/carbondata/presto/CarbondataColumnConstraint.java
##########
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r542201944
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
Review comment:
throw exception here
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] akkio-97 commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
akkio-97 commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r549218756
##########
File path: integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/SparkStoreCreatorForPresto.scala
##########
@@ -0,0 +1,371 @@
+/*
+ * 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.integration.spark.testsuite.complexType
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-739243845
Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3322/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] akkio-97 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
akkio-97 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-751579925
> @akkio-97 : Once all the comments are handled, please do let me know
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-739285954
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3323/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r542203408
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
Review comment:
no need to print trace
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] akkio-97 commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
akkio-97 commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r549218920
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
+ }
+ }
+
+ test("Test update operations without local dictionary") {
+ prestoServer.execute("drop table if exists presto_spark_db.update_table")
+ prestoServer.execute("drop table if exists presto_spark_db.actual_update_table")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.update_table(smallintColumn smallint, intColumn int, " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.actual_update_table(smallintColumn smallint, intColumn int," +
+ " " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ copyStoreContents("update_table")
+ copyStoreContents("actual_update_table")
+ assert(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.update_table").equals(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.actual_update_table")))
Review comment:
Dropped all tables in afterAll()
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-736384991
Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3231/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r546650527
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
+ }
+ }
+
+ test("Test update operations without local dictionary") {
+ prestoServer.execute("drop table if exists presto_spark_db.update_table")
+ prestoServer.execute("drop table if exists presto_spark_db.actual_update_table")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.update_table(smallintColumn smallint, intColumn int, " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.actual_update_table(smallintColumn smallint, intColumn int," +
+ " " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ copyStoreContents("update_table")
+ copyStoreContents("actual_update_table")
+ assert(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.update_table").equals(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.actual_update_table")))
Review comment:
I mean for spark testcase, you are not calling drop table at all, so it will never be dropped. so, if you copy one by one. you can call drop table also in spark testcase
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-737138681
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5019/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r549712350
##########
File path: integration/presto/src/main/java/org/apache/carbondata/presto/PrestoCarbonVectorizedRecordReader.java
##########
@@ -223,8 +223,6 @@ private void initBatch() {
for (int i = 0; i < fields.length; i++) {
if (queryModel.isDirectVectorFill()) {
vectors[i] = new ColumnarVectorWrapperDirect(columnarBatch.column(i));
- } else {
- vectors[i] = new CarbonColumnVectorWrapper(columnarBatch.column(i), filteredRows);
Review comment:
you can remove if check also I guess, directly prepare ColumnarVectorWrapperDirect and also add a comment with TODO that if presto implements row level filtering, need to prepare CarbonColumnVectorWrapper instead of ColumnarVectorWrapperDirect
##########
File path: integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/SparkStoreCreatorForPresto.scala
##########
@@ -0,0 +1,385 @@
+/*
+ * 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.integration.spark.testsuite.dataload
+
+import java.io.{File, PrintWriter}
+import java.util.UUID
+
+import scala.util.Random
+
+import org.apache.commons.io.FileUtils
+import org.apache.spark.sql.CarbonEnv
+import org.apache.spark.sql.test.util.QueryTest
+import org.scalatest.BeforeAndAfterAll
+
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.core.util.path.CarbonTablePath
+import org.apache.carbondata.sdk.file.{CarbonSchemaReader, CarbonWriterBuilder}
+
+class SparkStoreCreatorForPresto extends QueryTest with BeforeAndAfterAll{
+
+ private val timestampFormat = CarbonProperties.getInstance()
+ .getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT)
+ private val dateFormat = CarbonProperties.getInstance()
+ .getProperty(CarbonCommonConstants.CARBON_DATE_FORMAT)
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+
+ val storePath = storeLocation
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT,
+ CarbonCommonConstants.CARBON_DATE_DEFAULT_FORMAT)
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT,
+ CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)
+ sql("drop database if exists presto_spark_db cascade")
+ sql("create database presto_spark_db")
+ sql("use presto_spark_db")
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ override def afterAll: Unit = {
+ if (null != dateFormat) {
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, dateFormat)
+ }
+ if(null != timestampFormat) {
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, timestampFormat)
+ }
+ val source = s"$rootPath/integration/spark/target/warehouse/presto_spark_db.db/"
+ val srcDir = new File(source)
+
+ // Presto will later use this store path to query
+ val destination = s"$rootPath/integration/spark/target/spark_store/"
+ val destDir = new File(destination)
+ FileUtils.copyDirectory(srcDir, destDir)
+ FileUtils.deleteDirectory(srcDir)
+ sql("drop table update_table")
Review comment:
please make it drop table if exist, so that devloper can run individual testcase
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-752196388
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5262/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-739480248
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3296/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-738862770
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5074/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-738823845
Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3316/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-736092041
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/4980/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-751987371
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5256/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r542199179
##########
File path: integration/spark/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/SparkStoreCreatorForPresto.scala
##########
@@ -0,0 +1,371 @@
+/*
+ * 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.integration.spark.testsuite.complexType
Review comment:
Don't keep it in complexType package, if required in the same oath create a new one
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] akkio-97 commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
akkio-97 commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r544930259
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
+ }
+ }
+
+ test("Test update operations without local dictionary") {
+ prestoServer.execute("drop table if exists presto_spark_db.update_table")
+ prestoServer.execute("drop table if exists presto_spark_db.actual_update_table")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.update_table(smallintColumn smallint, intColumn int, " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.actual_update_table(smallintColumn smallint, intColumn int," +
+ " " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ copyStoreContents("update_table")
+ copyStoreContents("actual_update_table")
+ assert(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.update_table").equals(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.actual_update_table")))
Review comment:
you are suggesting to drop immediately after copying not just for this but remaining other test cases too? Right now it is deleting in the afterAll() method
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-748003899
Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3302/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-736384519
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/4986/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-736094188
Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3225/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-750823358
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3483/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-736696049
Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3242/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-752514117
LGTM.
merged.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] akkio-97 commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
akkio-97 commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r544930259
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
+ }
+ }
+
+ test("Test update operations without local dictionary") {
+ prestoServer.execute("drop table if exists presto_spark_db.update_table")
+ prestoServer.execute("drop table if exists presto_spark_db.actual_update_table")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.update_table(smallintColumn smallint, intColumn int, " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.actual_update_table(smallintColumn smallint, intColumn int," +
+ " " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ copyStoreContents("update_table")
+ copyStoreContents("actual_update_table")
+ assert(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.update_table").equals(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.actual_update_table")))
Review comment:
you are suggesting to drop immediately after copying not just for this but remaining other test cases too?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-748921945
@akkio-97 : Once all the comments are handled, please do let me know
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r542205758
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
+ }
+ }
+
+ test("Test update operations without local dictionary") {
+ prestoServer.execute("drop table if exists presto_spark_db.update_table")
+ prestoServer.execute("drop table if exists presto_spark_db.actual_update_table")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.update_table(smallintColumn smallint, intColumn int, " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ prestoServer
+ .execute(
+ "create table presto_spark_db.actual_update_table(smallintColumn smallint, intColumn int," +
+ " " +
+ "bigintColumn bigint, doubleColumn double, decimalColumn decimal(10,3), " +
+ "timestampColumn timestamp, dateColumn date, " +
+ "stringColumn varchar, booleanColumn boolean ) with(format='CARBON') ")
+ copyStoreContents("update_table")
+ copyStoreContents("actual_update_table")
+ assert(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.update_table").equals(prestoServer
+ .executeQuery("SELECT * FROM presto_spark_db.actual_update_table")))
Review comment:
I think each test case can copy its content. After copy you can call drop table itself.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-752196905
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3501/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] asfgit closed pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] akkio-97 commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
akkio-97 commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r549218802
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
+ }
+ catch {
+ case e: IOException =>
+ e.printStackTrace()
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-739279764
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5080/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-751630368
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5246/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-739243231
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5079/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r549922272
##########
File path: integration/presto/src/main/prestosql/org/apache/carbondata/presto/CarbondataColumnConstraint.java
##########
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
Review comment:
only this I think, `getPartitionFilters` is needed for prestodb as it doesn't have partition pruning.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-751629853
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3485/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-750823272
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5244/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-751989266
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3495/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-736695799
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/4997/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-752365468
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5263/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4031: Presto UT optimization
Posted by GitBox <gi...@apache.org>.
CarbonDataQA2 commented on pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#issuecomment-737140156
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3263/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r549921992
##########
File path: integration/presto/src/main/prestosql/org/apache/carbondata/presto/CarbondataColumnConstraint.java
##########
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
Review comment:
please check and handle for prestodb also
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4031: [CARBONDATA-4073] Added FT for missing scenarios in Presto
Posted by GitBox <gi...@apache.org>.
ajantha-bhat commented on a change in pull request #4031:
URL: https://github.com/apache/carbondata/pull/4031#discussion_r542203236
##########
File path: integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoTestUsingSparkStore.scala
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.presto.integrationtest
+
+import java.io.{File}
+import java.util
+
+import org.apache.commons.io.FileUtils
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, FunSuiteLike}
+
+import org.apache.carbondata.common.logging.LogServiceFactory
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.datastore.impl.FileFactory
+import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
+import org.apache.carbondata.presto.server.{PrestoServer}
+
+class PrestoTestUsingSparkStore
+ extends FunSuiteLike with BeforeAndAfterAll with BeforeAndAfterEach {
+
+ private val logger = LogServiceFactory
+ .getLogService(classOf[PrestoTestNonTransactionalTableFiles].getCanonicalName)
+
+ private val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ private val storePath = s"$rootPath/integration/presto/target/store"
+ private val writerPath = storePath + "/presto_spark_db/files"
+ private val sparkStorePath = s"$rootPath/integration/spark/target/spark_store"
+ private val prestoServer = new PrestoServer
+
+ override def beforeAll: Unit = {
+ CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_WRITTEN_BY_APPNAME,
+ "Presto")
+ val map = new util.HashMap[String, String]()
+ map.put("hive.metastore", "file")
+ map.put("hive.metastore.catalog.dir", s"file://$storePath")
+ prestoServer.startServer("presto_spark_db", map)
+ prestoServer.execute("drop schema if exists presto_spark_db")
+ prestoServer.execute("create schema presto_spark_db")
+ }
+
+ override def afterAll(): Unit = {
+ prestoServer.stopServer()
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile(storePath))
+ CarbonUtil.deleteFoldersAndFiles(FileFactory.getCarbonFile
+ (s"$sparkStorePath"))
+ }
+
+ def copyStoreContents(tableName: String): Any = {
+ FileUtils.deleteDirectory(new File(writerPath))
+ import java.io.IOException
+ val source = s"$sparkStorePath/$tableName/"
+ val srcDir = new File(source)
+
+ val destination = s"$storePath/presto_spark_db" +
+ s"/$tableName/"
+ val destDir = new File(destination)
+ try {
+ // Move spark store to presto store path
+ FileUtils.copyDirectory(srcDir, destDir)
Review comment:
when will the source (in spark suite folder) be deleted ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org