comphead commented on code in PR #1921:
URL: https://github.com/apache/datafusion-comet/pull/1921#discussion_r2162731604


##########
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:
   ```suggestion
                       
Arc::new(Literal::new(ScalarValue::Utf8(Some(spark_cast_options.null_string)))),
   ```



-- 
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

Reply via email to