feat!: annotation support for LOCALTIME function#6651
feat!: annotation support for LOCALTIME function#6651VaggelisD merged 2 commits intotobymao:mainfrom
Conversation
VaggelisD
left a comment
There was a problem hiding this comment.
Hey @AbhishekASLK, I'd generally expect that LOCALTIME does evaluates to a TIME type across all dialects but from a quick search it might not be the case e.g MySQL seems to produce a timestamp:
mysql> select LOCALTIME;
+---------------------+
| LOCALTIME |
+---------------------+
| 2026-01-05 12:01:09 |
+---------------------+We should only annotate an expression "globally" (i.e in __init__.py) if that's the case for all dialects
So let me do it specific to dialects |
We can probably add |
Sure @VaggelisD I'll pass over all dialects for this. |
|
Dialects (returns time):
duckdb> select localtime;
┌──────────────┐
│ localtime │
╞══════════════╡
│ 13:06:02.393 │
└──────────────┘
LOCALTIME
05:11:01
+---------------------+
| localtime |
+---------------------+
| 2026-01-05 13:20:24 |
+---------------------+ |
This PR ensures
LOCALTIMEexpressions are correctly resolved toDataType.Type.TIMEby addingexp.Localtimeto the expression metadata, fixing an issue where they were previously annotated asUNKNOWNBefore:
After: