Skip to content

Commit

Permalink
move some class from gluten-it/sparkxx to gluten-ut/common (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchengchenghh authored Jan 13, 2023
1 parent af5c650 commit 2753cb1
Show file tree
Hide file tree
Showing 24 changed files with 128 additions and 959 deletions.
92 changes: 92 additions & 0 deletions gluten-ut/common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>gluten-ut</artifactId>
<groupId>io.glutenproject</groupId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>gluten-ut-common</artifactId>
<packaging>jar</packaging>
<name>Gluten Unit Test Common</name>

<build>
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala.compiler.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<junitxml>.</junitxml>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemProperties>
<clickhouse.lib.path>${clickhouse.lib.path}</clickhouse.lib.path>
<tpcds.data.path>${tpcds.data.path}</tpcds.data.path>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>prepare-test-jar</id>
<phase>test-compile</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ package io.glutenproject.utils

import io.glutenproject.GlutenConfig
import io.glutenproject.backendsapi.BackendsApiManager
import io.glutenproject.utils.clickhouse.ClickHouseTestSettings
import io.glutenproject.utils.velox.VeloxTestSettings

import java.util

import scala.reflect.ClassTag
import scala.collection.JavaConverters._

Expand Down Expand Up @@ -137,12 +135,17 @@ abstract class BackendTestSettings {
object BackendTestSettings {
val instance: BackendTestSettings = BackendsApiManager.getBackendName match {
case GlutenConfig.GLUTEN_CLICKHOUSE_BACKEND =>
ClickHouseTestSettings
// scalastyle:off classforname
Class.forName("io.glutenproject.utils.clickhouse.ClickHouseTestSettings").newInstance()
.asInstanceOf[BackendTestSettings]
case GlutenConfig.GLUTEN_VELOX_BACKEND =>
VeloxTestSettings
Class.forName("io.glutenproject.utils.velox.VeloxTestSettings").newInstance()
.asInstanceOf[BackendTestSettings]
case GlutenConfig.GLUTEN_GAZELLE_BACKEND =>
// FIXME here we reuse Velox backend's code
VeloxTestSettings
Class.forName("io.glutenproject.utils.VeloxTestSettings").newInstance()
.asInstanceOf[BackendTestSettings]
// scalastyle:on classforname
case other =>
throw new IllegalStateException(other)
}
Expand Down
3 changes: 3 additions & 0 deletions gluten-ut/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
</activation>
<modules>
<module>spark32</module>
<module>common</module>
</modules>
</profile>
<profile>
Expand All @@ -168,12 +169,14 @@
</properties>
<modules>
<module>spark32</module>
<module>common</module>
</modules>
</profile>
<profile>
<id>spark-3.3</id>
<modules>
<module>spark33</module>
<module>common</module>
</modules>
</profile>
</profiles>
Expand Down
10 changes: 10 additions & 0 deletions gluten-ut/spark32/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
<packaging>jar</packaging>
<name>Gluten Unit Test Spark32</name>

<dependencies>
<dependency>
<groupId>io.glutenproject</groupId>
<artifactId>gluten-ut-common</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<type>test-jar</type>
</dependency>
</dependencies>

<profiles>
<profile>
<id>backends-clickhouse</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import io.glutenproject.utils.BackendTestSettings
import org.apache.spark.sql._
import org.apache.spark.sql.catalyst.expressions._

object ClickHouseTestSettings extends BackendTestSettings {
class ClickHouseTestSettings extends BackendTestSettings {

enableSuite[GlutenDataFrameAggregateSuite]
.exclude(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.apache.spark.sql.execution._
import org.apache.spark.sql.execution.adaptive.GlutenAdaptiveQueryExecSuite
import org.apache.spark.sql.execution.joins.{GlutenBroadcastJoinSuite, GlutenExistenceJoinSuite, GlutenOuterJoinSuite, GlutenInnerJoinSuite}

object VeloxTestSettings extends BackendTestSettings {
class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenDataFrameAggregateSuite]
.exclude(
"zero moments", // [velox does not return NaN]
Expand Down

This file was deleted.

Loading

0 comments on commit 2753cb1

Please sign in to comment.