Class BaseConnectorTest


  • public abstract class BaseConnectorTest
    extends AbstractTestQueries
    Generic test for connectors.
    • Constructor Detail

      • BaseConnectorTest

        public BaseConnectorTest()
    • Method Detail

      • ensureDistributedQueryRunner

        public void ensureDistributedQueryRunner()
        Ensure the tests are run with DistributedQueryRunner. E.g. LocalQueryRunner takes 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, TestingConnectorBehavior is 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 Exception
        Test that reading table, column metadata, like SHOW TABLES or reading from information_schema.views does 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)
        Run sql query at least minIterations times and keep running until other tasks complete. incompleteReadTasks is used for orchestrating end of execution.
      • 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()
      • 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()
      • testCommentColumn

        public void testCommentColumn()
      • getColumnComment

        protected String getColumnComment​(String tableName,
                                          String columnName)
      • 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()
      • errorMessageForInsertNegativeDate

        protected String errorMessageForInsertNegativeDate​(String date)
      • 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()
      • filterColumnNameTestData

        protected Optional<String> filterColumnNameTestData​(String columnName)
      • dataMappingTableName

        protected String dataMappingTableName​(String trinoTypeName)
      • testDataMappingSmokeTestDataProvider

        public final Object[][] testDataMappingSmokeTestDataProvider()
      • testCaseSensitiveDataMappingProvider

        public final Object[][] testCaseSensitiveDataMappingProvider()
      • 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)
      • createSchemaSql

        protected String createSchemaSql​(String schemaName)