Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRILL-2962: Enhance scalar check to recurse below single-input rels. …
…Bump up Calcite version to 1.1.0-drill-r3. Enable TPCH q11 and remove the q11_1 version. Add new test class for correlated subqueries (more tests will be added later).
- Loading branch information
Aman Sinha
committed
May 6, 2015
1 parent
3b19076
commit e58696a
Showing
5 changed files
with
56 additions
and
40 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
40 changes: 40 additions & 0 deletions
40
exec/java-exec/src/test/java/org/apache/drill/TestCorrelation.java
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
/** | |||
* 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. | |||
*/ | |||
package org.apache.drill; | |||
|
|||
import org.junit.Test; | |||
|
|||
public class TestCorrelation extends PlanTestBase { | |||
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestCorrelation.class); | |||
|
|||
@Test // DRILL-2962 | |||
public void testScalarAggCorrelatedSubquery() throws Exception { | |||
String query = "select count(*) as cnt from cp.`tpch/nation.parquet` n1 " | |||
+ " where n1.n_nationkey > (select avg(n2.n_regionkey) * 4 from cp.`tpch/nation.parquet` n2 " | |||
+ " where n1.n_regionkey = n2.n_nationkey)"; | |||
|
|||
testBuilder() | |||
.sqlQuery(query) | |||
.ordered() | |||
.baselineColumns("cnt") | |||
.baselineValues((long) 17) | |||
.build() | |||
.run(); | |||
} | |||
|
|||
} |
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.
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