This is an automated email from the ASF dual-hosted git repository.
hongze pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new f5a6c98bb [CORE] Add a compilation-time check to forbid case-class
inheritance
f5a6c98bb is described below
commit f5a6c98bb80b11f22a8e07abf9ee22852fc5a425
Author: Hongze Zhang <[email protected]>
AuthorDate: Mon May 13 15:33:21 2024 +0800
[CORE] Add a compilation-time check to forbid case-class inheritance
---
.../apache/spark/shuffle/HashPartitioningWrapper.scala | 1 +
.../spark/sql/delta/catalog/ClickHouseTableV2.scala | 2 ++
.../datasources/v2/clickhouse/metadata/AddFileTags.scala | 1 +
pom.xml | 15 +++++++++++++++
4 files changed, 19 insertions(+)
diff --git
a/gluten-core/src/main/scala/org/apache/spark/shuffle/HashPartitioningWrapper.scala
b/backends-clickhouse/src/main/scala/org/apache/spark/shuffle/HashPartitioningWrapper.scala
similarity index 94%
rename from
gluten-core/src/main/scala/org/apache/spark/shuffle/HashPartitioningWrapper.scala
rename to
backends-clickhouse/src/main/scala/org/apache/spark/shuffle/HashPartitioningWrapper.scala
index 06ce8fe0f..bf1cbe4a8 100644
---
a/gluten-core/src/main/scala/org/apache/spark/shuffle/HashPartitioningWrapper.scala
+++
b/backends-clickhouse/src/main/scala/org/apache/spark/shuffle/HashPartitioningWrapper.scala
@@ -21,6 +21,7 @@ import
org.apache.spark.sql.catalyst.plans.physical.HashPartitioning
// A wrapper for HashPartitioning to remain original hash expressions.
// Only used by CH backend when shuffle hash expressions contains non-field
expression.
+@SuppressWarnings(Array("io.github.zhztheplayer.scalawarts.InheritFromCaseClass"))
class HashPartitioningWrapper(
original: Seq[Expression],
newExpr: Seq[Expression],
diff --git
a/backends-clickhouse/src/main/scala/org/apache/spark/sql/delta/catalog/ClickHouseTableV2.scala
b/backends-clickhouse/src/main/scala/org/apache/spark/sql/delta/catalog/ClickHouseTableV2.scala
index 8c09ae7c7..1107c6a2e 100644
---
a/backends-clickhouse/src/main/scala/org/apache/spark/sql/delta/catalog/ClickHouseTableV2.scala
+++
b/backends-clickhouse/src/main/scala/org/apache/spark/sql/delta/catalog/ClickHouseTableV2.scala
@@ -39,6 +39,7 @@ import java.{util => ju}
import scala.collection.JavaConverters._
+@SuppressWarnings(Array("io.github.zhztheplayer.scalawarts.InheritFromCaseClass"))
class ClickHouseTableV2(
override val spark: SparkSession,
override val path: Path,
@@ -268,6 +269,7 @@ class ClickHouseTableV2(
}
}
+@SuppressWarnings(Array("io.github.zhztheplayer.scalawarts.InheritFromCaseClass"))
class TempClickHouseTableV2(
override val spark: SparkSession,
override val catalogTable: Option[CatalogTable] = None)
diff --git
a/backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/datasources/v2/clickhouse/metadata/AddFileTags.scala
b/backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/datasources/v2/clickhouse/metadata/AddFileTags.scala
index bdb3a30e9..0680663eb 100644
---
a/backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/datasources/v2/clickhouse/metadata/AddFileTags.scala
+++
b/backends-clickhouse/src/main/scala/org/apache/spark/sql/execution/datasources/v2/clickhouse/metadata/AddFileTags.scala
@@ -28,6 +28,7 @@ import java.util.{List => JList}
import scala.collection.JavaConverters._
import scala.collection.mutable.ArrayBuffer
+@SuppressWarnings(Array("io.github.zhztheplayer.scalawarts.InheritFromCaseClass"))
class AddMergeTreeParts(
val database: String,
val table: String,
diff --git a/pom.xml b/pom.xml
index dbf46ac17..a29f19832 100644
--- a/pom.xml
+++ b/pom.xml
@@ -615,6 +615,20 @@
<artifactId>scala-maven-plugin</artifactId>
<version>${scala.compiler.version}</version>
<configuration>
+ <compilerPlugins>
+ <compilerPlugin>
+ <groupId>org.wartremover</groupId>
+ <artifactId>wartremover_${scala.binary.version}</artifactId>
+ <version>3.1.6</version>
+ </compilerPlugin>
+ </compilerPlugins>
+ <dependencies>
+ <dependency>
+ <groupId>io.github.zhztheplayer.scalawarts</groupId>
+ <artifactId>scalawarts</artifactId>
+ <version>0.1.0</version>
+ </dependency>
+ </dependencies>
<recompileMode>${scala.recompile.mode}</recompileMode>
<args>
<arg>-Wconf:msg=While parsing annotations in:silent</arg>
@@ -622,6 +636,7 @@
<arg>-Xfatal-warnings</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
+
<arg>-P:wartremover:traverser:io.github.zhztheplayer.scalawarts.InheritFromCaseClass</arg>
</args>
</configuration>
<executions>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]