2021-05-14 10:43:17 +00:00
|
|
|
DROP TABLE IF EXISTS view_no_nulls;
|
|
|
|
DROP TABLE IF EXISTS view_no_nulls_set;
|
|
|
|
DROP TABLE IF EXISTS view_nulls_set;
|
|
|
|
DROP TABLE IF EXISTS view_nulls;
|
2021-05-13 14:21:55 +00:00
|
|
|
|
|
|
|
SET join_use_nulls = 0;
|
|
|
|
|
2021-05-14 10:43:17 +00:00
|
|
|
CREATE OR REPLACE VIEW view_no_nulls AS
|
|
|
|
SELECT * FROM ( SELECT number + 1 AS a, number + 11 AS b FROM numbers(2) ) AS t1
|
|
|
|
FULL JOIN ( SELECT number + 2 AS a, number + 22 AS c FROM numbers(2) ) AS t2
|
2021-06-22 14:32:02 +00:00
|
|
|
USING a ORDER BY a;
|
2021-05-14 10:43:17 +00:00
|
|
|
|
|
|
|
CREATE OR REPLACE VIEW view_nulls_set AS
|
|
|
|
SELECT * FROM ( SELECT number + 1 AS a, number + 11 AS b FROM numbers(2) ) AS t1
|
|
|
|
FULL JOIN ( SELECT number + 2 AS a, number + 22 AS c FROM numbers(2) ) AS t2
|
|
|
|
USING a ORDER BY a
|
2021-06-22 14:32:02 +00:00
|
|
|
SETTINGS join_use_nulls = 1;
|
2021-05-14 10:43:17 +00:00
|
|
|
|
|
|
|
SET join_use_nulls = 1;
|
|
|
|
|
|
|
|
CREATE OR REPLACE VIEW view_nulls AS
|
|
|
|
SELECT * FROM ( SELECT number + 1 AS a, number + 11 AS b FROM numbers(2) ) AS t1
|
|
|
|
FULL JOIN ( SELECT number + 2 AS a, number + 22 AS c FROM numbers(2) ) AS t2
|
|
|
|
USING a ORDER BY a;
|
|
|
|
|
|
|
|
CREATE OR REPLACE VIEW view_no_nulls_set AS
|
|
|
|
SELECT * FROM ( SELECT number + 1 AS a, number + 11 AS b FROM numbers(2) ) AS t1
|
|
|
|
FULL JOIN ( SELECT number + 2 AS a, number + 22 AS c FROM numbers(2) ) AS t2
|
|
|
|
USING a ORDER BY a
|
|
|
|
SETTINGS join_use_nulls = 0;
|
2021-05-13 14:21:55 +00:00
|
|
|
|
|
|
|
SET join_use_nulls = 1;
|
|
|
|
|
2021-06-22 14:32:02 +00:00
|
|
|
SELECT 'join_use_nulls = 1';
|
|
|
|
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_no_nulls;
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_no_nulls_set;
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_nulls_set;
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_nulls;
|
2021-05-14 10:43:17 +00:00
|
|
|
|
|
|
|
SET join_use_nulls = 0;
|
|
|
|
|
2021-06-22 14:32:02 +00:00
|
|
|
SELECT 'join_use_nulls = 0';
|
|
|
|
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_no_nulls;
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_no_nulls_set;
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_nulls_set;
|
|
|
|
SELECT '-';
|
|
|
|
SELECT * FROM view_nulls;
|
2021-05-13 14:21:55 +00:00
|
|
|
|
2021-05-14 10:43:17 +00:00
|
|
|
DROP TABLE IF EXISTS view_no_nulls;
|
|
|
|
DROP TABLE IF EXISTS view_no_nulls_set;
|
|
|
|
DROP TABLE IF EXISTS view_nulls_set;
|
|
|
|
DROP TABLE IF EXISTS view_nulls;
|