Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug logs for updated schema in BigQueryIO #28189

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ PendingJobManager addPendingJob(
}

void waitForDone() throws Exception {
LOG.info("Waiting for jobs to complete.");
LOG.debug("Waiting for BigQuery jobs to complete.");
Sleeper sleeper = Sleeper.DEFAULT;
while (!pendingJobs.isEmpty()) {
List<JobInfo> retryJobs = Lists.newArrayList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,13 @@ SchemaAndDescriptor getCurrentTableSchema(String stream, @Nullable TableSchema u
WriteStream writeStream =
Preconditions.checkStateNotNull(maybeDatasetService).getWriteStream(streamName);
if (writeStream != null && writeStream.hasTableSchema()) {
currentSchema.set(writeStream.getTableSchema());
TableSchema updatedFromStream = writeStream.getTableSchema();
currentSchema.set(updatedFromStream);
updated.set(true);
LOG.debug(
"Updated currentSchema according to stream {}: {}",
streamName,
updatedFromStream);
Abacn marked this conversation as resolved.
Show resolved Hide resolved
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ public void process(
newSchema.get(), appendClientInfo.get().getCloseAppendClient(), false));
APPEND_CLIENTS.invalidate(element.getKey());
APPEND_CLIENTS.put(element.getKey(), appendClientInfo.get());
LOG.debug("Updated schema for table {}: {}", tableId, updatedSchemaReturned);
updatedSchema.write(newSchema.get());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public void processElement(
if (firstPaneCreateDisposition == CreateDisposition.CREATE_NEVER) {
tableSchema = null;
} else if (jsonSchemas.containsKey(destination)) {
// tableSchema for the destination stored in cache (jsonSchemas)
tableSchema =
BigQueryHelpers.fromJsonString(jsonSchemas.get(destination), TableSchema.class);
} else {
Expand All @@ -215,6 +216,7 @@ public void processElement(
firstPaneCreateDisposition,
dynamicDestinations,
destination);
LOG.debug("Use TableSchema for {}: {}", destination, tableSchema);
Abacn marked this conversation as resolved.
Show resolved Hide resolved
jsonSchemas.put(destination, BigQueryHelpers.toJsonString(tableSchema));
}

Expand Down
Loading