prashantksharma commented on code in PR #415: URL: https://github.com/apache/datafusion-comet/pull/415#discussion_r1623140789
########## spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala: ########## @@ -525,6 +527,18 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde { * @return * The protobuf representation of the expression, or None if the expression is not supported */ + + def stringToEvalMode(evalModeStr: String): ExprOuterClass.EvalMode = + evalModeStr.toUpperCase(Locale.ROOT) match { + case "LEGACY" => ExprOuterClass.EvalMode.LEGACY + case "TRY" => ExprOuterClass.EvalMode.TRY + case "ANSI" => ExprOuterClass.EvalMode.ANSI + case _ => + throw new IllegalArgumentException( + "Invalid eval mode" Review Comment: I have updated the code as follows. ```scala 5 def stringToEvalMode(evalModeStr: String): ExprOuterClass.EvalMode = 4 evalModeStr.toUpperCase(Locale.ROOT) match { 3 case "LEGACY" => ExprOuterClass.EvalMode.LEGACY 2 case "TRY" => ExprOuterClass.EvalMode.TRY 1 case "ANSI" => ExprOuterClass.EvalMode.ANSI 536 case invalid => 1 throw new IllegalArgumentException( 2 s"Invalid eval mode '$invalid' " 3 ) // Assuming we want to catch errors strictly 4 } ``` -- 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