@Test @DisplayName("Override type info from data dictionary") public void overrideTypeInfoFromDataDictionary( final TestContext testContext, final Connection connection) throws Exception { final int magicNumber = 99; final InformationSchemaViews informationSchemaViews = InformationSchemaViewsBuilder.builder() .withSql( InformationSchemaKey.TYPE_INFO, String.format( "SELECT %d AS INJECTED_TEST_ATTRIBUTE, TYPE_INFO.* " + "FROM INFORMATION_SCHEMA.SYSTEM_TYPEINFO TYPE_INFO", magicNumber)) .toOptions(); final SchemaRetrievalOptionsBuilder schemaRetrievalOptionsBuilder = SchemaRetrievalOptionsBuilder.builder() .with(typeInfoRetrievalStrategy, data_dictionary_all) .withInformationSchemaViews(informationSchemaViews); final SchemaRetrievalOptions schemaRetrievalOptions = schemaRetrievalOptionsBuilder.toOptions(); final RetrieverConnection retrieverConnection = new RetrieverConnection(connection, schemaRetrievalOptions); final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions(); final DataTypeRetriever dataTypeRetriever = new DataTypeRetriever(retrieverConnection, catalog, options); dataTypeRetriever.retrieveSystemColumnDataTypes(); verifyRetrieveColumnDataTypes(catalog, testContext.testMethodFullName()); }
void retrieveSystemColumnDataTypes() throws SQLException { final Schema systemSchema = new SchemaReference(); switch (getRetrieverConnection().get(typeInfoRetrievalStrategy)) { case data_dictionary_all: LOGGER.log( Level.INFO, "Retrieving system column data types, using fast data dictionary retrieval"); retrieveSystemColumnDataTypesFromDataDictionary(systemSchema); break; case metadata: LOGGER.log(Level.INFO, "Retrieving system column data types"); retrieveSystemColumnDataTypesFromMetadata(systemSchema); break; default: break; } }
DataTypeRetriever extends AbstractRetriever { void retrieveSystemColumnDataTypes() throws SQLException { final Schema systemSchema = new SchemaReference(); switch (getRetrieverConnection().get(typeInfoRetrievalStrategy)) { case data_dictionary_all: LOGGER.log( Level.INFO, "Retrieving system column data types, using fast data dictionary retrieval"); retrieveSystemColumnDataTypesFromDataDictionary(systemSchema); break; case metadata: LOGGER.log(Level.INFO, "Retrieving system column data types"); retrieveSystemColumnDataTypesFromMetadata(systemSchema); break; default: break; } } }
DataTypeRetriever extends AbstractRetriever { void retrieveSystemColumnDataTypes() throws SQLException { final Schema systemSchema = new SchemaReference(); switch (getRetrieverConnection().get(typeInfoRetrievalStrategy)) { case data_dictionary_all: LOGGER.log( Level.INFO, "Retrieving system column data types, using fast data dictionary retrieval"); retrieveSystemColumnDataTypesFromDataDictionary(systemSchema); break; case metadata: LOGGER.log(Level.INFO, "Retrieving system column data types"); retrieveSystemColumnDataTypesFromMetadata(systemSchema); break; default: break; } } DataTypeRetriever(
      final RetrieverConnection retrieverConnection,
      final MutableCatalog catalog,
      final SchemaCrawlerOptions options); }
DataTypeRetriever extends AbstractRetriever { void retrieveSystemColumnDataTypes() throws SQLException { final Schema systemSchema = new SchemaReference(); switch (getRetrieverConnection().get(typeInfoRetrievalStrategy)) { case data_dictionary_all: LOGGER.log( Level.INFO, "Retrieving system column data types, using fast data dictionary retrieval"); retrieveSystemColumnDataTypesFromDataDictionary(systemSchema); break; case metadata: LOGGER.log(Level.INFO, "Retrieving system column data types"); retrieveSystemColumnDataTypesFromMetadata(systemSchema); break; default: break; } } DataTypeRetriever(
      final RetrieverConnection retrieverConnection,
      final MutableCatalog catalog,
      final SchemaCrawlerOptions options);  }
DataTypeRetriever extends AbstractRetriever { void retrieveSystemColumnDataTypes() throws SQLException { final Schema systemSchema = new SchemaReference(); switch (getRetrieverConnection().get(typeInfoRetrievalStrategy)) { case data_dictionary_all: LOGGER.log( Level.INFO, "Retrieving system column data types, using fast data dictionary retrieval"); retrieveSystemColumnDataTypesFromDataDictionary(systemSchema); break; case metadata: LOGGER.log(Level.INFO, "Retrieving system column data types"); retrieveSystemColumnDataTypesFromMetadata(systemSchema); break; default: break; } } DataTypeRetriever(
      final RetrieverConnection retrieverConnection,
      final MutableCatalog catalog,
      final SchemaCrawlerOptions options);   }