Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add a newline at the end and alter SQL
  • Loading branch information
jmchung committed Aug 17, 2017
commit ff3b9daa0cb7d271872af914f5c5a6223f3c855c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ select from_json('{"a":1}', 'a INT', map('mode', 1));
select from_json();
-- json_tuple
SELECT json_tuple('{"a" : 1, "b" : 2}', CAST(NULL AS STRING), 'b', CAST(NULL AS STRING), 'a');
CREATE TEMPORARY VIEW jsonTable(jsonField, a, b) AS SELECT * FROM VALUES ('{"a": 1, "b": 2}', 'a', 'b');
SELECT json_tuple(jsonField, b, CAST(NULL AS STRING), 'a') FROM jsonTable;
CREATE TEMPORARY VIEW jsonTable(jsonField, a) AS SELECT * FROM VALUES ('{"a": 1, "b": 2}', 'a');
SELECT json_tuple(jsonField, 'b', CAST(NULL AS STRING), a) FROM jsonTable;
-- Clean up
DROP VIEW IF EXISTS jsonTable;
DROP VIEW IF EXISTS jsonTable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: just FYI, we do not need to drop the temp view in SQLQueryTestSuite.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a big deal. Thus, I will merge it when the test can pass.

Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ NULL 2 NULL 1


-- !query 18
CREATE TEMPORARY VIEW jsonTable(jsonField, a, b) AS SELECT * FROM VALUES ('{"a": 1, "b": 2}', 'a', 'b')
CREATE TEMPORARY VIEW jsonTable(jsonField, a) AS SELECT * FROM VALUES ('{"a": 1, "b": 2}', 'a')
-- !query 18 schema
struct<>
-- !query 18 output



-- !query 19
SELECT json_tuple(jsonField, b, CAST(NULL AS STRING), 'a') FROM jsonTable
SELECT json_tuple(jsonField, 'b', CAST(NULL AS STRING), a) FROM jsonTable
-- !query 19 schema
struct<c0:string,c1:string,c2:string>
-- !query 19 output
Expand Down