Skip to content

Commit ce77de0

Browse files
committed
fix compilation post rebase
1 parent 7c68992 commit ce77de0

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

airbyte-integrations/connectors/destination-bigquery/src/main/java/io/airbyte/integrations/destination/bigquery/BigQueryDestination.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private SerializedAirbyteMessageConsumer getStandardRecordConsumer(final BigQuer
374374
return new BigQueryRecordStandardConsumer(
375375
outputRecordCollector,
376376
() -> {
377-
typerDeduper.prepareSchemasAndRawTables();
377+
typerDeduper.prepareSchemasAndRunMigrations();
378378

379379
// Set up our raw tables
380380
writeConfigs.get().forEach((streamId, uploader) -> {

airbyte-integrations/connectors/destination-bigquery/src/main/java/io/airbyte/integrations/destination/bigquery/BigQueryStagingConsumerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private OnStartFunction onStartFunction(final BigQueryStagingOperations bigQuery
135135
final TyperDeduper typerDeduper) {
136136
return () -> {
137137
LOGGER.info("Preparing airbyte_raw tables in destination started for {} streams", writeConfigs.size());
138-
typerDeduper.prepareSchemasAndRawTables();
138+
typerDeduper.prepareSchemasAndRunMigrations();
139139

140140
for (final BigQueryWriteConfig writeConfig : writeConfigs.values()) {
141141
LOGGER.info("Preparing staging are in destination for schema: {}, stream: {}, target table: {}, stage: {}",

airbyte-integrations/connectors/destination-bigquery/src/main/java/io/airbyte/integrations/destination/bigquery/typing_deduping/BigQueryDestinationHandler.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@
3636
import io.airbyte.integrations.base.destination.typing_deduping.AlterTableReport;
3737
import io.airbyte.integrations.base.destination.typing_deduping.ColumnId;
3838
import io.airbyte.integrations.base.destination.typing_deduping.DestinationHandler;
39-
import io.airbyte.integrations.base.destination.typing_deduping.DestinationInitialState;
40-
import io.airbyte.integrations.base.destination.typing_deduping.InitialRawTableState;
39+
import io.airbyte.integrations.base.destination.typing_deduping.DestinationInitialStatus;
40+
import io.airbyte.integrations.base.destination.typing_deduping.InitialRawTableStatus;
4141
import io.airbyte.integrations.base.destination.typing_deduping.Sql;
4242
import io.airbyte.integrations.base.destination.typing_deduping.StreamConfig;
4343
import io.airbyte.integrations.base.destination.typing_deduping.StreamId;
4444
import io.airbyte.integrations.base.destination.typing_deduping.TableNotMigratedException;
4545
import io.airbyte.integrations.base.destination.typing_deduping.migrators.MinimumDestinationState;
46+
import io.airbyte.integrations.base.destination.typing_deduping.migrators.MinimumDestinationState.Impl;
4647
import java.math.BigInteger;
4748
import java.util.ArrayList;
4849
import java.util.Collection;
@@ -82,11 +83,11 @@ public boolean isFinalTableEmpty(final StreamId id) {
8283
return BigInteger.ZERO.equals(bq.getTable(TableId.of(id.finalNamespace(), id.finalName())).getNumRows());
8384
}
8485

85-
public InitialRawTableState getInitialRawTableState(final StreamId id) throws Exception {
86+
public InitialRawTableStatus getInitialRawTableState(final StreamId id) throws Exception {
8687
final Table rawTable = bq.getTable(TableId.of(id.rawNamespace(), id.rawName()));
8788
if (rawTable == null) {
8889
// Table doesn't exist. There are no unprocessed records, and no timestamp.
89-
return new InitialRawTableState(false, false, Optional.empty());
90+
return new InitialRawTableStatus(false, false, Optional.empty());
9091
}
9192

9293
final FieldValue unloadedRecordTimestamp = bq.query(QueryJobConfiguration.newBuilder(new StringSubstitutor(Map.of(
@@ -102,7 +103,7 @@ SELECT TIMESTAMP_SUB(MIN(_airbyte_extracted_at), INTERVAL 1 MICROSECOND)
102103
// If it's not null, then we can return immediately - we've found some unprocessed records and their
103104
// timestamp.
104105
if (!unloadedRecordTimestamp.isNull()) {
105-
return new InitialRawTableState(true, true, Optional.of(unloadedRecordTimestamp.getTimestampInstant()));
106+
return new InitialRawTableStatus(true, true, Optional.of(unloadedRecordTimestamp.getTimestampInstant()));
106107
}
107108

108109
final FieldValue loadedRecordTimestamp = bq.query(QueryJobConfiguration.newBuilder(new StringSubstitutor(Map.of(
@@ -116,10 +117,10 @@ SELECT MAX(_airbyte_extracted_at)
116117
// So we just need to get the timestamp of the most recent record.
117118
if (loadedRecordTimestamp.isNull()) {
118119
// Null timestamp because the table is empty. T+D can process the entire raw table during this sync.
119-
return new InitialRawTableState(true, false, Optional.empty());
120+
return new InitialRawTableStatus(true, false, Optional.empty());
120121
} else {
121122
// The raw table already has some records. T+D can skip all records with timestamp <= this value.
122-
return new InitialRawTableState(true, false, Optional.of(loadedRecordTimestamp.getTimestampInstant()));
123+
return new InitialRawTableStatus(true, false, Optional.of(loadedRecordTimestamp.getTimestampInstant()));
123124
}
124125
}
125126

@@ -191,18 +192,18 @@ public void execute(final Sql sql) throws InterruptedException {
191192
}
192193

193194
@Override
194-
public List<DestinationInitialState<MinimumDestinationState.Impl>> gatherInitialState(List<StreamConfig> streamConfigs) throws Exception {
195-
final List<DestinationInitialState<MinimumDestinationState.Impl>> initialStates = new ArrayList<>();
195+
public List<DestinationInitialStatus<Impl>> gatherInitialState(List<StreamConfig> streamConfigs) throws Exception {
196+
final List<DestinationInitialStatus<MinimumDestinationState.Impl>> initialStates = new ArrayList<>();
196197
for (final StreamConfig streamConfig : streamConfigs) {
197198
final StreamId id = streamConfig.id();
198199
final Optional<TableDefinition> finalTable = findExistingTable(id);
199-
final InitialRawTableState rawTableState = getInitialRawTableState(id);
200-
initialStates.add(new DestinationInitialState<>(
200+
final InitialRawTableStatus rawTableState = getInitialRawTableState(id);
201+
initialStates.add(new DestinationInitialStatus<>(
201202
streamConfig,
202203
finalTable.isPresent(),
203204
rawTableState,
204205
finalTable.isPresent() && !existingSchemaMatchesStreamConfig(streamConfig, finalTable.get()),
205-
!finalTable.isPresent() || isFinalTableEmpty(id),
206+
finalTable.isEmpty() || isFinalTableEmpty(id),
206207
// Return a default state blob since we don't actually track state.
207208
new MinimumDestinationState.Impl(false)));
208209
}

0 commit comments

Comments
 (0)