-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRILL-7050 - Testing subqueries in the SELECT statement. (#584)
- Loading branch information
1 parent
f84ee6a
commit 704d6e4
Showing
53 changed files
with
537 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
framework/resources/Datasources/ctas/subqueries/subqueries_select.ddl
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,2 @@ | ||
DROP TABLE IF EXISTS dfs.drilltestdir.`employee_json_for_subq`; | ||
CREATE TABLE dfs.drilltestdir.`employee_json_for_subq` as SELECT * FROM cp.`employee.json`; |
9 changes: 9 additions & 0 deletions
9
framework/resources/Datasources/ctas/subqueries/subqueries_select.sh
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,9 @@ | ||
#!/bin/bash | ||
source conf/drillTestConfig.properties | ||
|
||
if [ -z "$PASSWORD" ] | ||
then | ||
${DRILL_HOME}/bin/sqlline -n ${USERNAME} -u "jdbc:drill:schema=dfs.drilltestdir;drillbit=${DRILL_STORAGE_PLUGIN_SERVER}" --run=${DRILL_TEST_DATA_DIR}/Datasources/ctas/subqueries/subqueries_select.ddl | ||
else | ||
${DRILL_HOME}/bin/sqlline -n ${USERNAME} -p ${PASSWORD} -u "jdbc:drill:schema=dfs.drilltestdir;drillbit=${DRILL_STORAGE_PLUGIN_SERVER}" --run=${DRILL_TEST_DATA_DIR}/Datasources/ctas/subqueries/subqueries_select.ddl | ||
fi |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/agg_func_avg_in_subquery.e_tsv
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,5 @@ | ||
1 null | ||
5 1.6666666666666667 | ||
6 1.75 | ||
7 2.0 | ||
8 2.3333333333333335 |
16 changes: 16 additions & 0 deletions
16
framework/resources/Functional/subqueries/subquery_in_select/agg_func_avg_in_subquery.sql
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,16 @@ | ||
SET `planner.enable_nljoin_for_scalar_only` = false; | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
AVG(sb.position_id) as avg_position | ||
FROM | ||
cp.`employee.json` as sb | ||
WHERE | ||
sb.employee_id < m.employee_id | ||
) as avg_position | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; | ||
RESET `planner.enable_nljoin_for_scalar_only`; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/agg_func_max_in_subquery.e_tsv
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,5 @@ | ||
1 Zach Lovell | ||
5 Zach Lovell | ||
6 Zach Lovell | ||
7 Zach Lovell | ||
8 Zach Lovell |
12 changes: 12 additions & 0 deletions
12
framework/resources/Functional/subqueries/subquery_in_select/agg_func_max_in_subquery.sql
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,12 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
MAX(sb.full_name) as max_concat | ||
FROM | ||
cp.`employee.json` as sb | ||
) as max_f_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/agg_func_min_in_subquery.e_tsv
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,5 @@ | ||
1 A. Joyce Jarvis | ||
5 A. Joyce Jarvis | ||
6 A. Joyce Jarvis | ||
7 A. Joyce Jarvis | ||
8 A. Joyce Jarvis |
12 changes: 12 additions & 0 deletions
12
framework/resources/Functional/subqueries/subquery_in_select/agg_func_min_in_subquery.sql
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,12 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
MIN(sb.full_name) as min_concat | ||
FROM | ||
cp.`employee.json` as sb | ||
) as min_f_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/agg_func_sum_in_subquery.e_tsv
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,5 @@ | ||
1 null | ||
5 5 | ||
6 7 | ||
7 10 | ||
8 14 |
16 changes: 16 additions & 0 deletions
16
framework/resources/Functional/subqueries/subquery_in_select/agg_func_sum_in_subquery.sql
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,16 @@ | ||
SET `planner.enable_nljoin_for_scalar_only` = false; | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
SUM(sb.position_id) as sum_position | ||
FROM | ||
cp.`employee.json` as sb | ||
WHERE | ||
sb.employee_id < m.employee_id | ||
) as sum_position | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; | ||
RESET `planner.enable_nljoin_for_scalar_only`; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/external_table_group_by.e_tsv
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,5 @@ | ||
1 1 | ||
5 1 | ||
6 1 | ||
7 1 | ||
8 1 |
15 changes: 15 additions & 0 deletions
15
framework/resources/Functional/subqueries/subquery_in_select/external_table_group_by.sql
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,15 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
COUNT(sub.position_id) as count_position_id | ||
FROM | ||
dfs.drilltestdir.`employee_json_for_subq` as sub | ||
GROUP BY sub.position_id | ||
LIMIT 1 | ||
) as count_position_id | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' | ||
LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
...resources/Functional/subqueries/subquery_in_select/external_table_group_by_order_by.e_tsv
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,5 @@ | ||
1 1 | ||
5 1 | ||
6 1 | ||
7 1 | ||
8 1 |
16 changes: 16 additions & 0 deletions
16
...k/resources/Functional/subqueries/subquery_in_select/external_table_group_by_order_by.sql
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,16 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
COUNT(sub.position_id) as count_position_id | ||
FROM | ||
dfs.drilltestdir.`employee_json_for_subq` as sub | ||
GROUP BY sub.position_id | ||
ORDER BY count_position_id | ||
LIMIT 1 | ||
) as count_position_id | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' | ||
LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
...rces/Functional/subqueries/subquery_in_select/external_table_group_by_order_by_desc.e_tsv
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,5 @@ | ||
1 268 | ||
5 268 | ||
6 268 | ||
7 268 | ||
8 268 |
16 changes: 16 additions & 0 deletions
16
...ources/Functional/subqueries/subquery_in_select/external_table_group_by_order_by_desc.sql
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,16 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
COUNT(sub.position_id) as count_position_id | ||
FROM | ||
dfs.drilltestdir.`employee_json_for_subq` as sub | ||
GROUP BY sub.position_id | ||
ORDER BY count_position_id DESC | ||
LIMIT 1 | ||
) as count_position_id | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' | ||
LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
...rk/resources/Functional/subqueries/subquery_in_select/external_table_group_by_where.e_tsv
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,5 @@ | ||
1 24 | ||
5 24 | ||
6 24 | ||
7 24 | ||
8 24 |
16 changes: 16 additions & 0 deletions
16
...work/resources/Functional/subqueries/subquery_in_select/external_table_group_by_where.sql
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,16 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
COUNT(sub.position_id) as count_position_id | ||
FROM | ||
dfs.drilltestdir.`employee_json_for_subq` as sub | ||
WHERE sub.position_id > 7 | ||
GROUP BY sub.position_id | ||
LIMIT 1 | ||
) as count_position_id | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' | ||
LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
...work/resources/Functional/subqueries/subquery_in_select/external_table_having_count.e_tsv
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,5 @@ | ||
1 6 | ||
5 6 | ||
6 6 | ||
7 6 | ||
8 6 |
16 changes: 16 additions & 0 deletions
16
framework/resources/Functional/subqueries/subquery_in_select/external_table_having_count.sql
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,16 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
COUNT(sub.position_id) as count_position_id | ||
FROM | ||
dfs.drilltestdir.`employee_json_for_subq` as sub | ||
GROUP BY sub.position_id | ||
HAVING COUNT(sub.position_id) > 5 | ||
LIMIT 1 | ||
) as count_position_id | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' | ||
LIMIT 5; |
28 changes: 28 additions & 0 deletions
28
framework/resources/Functional/subqueries/subquery_in_select/subquery_in_select.json
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,28 @@ | ||
{ | ||
"testId": "subqueries_in_select_statement", | ||
"type": "group", | ||
"description": "Testing subqueries in the SELECT statement. Initiated by DRILL-7050", | ||
"submit-type": "jdbc", | ||
"categories": [ | ||
"functional" | ||
], | ||
"matrices": [ | ||
{ | ||
"query-file": ".*.sql", | ||
"schema": "dfs.drillTestDir", | ||
"output-format": "tsv", | ||
"expected-file": ".*.e_tsv", | ||
"verification-type": [ | ||
"in-memory" | ||
] | ||
} | ||
], | ||
"datasources": [ | ||
{ | ||
"mode": "gen", | ||
"src": "Datasources/ctas/subqueries/subqueries_select.sh", | ||
"dest": "" | ||
} | ||
] | ||
} | ||
|
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_equal.e_tsv
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,5 @@ | ||
1 Sheri Nowmer | ||
5 Maya Gutierrez | ||
6 Roberta Damstra | ||
7 Rebecca Kanagaki | ||
8 Kim Brunner |
15 changes: 15 additions & 0 deletions
15
framework/resources/Functional/subqueries/subquery_in_select/where_equal.sql
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,15 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
MAX(sub.full_name) as max_full_name | ||
FROM | ||
cp.`employee.json` as sub | ||
WHERE | ||
sub.employee_id = m.employee_id | ||
) as max_full_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' | ||
LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_equal_varchar.e_tsv
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,5 @@ | ||
1 Maya Gutierrez | ||
5 Maya Gutierrez | ||
6 Maya Gutierrez | ||
7 Maya Gutierrez | ||
8 Maya Gutierrez |
15 changes: 15 additions & 0 deletions
15
framework/resources/Functional/subqueries/subquery_in_select/where_equal_varchar.sql
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,15 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
sub.full_name | ||
FROM | ||
cp.`employee.json` as sub | ||
WHERE | ||
sub.full_name = 'Maya Gutierrez' | ||
LIMIT 1 | ||
) as full_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_in_int.e_tsv
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,5 @@ | ||
1 Sheri Nowmer | ||
5 Sheri Nowmer | ||
6 Sheri Nowmer | ||
7 Sheri Nowmer | ||
8 Sheri Nowmer |
15 changes: 15 additions & 0 deletions
15
framework/resources/Functional/subqueries/subquery_in_select/where_in_int.sql
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,15 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
sub.full_name | ||
FROM | ||
cp.`employee.json` as sub | ||
WHERE | ||
sub.employee_id IN (1, 7, 5, 8) | ||
LIMIT 1 | ||
) as full_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_in_varchar.e_tsv
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,5 @@ | ||
1 Roberta Damstra | ||
5 Roberta Damstra | ||
6 Roberta Damstra | ||
7 Roberta Damstra | ||
8 Roberta Damstra |
14 changes: 14 additions & 0 deletions
14
framework/resources/Functional/subqueries/subquery_in_select/where_in_varchar.sql
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,14 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
sub.full_name | ||
FROM | ||
cp.`employee.json` as sub | ||
WHERE | ||
sub.full_name IN ('Roberta Damstra', 'Roberta Bozeman') LIMIT 1 | ||
) as full_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_less.e_tsv
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,5 @@ | ||
1 Brenda Blumberg | ||
5 Brenda Blumberg | ||
6 Brenda Blumberg | ||
7 Brenda Blumberg | ||
8 Brenda Blumberg |
14 changes: 14 additions & 0 deletions
14
framework/resources/Functional/subqueries/subquery_in_select/where_less.sql
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,14 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
MIN(sub.full_name) as min_full_name | ||
FROM | ||
cp.`employee.json` as sub | ||
WHERE | ||
sub.employee_id < 10 | ||
) as min_full_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_less_and_more.e_tsv
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,5 @@ | ||
1 Derrick Whelply | ||
5 Roberta Damstra | ||
6 null | ||
7 null | ||
8 null |
17 changes: 17 additions & 0 deletions
17
framework/resources/Functional/subqueries/subquery_in_select/where_less_and_more.sql
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,17 @@ | ||
SET `planner.enable_nljoin_for_scalar_only` = false; | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
MIN(sub.full_name) as min_full_name | ||
FROM | ||
cp.`employee.json` as sub | ||
WHERE | ||
sub.employee_id < 7 | ||
AND sub.employee_id > m.employee_id | ||
) as min_full_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; | ||
RESET `planner.enable_nljoin_for_scalar_only`; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_less_equal.e_tsv
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,5 @@ | ||
1 Derrick Whelply | ||
5 Derrick Whelply | ||
6 Derrick Whelply | ||
7 Derrick Whelply | ||
8 Derrick Whelply |
15 changes: 15 additions & 0 deletions
15
framework/resources/Functional/subqueries/subquery_in_select/where_less_equal.sql
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,15 @@ | ||
SELECT | ||
m.employee_id, | ||
( | ||
SELECT | ||
sub.full_name | ||
FROM | ||
cp.`employee.json` as sub | ||
WHERE | ||
sub.full_name <= 'Maya Gutierrez' | ||
LIMIT 1 | ||
) as full_name | ||
FROM | ||
cp.`employee.json` as m | ||
WHERE | ||
m.gender LIKE 'F' LIMIT 5; |
5 changes: 5 additions & 0 deletions
5
framework/resources/Functional/subqueries/subquery_in_select/where_less_varchar.e_tsv
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,5 @@ | ||
1 Derrick Whelply | ||
5 Derrick Whelply | ||
6 Derrick Whelply | ||
7 Derrick Whelply | ||
8 Derrick Whelply |
Oops, something went wrong.