Skip to content

Commit c612f69

Browse files
author
Bingqin Zhou
committed
Update function name and comments.
1 parent 0b2ffec commit c612f69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kcbq-connector/src/main/java/com/wepay/kafka/connect/bigquery/write/row/AdaptiveBigQueryWriter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private boolean isTableMissingSchema(BigQueryException exception) {
7878
return exception.getReason() != null && exception.getReason().equalsIgnoreCase("invalid");
7979
}
8080

81-
private boolean isTableNotExisted(BigQueryException exception) {
81+
private boolean isTableNotExistedException(BigQueryException exception) {
8282
// If a table does not exist, it will raise a BigQueryException that the input is notFound
8383
// Referring to Google Cloud Error Codes Doc: https://cloud.google.com/bigquery/docs/error-messages?hl=en
8484
return exception.getReason() != null && exception.getReason().equalsIgnoreCase("notFound");
@@ -109,7 +109,7 @@ && onlyContainsInvalidSchemaErrors(writeResponse.getInsertErrors()) && updateSch
109109
}
110110
} catch (BigQueryException exception) {
111111
// Should only perform one table creation attempt.
112-
if (isTableNotExisted(exception) && autoCreateTables && bigQuery.getTable(tableId.getBaseTableId()) == null) {
112+
if (isTableNotExistedException(exception) && autoCreateTables && bigQuery.getTable(tableId.getBaseTableId()) == null) {
113113
attemptTableCreate(tableId.getBaseTableId(), topic);
114114
} else if (isTableMissingSchema(exception) && updateSchemas) {
115115
attemptSchemaUpdate(tableId, topic);
@@ -118,7 +118,7 @@ && onlyContainsInvalidSchemaErrors(writeResponse.getInsertErrors()) && updateSch
118118
}
119119
}
120120

121-
// Schema update might be delayed, so multiple insertion attempts may be necessary
121+
// Schema update or table creation might be delayed, so multiple insertion attempts may be necessary
122122
int attemptCount = 0;
123123
while (writeResponse == null || writeResponse.hasErrors()) {
124124
logger.trace("insertion failed");

0 commit comments

Comments
 (0)