Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions gluten-ut/spark40/src/test/resources/hive-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you overwrite the path search code instead of copying the file from Spark

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.
-->

<configuration>
<property>
<name>hive.in.test</name>
<value>true</value>
<description>Internal marker for test.</description>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/tmp/hive_one</value>
<description>default is /tmp/hadoop-${user.name} and will be overridden </description>
</property>
<property>
<name>hadoop.this.is.a.test.key</name>
<value>2018-11-17 13:33:33.333</value>
</property>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenSQLJsonProtocolSuite]
enableSuite[GlutenShufflePartitionsUtilSuite]
enableSuite[GlutenSimpleSQLViewSuite]
// TODO: 4.x enableSuite[GlutenSparkPlanSuite] // 1 failure
enableSuite[GlutenSparkPlanSuite]
// Rewrite to check Gluten node
.exclude("SPARK-37779: ColumnarToRowExec should be canonicalizable after being (de)serialized")
enableSuite[GlutenSparkPlannerSuite]
enableSuite[GlutenSparkScriptTransformationSuite]
enableSuite[GlutenSparkSqlParserSuite]
Expand Down Expand Up @@ -769,7 +771,7 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenRuntimeConfigSuite]
enableSuite[GlutenSSBQuerySuite]
enableSuite[GlutenSessionStateSuite]
// TODO: 4.x enableSuite[GlutenSetCommandSuite] // 1 failure
enableSuite[GlutenSetCommandSuite]
// TODO: 4.x enableSuite[GlutenSingleLevelAggregateHashMapSuite] // 1 failure
enableSuite[GlutenSparkSessionBuilderSuite]
// TODO: 4.x enableSuite[GlutenSparkSessionJobTaggingAndCancellationSuite] // 1 failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@
*/
package org.apache.spark.sql.execution

import org.apache.gluten.execution.VeloxColumnarToRowExec

import org.apache.spark.sql.GlutenSQLTestsTrait
import org.apache.spark.sql.internal.SQLConf

class GlutenSparkPlanSuite extends SparkPlanSuite with GlutenSQLTestsTrait {

class GlutenSparkPlanSuite extends SparkPlanSuite with GlutenSQLTestsTrait {}
testGluten(
"SPARK-37779: ColumnarToRowExec should be canonicalizable after being (de)serialized") {
withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "parquet") {
withTempPath {
path =>
spark.range(1).write.parquet(path.getAbsolutePath)
val df = spark.read.parquet(path.getAbsolutePath)
val columnarToRowExec =
df.queryExecution.executedPlan.collectFirst { case p: VeloxColumnarToRowExec => p }.get
try {
spark.range(1).queryExecution.executedPlan.foreach {
_ =>
columnarToRowExec.canonicalized
()
}
} catch {
case e: Throwable => fail("VeloxColumnarToRowExec was not canonicalizable", e)
}
}
}
}
}
35 changes: 35 additions & 0 deletions gluten-ut/spark41/src/test/resources/hive-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
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.
-->

<configuration>
<property>
<name>hive.in.test</name>
<value>true</value>
<description>Internal marker for test.</description>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/tmp/hive_one</value>
<description>default is /tmp/hadoop-${user.name} and will be overridden </description>
</property>
<property>
<name>hadoop.this.is.a.test.key</name>
<value>2018-11-17 13:33:33.333</value>
</property>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenSQLJsonProtocolSuite]
enableSuite[GlutenShufflePartitionsUtilSuite]
enableSuite[GlutenSimpleSQLViewSuite]
// TODO: 4.x enableSuite[GlutenSparkPlanSuite] // 1 failure
enableSuite[GlutenSparkPlanSuite]
// Rewrite to check Gluten node
.exclude("SPARK-37779: ColumnarToRowExec should be canonicalizable after being (de)serialized")
enableSuite[GlutenSparkPlannerSuite]
enableSuite[GlutenSparkScriptTransformationSuite]
enableSuite[GlutenSparkSqlParserSuite]
Expand Down Expand Up @@ -734,7 +736,7 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenRuntimeConfigSuite]
enableSuite[GlutenSSBQuerySuite]
enableSuite[GlutenSessionStateSuite]
// TODO: 4.x enableSuite[GlutenSetCommandSuite] // 1 failure
enableSuite[GlutenSetCommandSuite]
// TODO: 4.x enableSuite[GlutenSingleLevelAggregateHashMapSuite] // 1 failure
enableSuite[GlutenSparkSessionBuilderSuite]
// TODO: 4.x enableSuite[GlutenSparkSessionJobTaggingAndCancellationSuite] // 1 failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@
*/
package org.apache.spark.sql.execution

import org.apache.gluten.execution.VeloxColumnarToRowExec

import org.apache.spark.sql.GlutenSQLTestsTrait
import org.apache.spark.sql.internal.SQLConf

class GlutenSparkPlanSuite extends SparkPlanSuite with GlutenSQLTestsTrait {

class GlutenSparkPlanSuite extends SparkPlanSuite with GlutenSQLTestsTrait {}
testGluten(
"SPARK-37779: ColumnarToRowExec should be canonicalizable after being (de)serialized") {
withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "parquet") {
withTempPath {
path =>
spark.range(1).write.parquet(path.getAbsolutePath)
val df = spark.read.parquet(path.getAbsolutePath)
val columnarToRowExec =
df.queryExecution.executedPlan.collectFirst { case p: VeloxColumnarToRowExec => p }.get
try {
spark.range(1).queryExecution.executedPlan.foreach {
_ =>
columnarToRowExec.canonicalized
()
}
} catch {
case e: Throwable => fail("VeloxColumnarToRowExec was not canonicalizable", e)
}
}
}
}
}