aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/datetime2/test/cases/BlockSplitMake.sql
blob: a6c0d65a83c45c64a99eda683513fc703137bc86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* syntax version 1 */
pragma UseBlocks;
insert into @t
    select
        Unwrap(cast(fdate as Date)) as `date`,
        Unwrap(cast(fdatetime as Datetime)) as `datetime`,
        Unwrap(cast(ftimestamp as Timestamp)) as `timestamp`,
        Unwrap(cast(ftzdate as TzDate)) as `tzdate`,
        Unwrap(cast(ftzdatetime as TzDatetime)) as `tzdatetime`,
        Unwrap(cast(ftztimestamp as TzTimestamp)) as `tztimestamp`
    from Input;
commit;

select
    DateTime::MakeDate(`date`) as rdate,
    DateTime::MakeDatetime(`datetime`) as rdatetime,
    DateTime::MakeTimestamp(`timestamp`) as rtimestamp,
    DateTime::MakeTzDate(`tzdate`) as rtzdate,
    DateTime::MakeTzDatetime(`tzdatetime`) as rtzdatetime,
    DateTime::MakeTzTimestamp(`tztimestamp`) as rtztimestamp
from @t;