You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2025/04/03 14:38:47 UTC
Re: [I] Different semantics of casting from int64 to timestamp between Comet and Spark [datafusion-comet]
andygrove commented on issue #146:
URL: https://github.com/apache/datafusion-comet/issues/146#issuecomment-2776015004
A better test would be something like this:
```scala
test("cast LongType to TimestampType") {
// input value is interpreted as milliseconds but will be cast to microseconds
val min = -9223372036854775L
val max = 9223372036854775L
val values = gen.generateLongs(dataSize)
.filter(x => x >= min && x <= max) ++ Seq(min, max)
castTest(withNulls(values).toDF("a"), DataTypes.TimestampType)
}
```
However the min value here is actually causing an overflow in Spark and I am not sure why so this needs some more research.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org