-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support cast function
date
(#12738)
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
statement ok | ||
create table dt (a date, b varchar); | ||
|
||
statement ok | ||
insert into dt values (date('2020-01-23'), '1990-12-19'); | ||
|
||
query TT | ||
select | ||
date(b) | ||
from | ||
dt | ||
except | ||
select | ||
cast(b as date) | ||
from dt | ||
except | ||
select | ||
b::date | ||
from dt; | ||
---- | ||
|
||
statement ok | ||
drop table dt; | ||
|
||
query T | ||
select date('2030-03-30'); | ||
---- | ||
2030-03-30 | ||
|
||
query error | ||
select date('2000-13-03'); | ||
|
||
query error | ||
select date('00-00-33'); | ||
|
||
query error cannot cast type "integer" to "date" in Explicit context | ||
select date(1); | ||
|
||
query error unexpected arguments number | ||
select date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters