Package org.apache.calcite.test
Class ScannableTableTest
- java.lang.Object
-
- org.apache.calcite.test.ScannableTableTest
-
public class ScannableTableTest extends java.lang.Object
Unit test forScannableTable
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScannableTableTest.BeatlesFilterableTable
Table that returns two columns via theFilterableTable
interface.static class
ScannableTableTest.BeatlesProjectableFilterableTable
Table that returns two columns via theFilterableTable
interface.static class
ScannableTableTest.BeatlesTable
Table that returns two columns via the ScannableTable interface.static class
ScannableTableTest.SimpleTable
Table that returns one column via theScannableTable
interface.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Object[][]
BEATLES
-
Constructor Summary
Constructors Constructor Description ScannableTableTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static org.apache.calcite.linq4j.Enumerator<java.lang.Object[]>
beatles(java.lang.StringBuilder buf, java.lang.Integer filter, int[] projects)
private static java.lang.Integer
getFilter(boolean cooperative, java.util.List<org.apache.calcite.rex.RexNode> filters)
protected CalciteAssert.ConnectionPostProcessor
newSchema(java.lang.String schemaName, java.lang.String tableName, org.apache.calcite.schema.Table table)
private static org.apache.calcite.linq4j.Enumerator<java.lang.Object[]>
tens()
void
testCannotPushProject()
void
testFilterableTableCooperative()
A filter on aFilterableTable
with two columns (cooperative).void
testFilterableTableNonCooperative()
A filter on aFilterableTable
with two columns (noncooperative).void
testPFPushDownProjectFilterAggregateGroup()
void
testPFPushDownProjectFilterAggregateNested()
void
testPFPushDownProjectFilterInAggregateNoGroup()
void
testPFTableRefusesFilterCooperative()
A filter and project on aProjectableFilterableTable
.void
testPFTableRefusesFilterSingleColumn()
void
testPrepared2()
void
testProjectableFilterableCooperative()
A filter on aProjectableFilterableTable
with two columns (cooperative).void
testProjectableFilterableNonCooperative()
void
testProjectableFilterableWithProjectAndFilter()
A filter on aProjectableFilterableTable
with two columns, and a project in the query.void
testProjectableFilterableWithProjectFilterNonCooperative()
A filter on aProjectableFilterableTable
with two columns, and a project in the query (NonCooperative).void
testSimple()
A table with one column.void
testSimple2()
A table with two columns.void
testTens()
-
-
-
Method Detail
-
testTens
public void testTens() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
testSimple
public void testSimple() throws java.lang.Exception
A table with one column.- Throws:
java.lang.Exception
-
testSimple2
public void testSimple2() throws java.lang.Exception
A table with two columns.- Throws:
java.lang.Exception
-
testFilterableTableCooperative
public void testFilterableTableCooperative() throws java.lang.Exception
A filter on aFilterableTable
with two columns (cooperative).- Throws:
java.lang.Exception
-
testFilterableTableNonCooperative
public void testFilterableTableNonCooperative() throws java.lang.Exception
A filter on aFilterableTable
with two columns (noncooperative).- Throws:
java.lang.Exception
-
testProjectableFilterableCooperative
public void testProjectableFilterableCooperative() throws java.lang.Exception
A filter on aProjectableFilterableTable
with two columns (cooperative).- Throws:
java.lang.Exception
-
testProjectableFilterableNonCooperative
public void testProjectableFilterableNonCooperative() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testProjectableFilterableWithProjectAndFilter
public void testProjectableFilterableWithProjectAndFilter() throws java.lang.Exception
A filter on aProjectableFilterableTable
with two columns, and a project in the query. (Cooperative)- Throws:
java.lang.Exception
-
testProjectableFilterableWithProjectFilterNonCooperative
public void testProjectableFilterableWithProjectFilterNonCooperative() throws java.lang.Exception
A filter on aProjectableFilterableTable
with two columns, and a project in the query (NonCooperative).- Throws:
java.lang.Exception
-
testPFTableRefusesFilterCooperative
public void testPFTableRefusesFilterCooperative() throws java.lang.Exception
A filter and project on aProjectableFilterableTable
. The table refuses to execute the filter, so Calcite should add a pull up and transform the filter (projecting the column needed by the filter).- Throws:
java.lang.Exception
-
testPFPushDownProjectFilterInAggregateNoGroup
public void testPFPushDownProjectFilterInAggregateNoGroup()
-
testPFPushDownProjectFilterAggregateGroup
public void testPFPushDownProjectFilterAggregateGroup()
-
testPFPushDownProjectFilterAggregateNested
public void testPFPushDownProjectFilterAggregateNested()
-
getFilter
private static java.lang.Integer getFilter(boolean cooperative, java.util.List<org.apache.calcite.rex.RexNode> filters)
-
testPFTableRefusesFilterSingleColumn
public void testPFTableRefusesFilterSingleColumn() throws java.lang.Exception
Test case for [CALCITE-458] ArrayIndexOutOfBoundsException when using just a single column in interpreter.- Throws:
java.lang.Exception
-
testCannotPushProject
public void testCannotPushProject() throws java.lang.Exception
Test case for [CALCITE-2039] AssertionError when pushing project to ProjectableFilterableTable. Cannot push down a project if it is not a permutation of columns; in this case, it contains a literal.- Throws:
java.lang.Exception
-
testPrepared2
public void testPrepared2() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
newSchema
protected CalciteAssert.ConnectionPostProcessor newSchema(java.lang.String schemaName, java.lang.String tableName, org.apache.calcite.schema.Table table)
-
tens
private static org.apache.calcite.linq4j.Enumerator<java.lang.Object[]> tens()
-
beatles
private static org.apache.calcite.linq4j.Enumerator<java.lang.Object[]> beatles(java.lang.StringBuilder buf, java.lang.Integer filter, int[] projects)
-
-