zhztheplayer commented on code in PR #9472:
URL: https://github.com/apache/incubator-gluten/pull/9472#discussion_r2070370499


##########
tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/DataGen.scala:
##########
@@ -31,6 +31,13 @@ class NoopModifier(t: DataType) extends TypeModifier(_ => 
true, t) {
   override def modValue(value: Any): Any = value
 }
 
+class DecimalTypeModifier extends TypeModifier({
+  case _: DecimalType => true;
+  case _ => false
+}, DoubleType) {
+  override def modValue(value: Any): Any = 
value.asInstanceOf[BigDecimal].doubleValue()
+}

Review Comment:
   Does this make difference with the existing 
[TYPE_MODIFIER_DECIMAL_AS_DOUBLE](https://github.com/apache/incubator-gluten/blob/72d4c7defd9721009ae9dd3c9809224f6e4e2005/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/Constants.scala#L166)?



##########
tools/gluten-it/common/src/main/java/org/apache/gluten/integration/BaseMixin.java:
##########
@@ -80,6 +80,9 @@ public class BaseMixin {
   @CommandLine.Option(names = {"--scan-partitions"}, description = "Scan 
partition number. This is an approximate value, so the actual scan partition 
number might vary around this value. -1 for letting Spark choose an appropriate 
number.", defaultValue = "-1")
   private int scanPartitions;
 
+  @CommandLine.Option(names = {"--decimal-as-double"}, description = "Generate 
double value for decimal type column", defaultValue = "false")

Review Comment:
   nit: value -> values



##########
tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/Suite.scala:
##########
@@ -195,6 +196,10 @@ abstract class Suite(
 
   private[integration] def allQueryIds(): Array[String]
 
+  protected[integration] def typeModifiers(): List[TypeModifier] = {
+    if (decimalAsDouble) List(new DecimalTypeModifier()) else List()
+  }
+

Review Comment:
   nit: Could make it `private[integration]` and move it to line 189. It can 
still be overridden without `protected` since it's not final.



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

Reply via email to