Skip to content

Commit

Permalink
do not use sql keywords as attribute names
Browse files Browse the repository at this point in the history
  • Loading branch information
luluorta committed Nov 11, 2020
1 parent ce97a61 commit 6dbd559
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions sql/core/src/test/resources/sql-tests/inputs/datetime.sql
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ select to_timestamp('2019-10-06 A', 'yyyy-MM-dd GGGGG');
select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEEE');
select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE');
select unix_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE');
select from_json('{"timestamp":"26/October/2015"}', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'));
select from_json('{"date":"26/October/2015"}', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'));
select from_csv('26/October/2015', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'));
select from_csv('26/October/2015', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'));
select from_json('{"ts":"26/October/2015"}', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'));
select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'));
select from_csv('26/October/2015', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'));
select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'));
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_json('{"timestamp":"26/October/2015"}', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
select from_json('{"ts":"26/October/2015"}', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand All @@ -907,7 +907,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_json('{"date":"26/October/2015"}', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'))
select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand All @@ -916,7 +916,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_csv('26/October/2015', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
select from_csv('26/October/2015', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand All @@ -925,7 +925,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_csv('26/October/2015', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'))
select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,32 +872,32 @@ struct<unix_timestamp(22 05 2020 Friday, dd MM yyyy EEEEE):bigint>


-- !query
select from_json('{"timestamp":"26/October/2015"}', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
select from_json('{"ts":"26/October/2015"}', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<from_json({"timestamp":"26/October/2015"}):struct<timestamp:timestamp>>
struct<from_json({"ts":"26/October/2015"}):struct<ts:timestamp>>
-- !query output
{"timestamp":2015-10-26 00:00:00}
{"ts":2015-10-26 00:00:00}


-- !query
select from_json('{"date":"26/October/2015"}', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'))
select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<from_json({"date":"26/October/2015"}):struct<date:date>>
struct<from_json({"d":"26/October/2015"}):struct<d:date>>
-- !query output
{"date":2015-10-26}
{"d":2015-10-26}


-- !query
select from_csv('26/October/2015', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
select from_csv('26/October/2015', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<from_csv(26/October/2015):struct<timestamp:timestamp>>
struct<from_csv(26/October/2015):struct<ts:timestamp>>
-- !query output
{"timestamp":2015-10-26 00:00:00}
{"ts":2015-10-26 00:00:00}


-- !query
select from_csv('26/October/2015', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'))
select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<from_csv(26/October/2015):struct<date:date>>
struct<from_csv(26/October/2015):struct<d:date>>
-- !query output
{"date":2015-10-26}
{"d":2015-10-26}
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_json('{"timestamp":"26/October/2015"}', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
select from_json('{"ts":"26/October/2015"}', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand All @@ -885,7 +885,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_json('{"date":"26/October/2015"}', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'))
select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand All @@ -894,7 +894,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_csv('26/October/2015', 'timestamp Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
select from_csv('26/October/2015', 'ts Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand All @@ -903,7 +903,7 @@ You may get a different result due to the upgrading of Spark 3.0: Fail to recogn


-- !query
select from_csv('26/October/2015', 'date Date', map('dateFormat', 'dd/MMMMM/yyyy'))
select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy'))
-- !query schema
struct<>
-- !query output
Expand Down

0 comments on commit 6dbd559

Please sign in to comment.