Repository navigation
feat: support DATETIME as an alias of TIMESTAMP - #26975
Conversation
alamb
left a comment
There was a problem hiding this comment.
Thanks -- makes sense to me
|
Does having this example still make sense https://datafusion.apache.org/library-user-guide/extending-sql.html#example-custom-datetime-type? Maybe we could add a note saying that it is now implemented. |
1fa1d5d to
faeb42c
Compare
|
@nuno-faria I’ve added the note to the code's comment, not sure if we should add something else. |
nuno-faria
left a comment
There was a problem hiding this comment.
Thanks @hozan23, I just have a question about the test_custom_type_plan test.
| #[test] | ||
| fn test_custom_type_plan() -> Result<()> { | ||
| let sql = "SELECT DATETIME '2001-01-01 18:00:00'"; | ||
|
|
There was a problem hiding this comment.
Should this test now use a different type? Because right now the result is the same as the default.
Planning DATETIME failed with "Unsupported SQL type" unless a TypePlanner handled it. Plan DATETIME and DATETIME(p) as TIMESTAMP without a time zone, with the same precisions and nanosecond default.
a62449d to
1d4cf3f
Compare
|
@nuno-faria I have made the custom planner (The one that been used in that test) maps |
|
Thanks @hozan23, LGTM. |
Which issue does this PR close?
Rationale for this change
Planning
DATETIMEfailed with "Unsupported SQL type" unless aTypePlannerhandled it.What changes are included in this PR?
DATETIMEandDATETIME(p)are planned asTIMESTAMPwithout a time zone, with the same precisions and nanosecond default.What is the testing strategy for this PR?
New
sqllogictestcases indatetime/timestamps.slt.test_custom_type_plannow expectsDATETIMEto plan by default.Are there any user-facing changes?
Yes,
DATETIMEis now supported without aTypePlanner. No API changes.