Skip to content

Commit

Permalink
Support long type for ceil function (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
harveyyue authored Feb 21, 2025
1 parent 853c5f2 commit 4a5b062
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -843,13 +843,17 @@ object NativeConverters extends Logging {
}
}
case e: Ceil if !e.dataType.isInstanceOf[DecimalType] =>
buildExprNode {
_.setTryCast(
pb.PhysicalTryCastNode
.newBuilder()
.setExpr(buildScalarFunction(pb.ScalarFunction.Ceil, e.children, e.dataType))
.setArrowType(convertDataType(e.dataType))
.build())
if (e.child.dataType.isInstanceOf[LongType]) {
convertExprWithFallback(e.child, isPruningExpr, fallback)
} else {
buildExprNode {
_.setTryCast(
pb.PhysicalTryCastNode
.newBuilder()
.setExpr(buildScalarFunction(pb.ScalarFunction.Ceil, e.children, e.dataType))
.setArrowType(convertDataType(e.dataType))
.build())
}
}

// TODO: datafusion's round() has different behavior from spark
Expand Down

0 comments on commit 4a5b062

Please sign in to comment.