Package org.apache.calcite.test
Class JdbcFrontLinqBackTest
- java.lang.Object
-
- org.apache.calcite.test.JdbcFrontLinqBackTest
-
public class JdbcFrontLinqBackTest extends java.lang.Object
Tests for a JDBC front-end (with some quite complex SQL) and Linq4j back-end (based on in-memory collections).
-
-
Constructor Summary
Constructors Constructor Description JdbcFrontLinqBackTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.sql.Connection
makeConnection()
Creates a connection with an empty modifiable table withJdbcTest.Employee
schema.static java.sql.Connection
makeConnection(java.util.List<JdbcTest.Employee> initialData)
Method to be shared withRemoteDriverTest
.private static CalciteAssert.ConnectionPostProcessor
makePostProcessor(java.util.List<JdbcTest.Employee> initialData)
Creates the post processor routine to be applied against a Connection.(package private) static JdbcTest.AbstractModifiableTable
mutable(java.lang.String tableName, java.util.List<JdbcTest.Employee> employees)
private CalciteAssert.AssertThat
mutable(java.util.List<JdbcTest.Employee> employees)
void
testDelete()
void
testExcept()
Tests EXCEPT.void
testGroupBy()
Simple GROUP BY.void
testInsert()
void
testInsert2()
void
testInsert3()
Local Statement insertvoid
testInsertBind()
void
testInsertMultipleRowMismatch()
Some of the rows have the wrong number of columns.void
testIntersect()
Tests INTERSECT.void
testJoin()
Runs a simple query that joins between two in-memory schemas.void
testOrderBy()
Simple ORDER BY.void
testPreparedStatementInsert()
Local PreparedStatement insert WITHOUT bind variablesvoid
testPreparedStatementInsert2()
Local PreparedStatement insert WITH bind variablesvoid
testSelect()
Runs a simple query that reads from a table in an in-memory schema.void
testUnion()
Tests UNION.void
testUnionAllOrderBy()
Simple UNION, plus ORDER BY.void
testWhereBad()
void
testWhereLike()
void
testWhereOr()
-
-
-
Method Detail
-
testSelect
public void testSelect()
Runs a simple query that reads from a table in an in-memory schema.
-
testJoin
public void testJoin()
Runs a simple query that joins between two in-memory schemas.
-
testGroupBy
public void testGroupBy()
Simple GROUP BY.
-
testOrderBy
public void testOrderBy()
Simple ORDER BY.
-
testUnionAllOrderBy
public void testUnionAllOrderBy()
Simple UNION, plus ORDER BY.Also tests a query that returns a single column. We optimize this case internally, using non-array representations for rows.
-
testUnion
public void testUnion()
Tests UNION.
-
testIntersect
public void testIntersect()
Tests INTERSECT.
-
testExcept
public void testExcept()
Tests EXCEPT.
-
testWhereBad
public void testWhereBad()
-
testWhereOr
public void testWhereOr()
-
testWhereLike
public void testWhereLike()
-
testInsert
public void testInsert()
-
testInsertBind
public void testInsertBind() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testDelete
public void testDelete()
-
makePostProcessor
private static CalciteAssert.ConnectionPostProcessor makePostProcessor(java.util.List<JdbcTest.Employee> initialData)
Creates the post processor routine to be applied against a Connection.Table schema is based on JdbcTest#Employee (refer to
mutable(java.util.List<org.apache.calcite.test.JdbcTest.Employee>)
).- Parameters:
initialData
- records to be presented in table- Returns:
- a connection post-processor
-
makeConnection
public static java.sql.Connection makeConnection(java.util.List<JdbcTest.Employee> initialData) throws java.lang.Exception
Method to be shared withRemoteDriverTest
.- Parameters:
initialData
- record to be presented in table- Throws:
java.lang.Exception
-
makeConnection
public static java.sql.Connection makeConnection() throws java.lang.Exception
Creates a connection with an empty modifiable table withJdbcTest.Employee
schema.- Throws:
java.lang.Exception
-
mutable
private CalciteAssert.AssertThat mutable(java.util.List<JdbcTest.Employee> employees)
-
mutable
static JdbcTest.AbstractModifiableTable mutable(java.lang.String tableName, java.util.List<JdbcTest.Employee> employees)
-
testInsert2
public void testInsert2()
-
testInsert3
public void testInsert3() throws java.lang.Exception
Local Statement insert- Throws:
java.lang.Exception
-
testPreparedStatementInsert
public void testPreparedStatementInsert() throws java.lang.Exception
Local PreparedStatement insert WITHOUT bind variables- Throws:
java.lang.Exception
-
testPreparedStatementInsert2
public void testPreparedStatementInsert2() throws java.lang.Exception
Local PreparedStatement insert WITH bind variables- Throws:
java.lang.Exception
-
testInsertMultipleRowMismatch
public void testInsertMultipleRowMismatch()
Some of the rows have the wrong number of columns.
-
-