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
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
DataFusion supports a few literal expression types for a VALUES list clause:
SELECT*FROM (
VALUES (5, 'foo')
) as t (col1, col2)
However, typed string literals, like a TIMESTAMP are not supported:
select*from (VALUES (TIMESTAMP'2021-06-10 17:01:00Z')) as t (time);
NotImplemented("Unsupported value TypedString { data_type: Timestamp, value: \"2021-06-10 17:01:00Z\" } in a values list expression")
Every time we wish to refer to the time column as a TIMESTAMP, we have to CAST it first, such as in this contrived example:
SELECT DATE_TRUNC('minute', CAST(timeASTIMESTAMP)) AStimeFROM (
VALUES ('2021-06-10 17:01:30Z')
) as t (time)
WHERE CAST(timeASTIMESTAMP) >TIMESTAMP'2021-01-01 00:00:00';
+---------------------+
| time |
+---------------------+
| 2021-06-10 17:01:00 |
+---------------------+
1 row in set. Query took 0.004 seconds.
See the next section for the improved user experience.
Describe the solution you'd like
Add support for typed string literals to a VALUES list. As demonstrated below, the SQL statement becomes less verbose and clarifies the intent by using strict column types:
SELECT DATE_TRUNC('minute', time) AStimeFROM (
VALUES (TIMESTAMP'2021-06-10 17:01:30Z')) as t (time)
WHEREtime>TIMESTAMP'2021-01-01 00:00:00';
+---------------------+
| time |
+---------------------+
| 2021-06-10 17:01:00 |
+---------------------+
1 row in set. Query took 0.007 seconds.
Describe alternatives you've considered
A workaround is possible, however, PostgreSQL supports this syntax, so it would be consistent for DataFusion to provide a similar experience.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
DataFusion supports a few literal expression types for a
VALUES
list clause:However, typed string literals, like a
TIMESTAMP
are not supported:Every time we wish to refer to the
time
column as aTIMESTAMP
, we have toCAST
it first, such as in this contrived example:See the next section for the improved user experience.
Describe the solution you'd like
Add support for typed string literals to a
VALUES
list. As demonstrated below, the SQL statement becomes less verbose and clarifies the intent by using strict column types:Describe alternatives you've considered
A workaround is possible, however, PostgreSQL supports this syntax, so it would be consistent for DataFusion to provide a similar experience.
The text was updated successfully, but these errors were encountered: