andygrove commented on code in PR #1921: URL: https://github.com/apache/datafusion-comet/pull/1921#discussion_r2164131324
########## native/core/src/execution/planner.rs: ########## @@ -746,6 +746,22 @@ impl PhysicalPlanner { let child = self.create_expr(expr.child.as_ref().unwrap(), input_schema)?; Ok(Arc::new(ToJson::new(child, &expr.timezone))) } + ExprStruct::ToPrettyString(expr) => { + let mut spark_cast_options = + SparkCastOptions::new(EvalMode::Try, &expr.timezone, true); + spark_cast_options.null_string = "NULL".to_string(); + let child = self.create_expr(expr.child.as_ref().unwrap(), input_schema)?; + let cast = Arc::new(Cast::new( + Arc::clone(&child), + DataType::Utf8, + spark_cast_options, + )); + Ok(Arc::new(IfExpr::new( + Arc::new(IsNullExpr::new(child)), + Arc::new(Literal::new(ScalarValue::Utf8(Some("NULL".to_string())))), Review Comment: I couldn't apply the code suggestion directly, but I made an equivalent change. -- 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