Package io.trino.testing
Class BaseConnectorTest
java.lang.Object
io.trino.testing.AbstractTestQueryFramework
io.trino.testing.AbstractTestQueries
io.trino.testing.BaseConnectorTest
Generic test for connectors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final class -
Field Summary
Fields inherited from class io.trino.testing.AbstractTestQueries
CUSTOM_FUNCTIONS, REQUIRED_TPCH_TABLES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertCreateTableAsSelect(Session session, String query, String expectedQuery, String rowCountQuery) protected voidassertCreateTableAsSelect(String query, String rowCountQuery) protected voidassertCreateTableAsSelect(String query, String expectedQuery, String rowCountQuery) assertPartialLimitWithPreSortedInputsCount(Session session, int expectedCount) protected voidassertWriteNotAllowedInTransaction(TestingConnectorBehavior behavior, String sql) protected voidcheckInformationSchemaViewsForMaterializedView(String schemaName, String viewName) protected booleancolumnIsNullable(String tableName, String columnName) createDropRepeatedly(Runnable initReady, Supplier<Boolean> done, String namePrefix, String createTemplate, String dropTemplate) protected StringcreateSchemaSql(String schemaName) protected StringcreateTableForWrites(String createTable) protected Stringprotected TestTableprotected TestTablecreateTableWithOneIntegerColumn(String namePrefix) protected StringdataMappingTableName(String trinoTypeName) voidEnsure the tests are run withDistributedQueryRunner.voidprotected Stringprotected StringerrorMessageForInsertIntoNotNullColumn(String columnName) protected Stringprotected Optional<BaseConnectorTest.DataMappingTestSetup>filterCaseSensitiveDataMappingTestData(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup) filterColumnNameTestData(String columnName) protected Optional<BaseConnectorTest.DataMappingTestSetup>filterDataMappingSmokeTestData(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup) protected StringgetColumnComment(String tableName, String columnName) protected StringgetTableComment(String catalogName, String schemaName, String tableName) protected booleanhasBehavior(TestingConnectorBehavior connectorBehavior) protected booleanisColumnNameRejected(Exception exception, String columnName, boolean delimited) voidprotected booleanisReportingWrittenBytesSupported(Session session) Object[][]protected OptionalIntprotected OptionalIntqueryRepeatedly(int minIterations, AtomicInteger incompleteReadTasks, String sql) Runsqlquery at leastminIterationstimes and keep running until other tasks complete.protected static booleanrequiresDelimiting(String identifierName) protected <T> voidsubmitTasks(List<Callable<T>> callables, CompletionService<T> completionService) protected StringThe table must have one column 'x' of varchar type.protected StringThe table must have two columns foo_1 and foo_2_4 of any type.voidvoidvoidvoidvoidvoidtestCaseSensitiveDataMapping(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup) final Object[][]voidvoidtestColumnName(String columnName) protected voidtestColumnName(String columnName, boolean delimited) Object[][]voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestDataMappingSmokeTest(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup) final Object[][]voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestJoin()Test interactions between optimizer (including CBO) and connector metadata APIs.voidtestJoinWithEmptySides(OptimizerConfig.JoinDistributionType joinDistributionType) Test interactions between optimizer (including CBO), scheduling and connector metadata APIs.voidvoidvoidtestMaterializedViewColumnName(String columnName) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidA regression test for row (struct) dereference pushdown edge case, with duplicate expressions.voidvoidvoidvoidTest that reading table, column metadata, likeSHOW TABLESor reading frominformation_schema.viewsdoes not fail when relations are concurrently created or dropped.protected voidtestReadMetadataWithRelationsConcurrentModifications(int readIterations, int testTimeoutSeconds) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidA connector can support FOR TIMESTAMP, FOR VERSION, both or none.voidvoidvoidvoidvoidvoidtestView()voidvoidvoidtestViewMetadata(String securityClauseInCreate, String securityClauseInShowCreate) static Object[][]voidvoidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidvoidvoidprotected voidprotected voidMethods 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, testTopNByMultipleFieldsMethods 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
-
Constructor Details
-
BaseConnectorTest
public BaseConnectorTest()
-
-
Method Details
-
hasBehavior
-
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
-
testJoinWithEmptySides
Test interactions between optimizer (including CBO), scheduling and connector metadata APIs. -
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
-
testViewMetadataDataProvider
-
testShowCreateView
public void testShowCreateView() -
testRenameMaterializedView
public void testRenameMaterializedView() -
testViewAndMaterializedViewTogether
public void testViewAndMaterializedViewTogether() -
checkInformationSchemaViewsForMaterializedView
-
testReadMetadataWithRelationsConcurrentModifications
Test 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
-
createTableSqlTemplateForConcurrentModifications
-
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
-
submitTasks
-
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
-
testRenameSchema
public void testRenameSchema() -
testAddColumn
public void testAddColumn() -
tableDefinitionForAddColumn
The table must have one column 'x' of varchar type. -
testAddColumnWithComment
public void testAddColumnWithComment() -
testAddNotNullColumnToNonEmptyTable
public void testAddNotNullColumnToNonEmptyTable() -
columnIsNullable
-
verifyAddNotNullColumnToNonEmptyTableFailurePermissible
-
testDropColumn
public void testDropColumn() -
testRenameColumn
public void testRenameColumn() -
testCreateTable
public void testCreateTable() -
testCreateSchemaWithLongName
public void testCreateSchemaWithLongName() -
testRenameSchemaToLongName
public void testRenameSchemaToLongName() -
maxSchemaNameLength
-
verifySchemaNameLengthFailurePermissible
-
testCreateTableWithLongTableName
public void testCreateTableWithLongTableName() -
testRenameTableToLongTableName
public void testRenameTableToLongTableName() -
maxTableNameLength
-
verifyTableNameLengthFailurePermissible
-
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
-
assertCreateTableAsSelect
-
assertCreateTableAsSelect
-
testCreateTableAsSelectNegativeDate
public void testCreateTableAsSelectNegativeDate() -
errorMessageForCreateTableAsSelectNegativeDate
-
testRenameTable
- Throws:
Exception
-
testRenameTableAcrossSchema
- Throws:
Exception
-
testRenameTableToUnqualifiedPreservesSchema
- Throws:
Exception
-
testCommentTable
public void testCommentTable() -
getTableComment
-
testCommentView
public void testCommentView() -
testCommentColumn
public void testCommentColumn() -
getColumnComment
-
testInsert
public void testInsert() -
testInsertForDefaultColumn
public void testInsertForDefaultColumn() -
createTableWithDefaultColumns
-
testInsertUnicode
public void testInsertUnicode() -
testInsertHighestUnicodeCharacter
public void testInsertHighestUnicodeCharacter() -
testInsertArray
public void testInsertArray() -
testInsertNegativeDate
public void testInsertNegativeDate() -
errorMessageForInsertNegativeDate
-
isReportingWrittenBytesSupported
-
isReportingWrittenBytesSupported
public void isReportingWrittenBytesSupported() -
testInsertIntoNotNullColumn
public void testInsertIntoNotNullColumn() -
errorMessageForInsertIntoNotNullColumn
-
testInsertInTransaction
public void testInsertInTransaction() -
testSelectAfterInsertInTransaction
public void testSelectAfterInsertInTransaction() -
verifySelectAfterInsertFailurePermissible
-
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
- Throws:
Exception
-
verifyConcurrentUpdateFailurePermissible
-
testInsertRowConcurrently
- Throws:
Exception
-
verifyConcurrentInsertFailurePermissible
-
testAddColumnConcurrently
- Throws:
Exception
-
verifyConcurrentAddColumnFailurePermissible
-
createTableWithOneIntegerColumn
-
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
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
-
testColumnName
-
isColumnNameRejected
-
requiresDelimiting
-
testColumnNameDataProvider
-
filterColumnNameTestData
-
dataMappingTableName
-
testDataMappingSmokeTest
-
testDataMappingSmokeTestDataProvider
-
filterDataMappingSmokeTestData
protected Optional<BaseConnectorTest.DataMappingTestSetup> filterDataMappingSmokeTestData(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup) -
testCaseSensitiveDataMapping
public void testCaseSensitiveDataMapping(BaseConnectorTest.DataMappingTestSetup dataMappingTestSetup) -
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. -
createTableForWrites
-
testMergeLarge
public void testMergeLarge() -
testMergeSimpleSelect
public void testMergeSimpleSelect() -
testMergeFruits
public void testMergeFruits() -
testMergeMultipleOperations
public void testMergeMultipleOperations() -
testMergeSimpleQuery
public void testMergeSimpleQuery() -
testMergeAllInserts
public void testMergeAllInserts() -
testMergeAllColumnsUpdated
public void testMergeAllColumnsUpdated() -
testMergeAllMatchesDeleted
public void testMergeAllMatchesDeleted() -
testMergeMultipleRowsMatchFails
public void testMergeMultipleRowsMatchFails() -
testMergeQueryWithStrangeCapitalization
public void testMergeQueryWithStrangeCapitalization() -
testMergeWithoutTablesAliases
public void testMergeWithoutTablesAliases() -
testMergeWithUnpredictablePredicates
public void testMergeWithUnpredictablePredicates() -
testMergeWithSimplifiedUnpredictablePredicates
public void testMergeWithSimplifiedUnpredictablePredicates() -
testMergeCasts
public void testMergeCasts() -
testMergeSubqueries
public void testMergeSubqueries() -
testMergeNonNullableColumns
public void testMergeNonNullableColumns() -
testMaterializedViewColumnName
-
assertPartialLimitWithPreSortedInputsCount
-
createSchemaSql
-