-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EXISTS select conversion on connector level (#3493)
- Loading branch information
Showing
6 changed files
with
93 additions
and
9 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
result,dates,concept exists,concept event-date,concept event_duration_sum,concept connector event-date,concept connector event_duration_sum,concept connector first_value,concept connector sum_distinct,concept tree_label first_test_column | ||
1,"{2012-01-01/2012-01-01,2013-01-01/2013-12-31,2015-01-01/2015-01-01}",1,"{2012-01-01/2012-01-01,2013-01-01/2013-12-31,2015-01-01/2015-01-01}",367,"{2012-01-01/2012-01-01,2013-01-01/2013-12-31}",366,1.0,2.0,A1 | ||
2,"{2010-07-15/2010-07-15,2012-01-01/2012-01-02,2012-01-05/2012-01-10}",1,"{2010-07-15/2010-07-15,2012-01-01/2012-01-02,2012-01-05/2012-01-10}",9,"{2012-01-01/2012-01-02,2012-01-05/2012-01-10}",8,1.01,2.01,B2 | ||
3,"{2012-01-01/2012-01-03,2013-11-10/2013-11-10}",1,"{2012-01-01/2012-01-03,2013-11-10/2013-11-10}",4,{2012-01-01/2012-01-03},3,0.5,0.5,A1 | ||
4,"{2012-01-01/2012-01-04,2012-11-11/2012-11-11}",1,"{2012-01-01/2012-01-04,2012-11-11/2012-11-11}",5,{2012-01-01/2012-01-04},4,0.5,0.5,B2 | ||
5,{2012-01-01/2012-01-05},1,{2012-01-01/2012-01-05},5,{2012-01-01/2012-01-05},5,1.0,1.5, | ||
result,dates,concept exists,concept event-date,concept event_duration_sum,concept connector exists,concept connector event-date,concept connector event_duration_sum,concept connector first_value,concept connector sum_distinct,concept tree_label first_test_column | ||
1,"{2012-01-01/2012-01-01,2013-01-01/2013-12-31,2015-01-01/2015-01-01}",1,"{2012-01-01/2012-01-01,2013-01-01/2013-12-31,2015-01-01/2015-01-01}",367,1,"{2012-01-01/2012-01-01,2013-01-01/2013-12-31}",366,1.0,2.0,A1 | ||
2,"{2010-07-15/2010-07-15,2012-01-01/2012-01-02,2012-01-05/2012-01-10}",1,"{2010-07-15/2010-07-15,2012-01-01/2012-01-02,2012-01-05/2012-01-10}",9,1,"{2012-01-01/2012-01-02,2012-01-05/2012-01-10}",8,1.01,2.01,B2 | ||
3,"{2012-01-01/2012-01-03,2013-11-10/2013-11-10}",1,"{2012-01-01/2012-01-03,2013-11-10/2013-11-10}",4,1,{2012-01-01/2012-01-03},3,0.5,0.5,A1 | ||
4,"{2012-01-01/2012-01-04,2012-11-11/2012-11-11}",1,"{2012-01-01/2012-01-04,2012-11-11/2012-11-11}",5,1,{2012-01-01/2012-01-04},4,0.5,0.5,B2 | ||
5,{2012-01-01/2012-01-05},1,{2012-01-01/2012-01-05},5,1,{2012-01-01/2012-01-05},5,1.0,1.5, |
8 changes: 8 additions & 0 deletions
8
backend/src/test/resources/tests/sql/selects/exists/exists_on_connector/content.csv
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,8 @@ | ||
pid,datum_start,datum_end | ||
1,2014-06-30,2015-06-30 | ||
2,2014-06-30,2015-06-30 | ||
2,2014-06-30,2015-06-30 | ||
3,2014-06-30,2015-06-30 | ||
4,2014-06-30,2015-06-30 | ||
5,2014-06-30,2015-06-30 | ||
5,2014-06-30,2015-06-30 |
61 changes: 61 additions & 0 deletions
61
backend/src/test/resources/tests/sql/selects/exists/exists_on_connector/exists.spec.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,61 @@ | ||
{ | ||
"type": "QUERY_TEST", | ||
"sqlSpec": { | ||
"isEnabled": true | ||
}, | ||
"label": "EXISTS select on connector", | ||
"expectedCsv": "tests/sql/selects/exists/exists_on_connector/expected.csv", | ||
"query": { | ||
"type": "CONCEPT_QUERY", | ||
"root": { | ||
"ids": [ | ||
"concept" | ||
], | ||
"type": "CONCEPT", | ||
"tables": [ | ||
{ | ||
"id": "concept.connector", | ||
"selects": "concept.connector.exists" | ||
} | ||
] | ||
} | ||
}, | ||
"concepts": [ | ||
{ | ||
"name": "concept", | ||
"type": "TREE", | ||
"connectors": [ | ||
{ | ||
"label": "connector", | ||
"table": "exists_table", | ||
"selects": { | ||
"type": "EXISTS", | ||
"name": "exists" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"content": { | ||
"tables": [ | ||
{ | ||
"csv": "tests/sql/selects/exists/exists_on_connector/content.csv", | ||
"name": "exists_table", | ||
"primaryColumn": { | ||
"name": "pid", | ||
"type": "STRING" | ||
}, | ||
"columns": [ | ||
{ | ||
"name": "datum_start", | ||
"type": "DATE" | ||
}, | ||
{ | ||
"name": "datum_end", | ||
"type": "DATE" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
backend/src/test/resources/tests/sql/selects/exists/exists_on_connector/expected.csv
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,6 @@ | ||
result,dates,concept exists | ||
2,{},1 | ||
4,{},1 | ||
3,{},1 | ||
5,{},1 | ||
1,{},1 |