PHILO-HE commented on code in PR #10186: URL: https://github.com/apache/incubator-gluten/pull/10186#discussion_r2280312752
########## gluten-paimon/src-paimon/test/scala/org/apache/gluten/execution/PaimonSuite.scala: ########## @@ -0,0 +1,97 @@ +/* + * 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.gluten.execution + +import org.apache.spark.SparkConf + +abstract class PaimonSuite extends WholeStageTransformerSuite { + protected val rootPath: String = getClass.getResource("/").getPath + override protected val resourcePath: String = "/tpch-data-parquet" + override protected val fileFormat: String = "parquet" + + override protected def sparkConf: SparkConf = { + super.sparkConf + .set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager") + .set("spark.sql.files.maxPartitionBytes", "1g") + .set("spark.sql.shuffle.partitions", "1") + .set("spark.memory.offHeap.size", "2g") + .set("spark.unsafe.exceptionOnMemoryLeak", "true") + .set("spark.sql.autoBroadcastJoinThreshold", "-1") + .set( + "spark.sql.extensions", + "org.apache.paimon.spark.extensions.PaimonSparkSessionExtensions") + .set("spark.sql.catalog.spark_catalog", "org.apache.paimon.spark.SparkCatalog") + .set("spark.sql.catalog.spark_catalog.warehouse", s"file://$rootPath/data-paimon") + } + + test("paimon transformer exists") { + Seq("parquet", "orc").foreach { + format => + withTable(s"paimon_${format}_tbl") { + sql(s"DROP TABLE IF EXISTS paimon_${format}_tbl") + sql( + s"CREATE TABLE paimon_${format}_tbl (id INT, name STRING) USING PAIMON " + + s"TBLPROPERTIES ('file.format'='$format')") + sql(s"INSERT INTO paimon_${format}_tbl VALUES (1, 'Bob'), (2, 'Blue'), (3, 'Mike')") + runQueryAndCompare(s""" + |SELECT * from paimon_${format}_tbl; Review Comment: Nit: use "FROM" for consistency. ########## pom.xml: ########## @@ -59,6 +59,7 @@ <module>package</module> <module>shims</module> <module>gluten-ras</module> + <module>gluten-paimon</module> Review Comment: Only include this module when profile paimon is used? Like `gluten-iceberg` module. I assume we should remove this. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
