forked from apache/datafusion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port tests in wildcard.rs to sqllogictest (apache#6249)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Showing
3 changed files
with
122 additions
and
144 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 was deleted.
Oops, something went wrong.
122 changes: 122 additions & 0 deletions
122
datafusion/core/tests/sqllogictests/test_files/wildcard.slt
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,122 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
# create t1 table | ||
statement ok | ||
CREATE TABLE t1(t1_id INT, t1_name TEXT, t1_int INT) AS VALUES | ||
(11, 'a', 1), | ||
(22, 'b', 2), | ||
(33, 'c', 3), | ||
(44, 'd', 4); | ||
|
||
# create t2 table | ||
statement ok | ||
CREATE TABLE t2(t2_id INT, t2_name TEXT, t2_int INT) AS VALUES | ||
(11, 'z', 3), | ||
(22, 'y', 1), | ||
(44, 'x', 3), | ||
(55, 'w', 3); | ||
|
||
# create aggregate_simple table | ||
statement ok | ||
CREATE EXTERNAL TABLE aggregate_simple ( | ||
c1 REAL NOT NULL, | ||
c2 DOUBLE NOT NULL, | ||
c3 BOOLEAN NOT NULL, | ||
) | ||
STORED AS CSV | ||
WITH HEADER ROW | ||
LOCATION 'tests/data/aggregate_simple.csv' | ||
|
||
|
||
########## | ||
## Wildcard Tests | ||
########## | ||
|
||
# select_qualified_wildcard | ||
query RRB nosort | ||
SELECT agg.* FROM aggregate_simple as agg ORDER BY c1 | ||
---- | ||
0.00001 0.000000000001 true | ||
0.00002 0.000000000002 false | ||
0.00002 0.000000000002 false | ||
0.00003 0.000000000003 true | ||
0.00003 0.000000000003 true | ||
0.00003 0.000000000003 true | ||
0.00004 0.000000000004 false | ||
0.00004 0.000000000004 false | ||
0.00004 0.000000000004 false | ||
0.00004 0.000000000004 false | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
|
||
# select_non_alias_qualified_wildcard | ||
query RRB nosort | ||
SELECT aggregate_simple.* FROM aggregate_simple ORDER BY c1 | ||
---- | ||
0.00001 0.000000000001 true | ||
0.00002 0.000000000002 false | ||
0.00002 0.000000000002 false | ||
0.00003 0.000000000003 true | ||
0.00003 0.000000000003 true | ||
0.00003 0.000000000003 true | ||
0.00004 0.000000000004 false | ||
0.00004 0.000000000004 false | ||
0.00004 0.000000000004 false | ||
0.00004 0.000000000004 false | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
0.00005 0.000000000005 true | ||
|
||
# select_qualified_wildcard_join | ||
query ITIITI nosort | ||
SELECT tb1.*, tb2.* FROM t1 tb1 JOIN t2 tb2 ON t2_id = t1_id ORDER BY t1_id | ||
---- | ||
11 a 1 11 z 3 | ||
22 b 2 22 y 1 | ||
44 d 4 44 x 3 | ||
|
||
# select_non_alias_qualified_wildcard_join | ||
query ITIITI nosort | ||
SELECT t1.*, tb2.* FROM t1 JOIN t2 tb2 ON t2_id = t1_id ORDER BY t1_id | ||
---- | ||
11 a 1 11 z 3 | ||
22 b 2 22 y 1 | ||
44 d 4 44 x 3 | ||
|
||
# select_wrong_qualified_wildcard | ||
statement error Error during planning: Invalid qualifier agg | ||
SELECT agg.* FROM aggregate_simple ORDER BY c1 | ||
|
||
######## | ||
# Clean up after the test | ||
######## | ||
|
||
statement ok | ||
DROP TABLE t1; | ||
|
||
statement ok | ||
DROP TABLE t2; | ||
|
||
statement ok | ||
DROP TABLE aggregate_simple; |