-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sample is it's own relation in the join order optimizer
- Loading branch information
Showing
3 changed files
with
49 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
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,30 @@ | ||
# name: test/sql/optimizer/InFilter.test | ||
# description: Test sampling of larger relations | ||
# group: [sample] | ||
|
||
#statement ok | ||
#PRAGMA enable_verification; | ||
|
||
statement ok | ||
CREATE TABLE t1 (s UUID, i VARCHAR); | ||
|
||
statement ok | ||
INSERT INTO t1 VALUES | ||
('619d9199-bc25-41d7-803e-1fa801b4b952'::UUID, NULL), | ||
('1ada8361-c20b-4e9f-9c8e-15689039cc75'::UUID, '91'), | ||
('f5a8a7d8-6bc5-4337-a296-d52078156051'::UUID, NULL); | ||
|
||
statement ok | ||
CREATE TABLE t2 (v VARCHAR); | ||
|
||
statement ok | ||
INSERT INTO t2 VALUES | ||
('Int',), | ||
('91',), | ||
('13',), | ||
('sst',); | ||
|
||
statement ok | ||
SELECT t1.s | ||
FROM t1 | ||
LEFT JOIN t2 ON t1.i = t2.v; |
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,18 @@ | ||
# name: test/sql/optimizer/tests_no_pushdown_under_samples.test | ||
# group: [optimizer] | ||
|
||
statement ok | ||
CREATE OR REPLACE TABLE df AS (SELECT * AS i FROM range(10)); | ||
|
||
statement ok | ||
CREATE OR REPLACE TABLE wtf AS (SELECT 1 AS i); | ||
|
||
query II | ||
explain FROM | ||
df, wtf | ||
SELECT | ||
df.i | ||
WHERE df.i > 8 | ||
USING SAMPLE 1; | ||
---- | ||
physical_plan <REGEX>:.*FILTER.*RESERVOIR_SAMPLE.* |