milevin commented on issue #6951:
URL: https://github.com/apache/datafusion/issues/6951#issuecomment-2546782678
> FWIW DataFusion already does support interval syntax
This is insufficient. Suppose we want to do something like this:
```
select make_interval(x, 'days') from (select 1 as x)
```
This wouldn't be representable using the interval syntax.
Why do I want to have it? I want to be able to write this, which works in
Postgres:
```
select x * y as z from (select 5 as x, interval '2' day as y)
```
My current thinking is to desugar it into this:
```
select make_interval('month', x * date_part('month', y)) +
make_interval('day', x * date_part('day', y)) + make_interval('nanosecond', x *
date_part('nanosecond', y)) as z from (select 5 as x, interval '2' day as y)
```
Does this make sense? It's a little clunky, but that's my current working
plan.
If somebody has a better idea, speak now or forever hold.
--
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]