Package org.apache.calcite.test
Class InterpreterTest
- java.lang.Object
-
- org.apache.calcite.test.InterpreterTest
-
public class InterpreterTest extends java.lang.Object
Unit tests forInterpreter
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
InterpreterTest.MyDataContext
Implementation ofDataContext
for executing queries without a connection.
-
Field Summary
Fields Modifier and Type Field Description private InterpreterTest.MyDataContext
dataContext
private org.apache.calcite.tools.Planner
planner
private org.apache.calcite.schema.SchemaPlus
rootSchema
-
Constructor Summary
Constructors Constructor Description InterpreterTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
assertRows(org.apache.calcite.interpreter.Interpreter interpreter, boolean unordered, java.lang.String... rows)
private static void
assertRows(org.apache.calcite.interpreter.Interpreter interpreter, java.lang.String... rows)
private static void
assertRowsUnordered(org.apache.calcite.interpreter.Interpreter interpreter, java.lang.String... rows)
void
setUp()
void
tearDown()
void
testAggregateCount()
void
testAggregateGroup()
void
testAggregateGroupFilter()
void
testAggregateMax()
void
testAggregateMin()
void
testInterpretOrder()
Tests a plan where the sort field is projected away.void
testInterpretProjectFilterValues()
Tests executing a simple plan using an interpreter.void
testInterpretScannableTable()
Tests executing a plan on aScannableTable
using an interpreter.void
testInterpretSimpleScannableTable()
Tests executing a plan on a single-columnScannableTable
using an interpreter.void
testInterpretTable()
Tests executing a simple plan using an interpreter.void
testInterpretUnion()
Tests executing a UNION query using an interpreter.void
testInterpretUnionAll()
Tests executing a UNION ALL query using an interpreter.
-
-
-
Field Detail
-
rootSchema
private org.apache.calcite.schema.SchemaPlus rootSchema
-
planner
private org.apache.calcite.tools.Planner planner
-
dataContext
private InterpreterTest.MyDataContext dataContext
-
-
Method Detail
-
setUp
public void setUp()
-
tearDown
public void tearDown()
-
testInterpretProjectFilterValues
public void testInterpretProjectFilterValues() throws java.lang.Exception
Tests executing a simple plan using an interpreter.- Throws:
java.lang.Exception
-
testInterpretOrder
public void testInterpretOrder() throws java.lang.Exception
Tests a plan where the sort field is projected away.- Throws:
java.lang.Exception
-
assertRows
private static void assertRows(org.apache.calcite.interpreter.Interpreter interpreter, java.lang.String... rows)
-
assertRowsUnordered
private static void assertRowsUnordered(org.apache.calcite.interpreter.Interpreter interpreter, java.lang.String... rows)
-
assertRows
private static void assertRows(org.apache.calcite.interpreter.Interpreter interpreter, boolean unordered, java.lang.String... rows)
-
testInterpretTable
public void testInterpretTable() throws java.lang.Exception
Tests executing a simple plan using an interpreter.- Throws:
java.lang.Exception
-
testInterpretScannableTable
public void testInterpretScannableTable() throws java.lang.Exception
Tests executing a plan on aScannableTable
using an interpreter.- Throws:
java.lang.Exception
-
testAggregateCount
public void testAggregateCount() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testAggregateMax
public void testAggregateMax() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testAggregateMin
public void testAggregateMin() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testAggregateGroup
public void testAggregateGroup() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testAggregateGroupFilter
public void testAggregateGroupFilter() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testInterpretSimpleScannableTable
public void testInterpretSimpleScannableTable() throws java.lang.Exception
Tests executing a plan on a single-columnScannableTable
using an interpreter.- Throws:
java.lang.Exception
-
testInterpretUnionAll
public void testInterpretUnionAll() throws java.lang.Exception
Tests executing a UNION ALL query using an interpreter.- Throws:
java.lang.Exception
-
testInterpretUnion
public void testInterpretUnion() throws java.lang.Exception
Tests executing a UNION query using an interpreter.- Throws:
java.lang.Exception
-
-