You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by ya...@apache.org on 2024/06/25 14:25:09 UTC
(incubator-gluten) branch main updated: [GLUTEN-6219] Fix some code style issue for BasicScanExecTransformer.scala (#6220)
This is an automated email from the ASF dual-hosted git repository.
yangzy 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 524434826 [GLUTEN-6219] Fix some code style issue for BasicScanExecTransformer.scala (#6220)
524434826 is described below
commit 524434826b42fd7e5cfda9b6e023efa656e2c6ae
Author: James Xu <xu...@gmail.com>
AuthorDate: Tue Jun 25 22:25:04 2024 +0800
[GLUTEN-6219] Fix some code style issue for BasicScanExecTransformer.scala (#6220)
Co-authored-by: James Xu <xu...@shizhuang-inc.com>
---
.../gluten/execution/BasicScanExecTransformer.scala | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/gluten-core/src/main/scala/org/apache/gluten/execution/BasicScanExecTransformer.scala b/gluten-core/src/main/scala/org/apache/gluten/execution/BasicScanExecTransformer.scala
index 3bbd99c50..9d231bbc2 100644
--- a/gluten-core/src/main/scala/org/apache/gluten/execution/BasicScanExecTransformer.scala
+++ b/gluten-core/src/main/scala/org/apache/gluten/execution/BasicScanExecTransformer.scala
@@ -32,6 +32,7 @@ import org.apache.spark.sql.hive.HiveTableScanExecTransformer
import org.apache.spark.sql.types.{BooleanType, StringType, StructField, StructType}
import com.google.protobuf.StringValue
+import io.substrait.proto.NamedStruct
import scala.collection.JavaConverters._
@@ -109,19 +110,19 @@ trait BasicScanExecTransformer extends LeafTransformSupport with BaseDataSource
}
override protected def doTransform(context: SubstraitContext): TransformContext = {
- val output = filteRedundantField(outputAttributes())
+ val output = filterRedundantField(outputAttributes())
val typeNodes = ConverterUtils.collectAttributeTypeNodes(output)
val nameList = ConverterUtils.collectAttributeNamesWithoutExprId(output)
val columnTypeNodes = output.map {
attr =>
if (getPartitionSchema.exists(_.name.equals(attr.name))) {
- new ColumnTypeNode(1)
+ new ColumnTypeNode(NamedStruct.ColumnType.PARTITION_COL_VALUE)
} else if (SparkShimLoader.getSparkShims.isRowIndexMetadataColumn(attr.name)) {
- new ColumnTypeNode(3)
+ new ColumnTypeNode(NamedStruct.ColumnType.ROWINDEX_COL_VALUE)
} else if (attr.isMetadataCol) {
- new ColumnTypeNode(2)
+ new ColumnTypeNode(NamedStruct.ColumnType.METADATA_COL_VALUE)
} else {
- new ColumnTypeNode(0)
+ new ColumnTypeNode(NamedStruct.ColumnType.NORMAL_COL_VALUE)
}
}.asJava
// Will put all filter expressions into an AND expression
@@ -156,8 +157,8 @@ trait BasicScanExecTransformer extends LeafTransformSupport with BaseDataSource
TransformContext(output, output, readNode)
}
- def filteRedundantField(outputs: Seq[Attribute]): Seq[Attribute] = {
- var final_output: List[Attribute] = List()
+ private def filterRedundantField(outputs: Seq[Attribute]): Seq[Attribute] = {
+ var finalOutput: List[Attribute] = List()
val outputList = outputs.toArray
for (i <- outputList.indices) {
var dup = false
@@ -167,9 +168,9 @@ trait BasicScanExecTransformer extends LeafTransformSupport with BaseDataSource
}
}
if (!dup) {
- final_output = final_output :+ outputList(i)
+ finalOutput = finalOutput :+ outputList(i)
}
}
- final_output
+ finalOutput
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org