From 7eb10bcfa9360df79420a15d6ed7343180da3b3d Mon Sep 17 00:00:00 2001 From: Edward Gao Date: Thu, 7 Mar 2024 10:52:54 -0800 Subject: [PATCH] fix build --- .../SnowflakeFinalTableUpcaseMigrator.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeFinalTableUpcaseMigrator.java b/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeFinalTableUpcaseMigrator.java index be03a3fde2e7..3a8189500a95 100644 --- a/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeFinalTableUpcaseMigrator.java +++ b/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeFinalTableUpcaseMigrator.java @@ -11,7 +11,7 @@ import io.airbyte.cdk.integrations.base.TypingAndDedupingFlag; import io.airbyte.cdk.integrations.destination.jdbc.TableDefinition; import io.airbyte.integrations.base.destination.typing_deduping.DestinationHandler; -import io.airbyte.integrations.base.destination.typing_deduping.DestinationInitialState; +import io.airbyte.integrations.base.destination.typing_deduping.DestinationInitialStatus; import io.airbyte.integrations.base.destination.typing_deduping.StreamConfig; import io.airbyte.integrations.base.destination.typing_deduping.StreamId; import io.airbyte.integrations.base.destination.typing_deduping.TypeAndDedupeTransaction; @@ -47,17 +47,16 @@ public SnowflakeFinalTableUpcaseMigrator(final JdbcDatabase database, this.rawNamespace = TypingAndDedupingFlag.getRawNamespaceOverride(RAW_SCHEMA_OVERRIDE).orElse(DEFAULT_AIRBYTE_INTERNAL_NAMESPACE); } - @Override - public boolean requireMigration(@NotNull SnowflakeState state) { - return !state.getFinalTableNameUppercase(); - } - @NotNull @Override public MigrationResult migrateIfNecessary( @NotNull DestinationHandler destinationHandler, @NotNull StreamConfig streamConfig, - @NotNull DestinationInitialState state) { + @NotNull DestinationInitialStatus status) { + if (status.destinationState().getFinalTableNameUppercase()) { + + } + final StreamId caseSensitiveStreamId = buildStreamId_caseSensitive( streamConfig.id().originalNamespace(), streamConfig.id().originalName(), @@ -71,7 +70,7 @@ public MigrationResult migrateIfNecessary( } catch (SQLException e) { throw new RuntimeException(e); } - final boolean existingTableUppercaseDoesNotExist = state.isFinalTablePresent(); + final boolean existingTableUppercaseDoesNotExist = status.isFinalTablePresent(); LOGGER.info( "Checking whether upcasing migration is necessary for {}.{}. Sync mode requires migration: {}; existing case-sensitive table exists: {}; existing uppercased table does not exist: {}", streamConfig.id().originalNamespace(), @@ -96,16 +95,15 @@ public MigrationResult migrateIfNecessary( final SnowflakeState updatedState = new SnowflakeState( // We don't need to trigger a soft reset here, because we've already done it. false, - state.destinationState().getV1V2MigrationDone(), + status.destinationState().getV1V2MigrationDone(), // Update the migration status to completed - true, - state.destinationState().getExtractedAtInUtc()); + true); // Invalidate the initial state - SnowflakeDestinationHandler will now be able to find the final // tables // so we need to refetch it. return new MigrationResult<>(updatedState, true); } - return new MigrationResult<>(state.destinationState(), true); + return new MigrationResult<>(status.destinationState(), true); } // These methods were copied from