Skip to content

Commit

Permalink
Revert "add debug logging"
Browse files Browse the repository at this point in the history
This reverts commit 0f1c3bd.
  • Loading branch information
Amogh-Bharadwaj committed Feb 9, 2024
1 parent 0f1c3bd commit 02f9143
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions flow/connectors/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,6 @@ func (c *BigQueryConnector) NormalizeRecords(req *model.NormalizeRecordsRequest)
return nil, fmt.Errorf("failed to get batch for the current mirror: %v", err)
}

// override for debugging.
batchIDs.SyncBatchID = 364
batchIDs.NormalizeBatchID = 363

hasJob, err := c.metadataHasJob(req.FlowJobName)
if err != nil {
return nil, fmt.Errorf("failed to check if job exists: %w", err)
Expand Down Expand Up @@ -615,19 +611,13 @@ func (c *BigQueryConnector) NormalizeRecords(req *model.NormalizeRecordsRequest)
for i, mergeStmt := range mergeStmts {
c.logger.Info(fmt.Sprintf("running merge statement [%d/%d] for table %s..",
i+1, len(mergeStmts), tableName), slog.String("mergeStmt", mergeStmt))
// TODO (re-enable later)
// q := c.client.Query(mergeStmt)
// _, err = q.Read(c.ctx)
// if err != nil {
// return nil, fmt.Errorf("failed to execute merge statement %s: %v", mergeStmt, err)
// }
q := c.client.Query(mergeStmt)
_, err = q.Read(c.ctx)
if err != nil {
return nil, fmt.Errorf("failed to execute merge statement %s: %v", mergeStmt, err)
}
}
}

if 1 > 0 {
return nil, fmt.Errorf("normalizeRecords will error out temporarily")
}

// update metadata to make the last normalized batch id to the recent last sync batch id.
updateMetadataStmt := fmt.Sprintf(
"UPDATE %s.%s SET normalize_batch_id=%d WHERE mirror_job_name='%s';",
Expand Down

0 comments on commit 02f9143

Please sign in to comment.