himadripal commented on code in PR #1385:
URL: https://github.com/apache/datafusion-comet/pull/1385#discussion_r1951694041


##########
native/spark-expr/src/conversion_funcs/cast.rs:
##########
@@ -872,6 +872,13 @@ fn cast_array(
     let array = array_with_timezone(array, cast_options.timezone.clone(), 
Some(to_type))?;
     let from_type = array.data_type().clone();
 
+    let native_cast_options: CastOptions = CastOptions {
+        safe: !matches!(cast_options.eval_mode, EvalMode::Ansi), // take safe 
mode from cast_options passed
+        format_options: FormatOptions::new()

Review Comment:
   In the default CAST_OPTIONS which is replaced by this native_cast_options 
had two these set to 
   ```rust 
   static TIMESTAMP_FORMAT: Option<&str> = Some("%Y-%m-%d %H:%M:%S%.f");
              
    timestamp_format: TIMESTAMP_FORMAT,
    timestamp_tz_format: TIMESTAMP_FORMAT,
   ```
   If we change it to `default`, I checked `FormatOptions::default()` 
implementation  set these 
   ```rust
               timestamp_format: None,
               timestamp_tz_format: None,
   ```
   Hence kept it as it is defined inside default CAST_OPTIONS for comet.



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