andygrove commented on code in PR #509: URL: https://github.com/apache/datafusion-comet/pull/509#discussion_r1631442398
########## spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala: ########## @@ -701,17 +695,17 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde with CometExprShim case UnaryExpression(child) if expr.prettyName == "trycast" => val timeZoneId = SQLConf.get.sessionLocalTimeZone - handleCast(child, inputs, expr.dataType, Some(timeZoneId), "TRY") + handleCast(child, inputs, expr.dataType, Some(timeZoneId), CometEvalMode.TRY) - case Cast(child, dt, timeZoneId, evalMode) => - val evalModeStr = if (evalMode.isInstanceOf[Boolean]) { - // Spark 3.2 & 3.3 has ansiEnabled boolean - if (evalMode.asInstanceOf[Boolean]) "ANSI" else "LEGACY" - } else { - // Spark 3.4+ has EvalMode enum with values LEGACY, ANSI, and TRY - evalMode.toString - } - handleCast(child, inputs, dt, timeZoneId, evalModeStr) + case c @ Cast(child, dt, timeZoneId, _) => + handleCast(child, inputs, dt, timeZoneId, evalMode(c)) + + case expr if isUnsupportedAnsiExpr(expr) && !CometConf.COMET_ANSI_MODE_ENABLED.get() => Review Comment: Sure, let's remove this. It was intended as as short term workaround but I agree that we don't really need it now that we have this fallback logic. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org