Package io.trino.testing
Class BaseConnectorTest
- java.lang.Object
-
- io.trino.testing.AbstractTestQueryFramework
-
- io.trino.testing.AbstractTestQueries
-
- io.trino.testing.BaseConnectorTest
-
public abstract class BaseConnectorTest extends AbstractTestQueries
Generic test for connectors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBaseConnectorTest.DataMappingTestSetup
-
Field Summary
-
Fields inherited from class io.trino.testing.AbstractTestQueries
CUSTOM_FUNCTIONS, REQUIRED_TPCH_TABLES
-
-
Constructor Summary
Constructors Constructor Description BaseConnectorTest()
-
Method Summary
-
Methods inherited from class io.trino.testing.AbstractTestQueries
largeInValuesCount, largeInValuesCountData, testAggregationOverUnknown, testArithmeticNegation, testComplexQuery, testCountAll, testCountColumn, testDistinct, testDistinctHaving, testDistinctLimit, testDistinctMultipleFields, testDistinctWithOrderBy, testFilterPushdownWithAggregation, testIn, testInformationSchemaFiltering, testInformationSchemaUppercaseName, testLargeIn, testLimit, testLimitInInlineView, testLimitMax, testLimitWithAggregation, testPredicate, testRepeatedAggregations, testSelectWithComparison, testShowColumns, testShowSchemas, testShowSchemasFrom, testShowSchemasLike, testShowSchemasLikeWithEscape, testShowTables, testShowTablesLike, testTableSampleBernoulli, testTableSampleBernoulliBoundaryValues, testTopN, testTopNByMultipleFields
-
Methods inherited from class io.trino.testing.AbstractTestQueryFramework
assertAccessAllowed, assertAccessAllowed, assertAccessDenied, assertAccessDenied, assertExplain, assertExplain, assertExplainAnalyze, assertExplainAnalyze, assertQuery, assertQuery, assertQuery, assertQuery, assertQuery, assertQuery, assertQueryEventually, assertQueryFails, assertQueryFails, assertQueryFailsEventually, assertQueryOrdered, assertQueryOrdered, assertQueryOrdered, assertQueryOrdered, assertQueryReturnsEmptyResult, assertQueryReturnsEmptyResult, assertQueryStats, assertQuerySucceeds, assertQuerySucceeds, assertTableColumnNames, assertUpdate, assertUpdate, assertUpdate, assertUpdate, assertUpdate, assertUpdate, assertUpdate, close, closeAfterClass, computeActual, computeActual, computeExpected, computeScalar, computeScalar, createQueryRunner, executeExclusively, formatSqlText, getDistributedQueryRunner, getDynamicFilteringStats, getExplainPlan, getGraphvizExplainPlan, getNodeCount, getQualifiedTableName, getQueryRunner, getSession, init, inTransaction, newTransaction, noJoinReordering, noJoinReordering, query, query, searchScanFilterAndProjectOperatorStats, skipTestUnless
-
-
-
-
Method Detail
-
hasBehavior
protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
-
ensureTestNamingConvention
public void ensureTestNamingConvention()
- Overrides:
ensureTestNamingConventionin classAbstractTestQueryFramework
-
ensureDistributedQueryRunner
public void ensureDistributedQueryRunner()
Ensure the tests are run withDistributedQueryRunner. E.g.LocalQueryRunnertakes some shortcuts, not exercising certain aspects.
-
testShowCreateSchema
public void testShowCreateSchema()
-
testCreateSchema
public void testCreateSchema()
-
testDropNonEmptySchemaWithTable
public void testDropNonEmptySchemaWithTable()
-
testDropNonEmptySchemaWithView
public void testDropNonEmptySchemaWithView()
-
testDropNonEmptySchemaWithMaterializedView
public void testDropNonEmptySchemaWithMaterializedView()
-
testColumnsInReverseOrder
public void testColumnsInReverseOrder()
-
testCharVarcharComparison
public void testCharVarcharComparison()
-
testVarcharCharComparison
public void testVarcharCharComparison()
-
testAggregation
public void testAggregation()
-
testExactPredicate
public void testExactPredicate()
-
testInListPredicate
public void testInListPredicate()
-
testIsNullPredicate
public void testIsNullPredicate()
-
testLikePredicate
public void testLikePredicate()
-
testMultipleRangesPredicate
public void testMultipleRangesPredicate()
-
testRangePredicate
public void testRangePredicate()
-
testDateYearOfEraPredicate
public void testDateYearOfEraPredicate()
-
testPredicateReflectedInExplain
public void testPredicateReflectedInExplain()
-
testSortItemsReflectedInExplain
public void testSortItemsReflectedInExplain()
-
testConcurrentScans
public void testConcurrentScans()
-
testSelectAll
public void testSelectAll()
-
testSelectInTransaction
public void testSelectInTransaction()
-
testSelectVersionOfNonExistentTable
public void testSelectVersionOfNonExistentTable()
-
testTrySelectTableVersion
public void testTrySelectTableVersion()
A connector can support FOR TIMESTAMP, FOR VERSION, both or none. With FOR TIMESTAMP/VERSION is can support some types but not the others. Because of version support being multidimensional,TestingConnectorBehavioris not defined. The test verifies that query doesn't fail in some weird way, serving as a smoke test for versioning. The purpose of the test is to validate the connector does proper validation.
-
verifyVersionedQueryFailurePermissible
protected void verifyVersionedQueryFailurePermissible(Exception e)
-
testJoinWithEmptySides
public void testJoinWithEmptySides(OptimizerConfig.JoinDistributionType joinDistributionType)
Test interactions between optimizer (including CBO), scheduling and connector metadata APIs.
-
joinDistributionTypes
public Object[][] joinDistributionTypes()
-
testJoin
public void testJoin()
Test interactions between optimizer (including CBO) and connector metadata APIs.
-
testDescribeTable
public void testDescribeTable()
-
testView
public void testView()
-
testCreateViewSchemaNotFound
public void testCreateViewSchemaNotFound()
-
testViewCaseSensitivity
public void testViewCaseSensitivity()
-
testMaterializedView
public void testMaterializedView()
-
testCompatibleTypeChangeForView
public void testCompatibleTypeChangeForView()
-
testCompatibleTypeChangeForView2
public void testCompatibleTypeChangeForView2()
-
testViewMetadata
public void testViewMetadata(String securityClauseInCreate, String securityClauseInShowCreate)
-
testViewMetadataDataProvider
public static Object[][] testViewMetadataDataProvider()
-
testShowCreateView
public void testShowCreateView()
-
testRenameMaterializedView
public void testRenameMaterializedView()
-
testViewAndMaterializedViewTogether
public void testViewAndMaterializedViewTogether()
-
checkInformationSchemaViewsForMaterializedView
protected void checkInformationSchemaViewsForMaterializedView(String schemaName, String viewName)
-
testReadMetadataWithRelationsConcurrentModifications
public void testReadMetadataWithRelationsConcurrentModifications() throws ExceptionTest that reading table, column metadata, likeSHOW TABLESor reading frominformation_schema.viewsdoes not fail when relations are concurrently created or dropped.- Throws:
Exception
-
testReadMetadataWithRelationsConcurrentModifications
protected void testReadMetadataWithRelationsConcurrentModifications(int readIterations, int testTimeoutSeconds) throws Exception- Throws:
Exception
-
queryRepeatedly
protected Callable<Void> queryRepeatedly(int minIterations, AtomicInteger incompleteReadTasks, String sql)
Runsqlquery at leastminIterationstimes and keep running until other tasks complete.incompleteReadTasksis used for orchestrating end of execution.
-
createDropRepeatedly
protected Callable<Void> createDropRepeatedly(Runnable initReady, Supplier<Boolean> done, String namePrefix, String createTemplate, String dropTemplate)
-
submitTasks
protected <T> void submitTasks(List<Callable<T>> callables, CompletionService<T> completionService)
-
testExplainAnalyze
public void testExplainAnalyze()
-
testExplainAnalyzeVerbose
public void testExplainAnalyzeVerbose()
-
testTableSampleSystem
public void testTableSampleSystem()
-
testTableSampleWithFiltering
public void testTableSampleWithFiltering()
-
testShowCreateTable
public void testShowCreateTable()
-
testSelectInformationSchemaTables
public void testSelectInformationSchemaTables()
-
testSelectInformationSchemaColumns
public void testSelectInformationSchemaColumns()
-
testShowCreateInformationSchema
public void testShowCreateInformationSchema()
-
testShowCreateInformationSchemaTable
public void testShowCreateInformationSchemaTable()
-
testRollback
public void testRollback()
-
testWriteNotAllowedInTransaction
public void testWriteNotAllowedInTransaction()
-
assertWriteNotAllowedInTransaction
protected void assertWriteNotAllowedInTransaction(TestingConnectorBehavior behavior, String sql)
-
testRenameSchema
public void testRenameSchema()
-
testAddColumn
public void testAddColumn()
-
tableDefinitionForAddColumn
protected String tableDefinitionForAddColumn()
The table must have one column 'x' of varchar type.
-
testAddColumnWithComment
public void testAddColumnWithComment()
-
testDropColumn
public void testDropColumn()
-
testRenameColumn
public void testRenameColumn()
-
testCreateTable
public void testCreateTable()
-
testCreateTableWithTableComment
public void testCreateTableWithTableComment()
-
testCreateTableWithColumnComment
public void testCreateTableWithColumnComment()
-
testCreateTableSchemaNotFound
public void testCreateTableSchemaNotFound()
-
testCreateTableAsSelect
public void testCreateTableAsSelect()
-
testCreateTableAsSelectWithTableComment
public void testCreateTableAsSelectWithTableComment()
-
testCreateTableAsSelectSchemaNotFound
public void testCreateTableAsSelectSchemaNotFound()
-
testCreateTableAsSelectWithUnicode
public void testCreateTableAsSelectWithUnicode()
-
assertCreateTableAsSelect
protected void assertCreateTableAsSelect(String query, String rowCountQuery)
-
assertCreateTableAsSelect
protected void assertCreateTableAsSelect(String query, String expectedQuery, String rowCountQuery)
-
assertCreateTableAsSelect
protected void assertCreateTableAsSelect(Session session, String query, String expectedQuery, String rowCountQuery)
-
testCreateTableAsSelectNegativeDate
public void testCreateTableAsSelectNegativeDate()
-
errorMessageForCreateTableAsSelectNegativeDate
protected String errorMessageForCreateTableAsSelectNegativeDate(String date)
-
testRenameTableAcrossSchema
public void testRenameTableAcrossSchema() throws Exception- Throws:
Exception
-
testRenameTableToUnqualifiedPreservesSchema
public void testRenameTableToUnqualifiedPreservesSchema() throws Exception- Throws:
Exception
-
testCommentTable
public void testCommentTable()
-
getTableComment
protected String getTableComment(String catalogName, String schemaName, String tableName)
-
testCommentColumn
public void testCommentColumn()
-
testInsert
public void testInsert()
-
testInsertForDefaultColumn
public void testInsertForDefaultColumn()
-
createTableWithDefaultColumns
protected TestTable createTableWithDefaultColumns()
-
testInsertUnicode
public void testInsertUnicode()
-
testInsertHighestUnicodeCharacter
public void testInsertHighestUnicodeCharacter()
-
testInsertArray
public void testInsertArray()
-
testInsertNegativeDate
public void testInsertNegativeDate()
-
isReportingWrittenBytesSupported
protected boolean isReportingWrittenBytesSupported(Session session)
-
isReportingWrittenBytesSupported
public void isReportingWrittenBytesSupported()
-
testInsertIntoNotNullColumn
public void testInsertIntoNotNullColumn()
-
errorMessageForInsertIntoNotNullColumn
protected String errorMessageForInsertIntoNotNullColumn(String columnName)
-
testInsertInTransaction
public void testInsertInTransaction()
-
testSelectAfterInsertInTransaction
public void testSelectAfterInsertInTransaction()
-
verifySelectAfterInsertFailurePermissible
protected void verifySelectAfterInsertFailurePermissible(Throwable e)
-
testDelete
public void testDelete()
-
testDeleteWithLike
public void testDeleteWithLike()
-
testDeleteWithComplexPredicate
public void testDeleteWithComplexPredicate()
-
testDeleteWithSubquery
public void testDeleteWithSubquery()
-
testExplainAnalyzeWithDeleteWithSubquery
public void testExplainAnalyzeWithDeleteWithSubquery()
-
testDeleteWithSemiJoin
public void testDeleteWithSemiJoin()
-
testDeleteWithVarcharPredicate
public void testDeleteWithVarcharPredicate()
-
verifySupportsDeleteDeclaration
public void verifySupportsDeleteDeclaration()
-
verifySupportsRowLevelDeleteDeclaration
public void verifySupportsRowLevelDeleteDeclaration()
-
testDeleteAllDataFromTable
public void testDeleteAllDataFromTable()
-
testRowLevelDelete
public void testRowLevelDelete()
-
testUpdate
public void testUpdate()
-
testUpdateRowConcurrently
public void testUpdateRowConcurrently() throws Exception- Throws:
Exception
-
verifyConcurrentUpdateFailurePermissible
protected void verifyConcurrentUpdateFailurePermissible(Exception e)
-
testInsertRowConcurrently
public void testInsertRowConcurrently() throws Exception- Throws:
Exception
-
verifyConcurrentInsertFailurePermissible
protected void verifyConcurrentInsertFailurePermissible(Exception e)
-
testAddColumnConcurrently
public void testAddColumnConcurrently() throws Exception- Throws:
Exception
-
verifyConcurrentAddColumnFailurePermissible
protected void verifyConcurrentAddColumnFailurePermissible(Exception e)
-
testUpdateWithPredicates
public void testUpdateWithPredicates()
-
testUpdateAllValues
public void testUpdateAllValues()
-
testDropTable
public void testDropTable()
-
testDropTableIfExists
public void testDropTableIfExists()
-
testTruncateTable
public void testTruncateTable()
-
testQueryLoggingCount
public void testQueryLoggingCount()
-
tableDefinitionForQueryLoggingCount
protected String tableDefinitionForQueryLoggingCount()
The table must have two columns foo_1 and foo_2_4 of any type.
-
testShowSchemasFromOther
public void testShowSchemasFromOther()
-
testSymbolAliasing
public void testSymbolAliasing()
-
testWrittenStats
public void testWrittenStats()
-
testColumnName
public void testColumnName(String columnName)
-
testColumnName
protected void testColumnName(String columnName, boolean delimited)
-
isColumnNameRejected
protected boolean isColumnNameRejected(Exception exception, String columnName, boolean delimited)
-
requiresDelimiting
protected static boolean requiresDelimiting(String identifierName)
-
testColumnNameDataProvider
public Object[][] testColumnNameDataProvider()
-
testDataMappingSmokeTest
public void testDataMappingSmokeTest(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup)
-
testDataMappingSmokeTestDataProvider
public final Object[][] testDataMappingSmokeTestDataProvider()
-
filterDataMappingSmokeTestData
protected Optional<BaseConnectorTest.DataMappingTestSetup> filterDataMappingSmokeTestData(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup)
-
testCaseSensitiveDataMapping
public void testCaseSensitiveDataMapping(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup)
-
testCaseSensitiveDataMappingProvider
public final Object[][] testCaseSensitiveDataMappingProvider()
-
filterCaseSensitiveDataMappingTestData
protected Optional<BaseConnectorTest.DataMappingTestSetup> filterCaseSensitiveDataMappingTestData(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup)
-
testPotentialDuplicateDereferencePushdown
public void testPotentialDuplicateDereferencePushdown()
A regression test for row (struct) dereference pushdown edge case, with duplicate expressions. See https://github.com/trinodb/trino/issues/11559 and https://github.com/trinodb/trino/issues/11560.
-
testMaterializedViewColumnName
public void testMaterializedViewColumnName(String columnName)
-
assertPartialLimitWithPreSortedInputsCount
protected Consumer<Plan> assertPartialLimitWithPreSortedInputsCount(Session session, int expectedCount)
-
-