chenkovsky commented on code in PR #16539:
URL: https://github.com/apache/datafusion/pull/16539#discussion_r2165199807


##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -3069,7 +3069,7 @@ impl ScalarValue {
                 ScalarValue::Decimal128(Some(decimal_value), _, scale),
                 DataType::Timestamp(time_unit, None),
             ) => {
-                let scale_factor = 10_i128.pow(*scale as u32);
+                let scale_factor = 10_i128.pow(*scale as u32 + 3);

Review Comment:
   > Does this depend on the timestamp precision (time unit)? Can you please 
add tests for other units?
   > 
   > Do we need this special casing at all for casting decimal to timestamp? or 
can we end up calling `cast_with_options`, just like we do for virtually all 
other type pairs?
   
   @findepi you are right, it's time unit related. I updated code.



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