andygrove opened a new issue, #1350:
URL: https://github.com/apache/datafusion-comet/issues/1350
### Describe the bug
In `QueryPlanSerde`, we have code in `exprToProto` to ensure the decimal
precision is the same for both children of a binary expression.
```scala
def exprToProto(
expr: Expression,
inputs: Seq[Attribute],
binding: Boolean = true): Option[Expr] = {
val conf = SQLConf.get
val newExpr =
DecimalPrecision.promote(conf.decimalOperationsAllowPrecisionLoss,
expr, !conf.ansiEnabled)
exprToProtoInternal(newExpr, inputs, binding)
}
```
However, this calls `exprToProtoInternal` which is a recursive method. For
example, when creating a binary expression:
```scala
val leftExpr = exprToProtoInternal(left, inputs, binding)
val rightExpr = exprToProtoInternal(right, inputs, binding)
```
The decimal promotion logic is not applied in this case.
Given that `exprToProto` contains a single line of code and then delegates
to `exprToProtoInternal`, I propose that we simply combine these two methods.
### Steps to reproduce
_No response_
### Expected behavior
_No response_
### Additional context
_No response_
--
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]