You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that, instead of an intervalDayToSecond with a value of 1 day, it produces a value of 86.4 seconds.
What appears to happen is that parsing the SQL produces a RexLiteral to represent the interval with the value 86400000:INTERVAL DAY. This is the number of milliseconds in a day. The conversion in the Isthmus LiteralConverter then treats the value as microseconds (using a scale of 6) and produces an incorrect result.
The text was updated successfully, but these errors were encountered:
@vbarua@Blizzara I am happy to try to provide a fix but I would appreciate some guidance on exactly which part of the flow is incorrect and needs to be changed.
What do the "scale" and "intervalLength" values become here? if "intervalLength" is 86400000, then sounds like "scale" should be 3, and as far as I can read the logic it seems like it should work - so which part is failing?
There's also the comment // TODO: don't need to anymore - that maybe means that as the IntervalDay has a precision field, we should be able to take the given scale and use that directly (as precision - a bit confusing how decimal calls it "scale" and we call it "precision", but I guess that's for reasons). That'd still need some logic to extract the seconds and days. Or technically it could just put the whole "intervalLength" value into the subseconds field, that should also work.
When converting an INTERVAL DAY to Substrait using Isthmus, the result interprets the interval incorrectly. For example, with this input:
The following Substrait is generated:
Note that, instead of an intervalDayToSecond with a value of 1 day, it produces a value of 86.4 seconds.
What appears to happen is that parsing the SQL produces a RexLiteral to represent the interval with the value
86400000:INTERVAL DAY
. This is the number of milliseconds in a day. The conversion in the Isthmus LiteralConverter then treats the value as microseconds (using a scale of 6) and produces an incorrect result.The text was updated successfully, but these errors were encountered: