martin-g commented on code in PR #19663:
URL: https://github.com/apache/datafusion/pull/19663#discussion_r2667408877


##########
datafusion/functions/src/datetime/to_timestamp.rs:
##########
@@ -325,6 +327,74 @@ impl_to_timestamp_constructors!(ToTimestampMillisFunc);
 impl_to_timestamp_constructors!(ToTimestampMicrosFunc);
 impl_to_timestamp_constructors!(ToTimestampNanosFunc);
 
+fn decimal_to_nanoseconds(value: i128, scale: i8) -> i64 {
+    let scale_factor = 10_i128.pow(scale as u32);

Review Comment:
   Some other PRs started adding support for negative scale:
   * https://github.com/apache/datafusion/pull/19409
   * 
https://github.com/apache/datafusion/pull/19584#pullrequestreview-3621905861
   
   The casting to u32 here would prevent this.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to