cloud-fan commented on pull request #28600:

   org.scalatest.exceptions.TestFailedException: "struct<([3 div 2]):bigint>" 
did not equal "struct<([CAST(3 AS BIGINT) div CAST(2 AS BIGINT)]):bigint>" 
Schema did not match for query SELECT 3 div 2
   OK so the problem here is we change the auto-generated column name of `3 div 
2`, because we add cast.
   It's not a big deal, we can just update all the tests. But I'm thinking if 
it's better to embed the cast in the `IntegralDivide` itself. e.g.
   case class IntegralDivide(...) {
     private lazy val div: (Any, Any) => Any = {
       val integral = left.dataType match {
         case _: IntegralType =>
           LongType.integral.asInstanceOf[Integral[Any]] // see the change in 
this line
         case d: DecimalType =>
       (x, y) => {
         val res = integral.quot(x, y)
         if (res == null) {
         } else {
     override def operationCode(v1: String, v2: String): String = {
       if (decimalType) ... else {
         s"((long) $v1) / $v2"
   This is probably more efficient as there are less expressions

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.

For queries about this service, please contact Infrastructure at:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to