@@ -78,7 +78,7 @@ private boolean isTableMissingSchema(BigQueryException exception) {
78
78
return exception .getReason () != null && exception .getReason ().equalsIgnoreCase ("invalid" );
79
79
}
80
80
81
- private boolean isTableNotExisted (BigQueryException exception ) {
81
+ private boolean isTableNotExistedException (BigQueryException exception ) {
82
82
// If a table does not exist, it will raise a BigQueryException that the input is notFound
83
83
// Referring to Google Cloud Error Codes Doc: https://cloud.google.com/bigquery/docs/error-messages?hl=en
84
84
return exception .getReason () != null && exception .getReason ().equalsIgnoreCase ("notFound" );
@@ -109,7 +109,7 @@ && onlyContainsInvalidSchemaErrors(writeResponse.getInsertErrors()) && updateSch
109
109
}
110
110
} catch (BigQueryException exception ) {
111
111
// 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 ) {
113
113
attemptTableCreate (tableId .getBaseTableId (), topic );
114
114
} else if (isTableMissingSchema (exception ) && updateSchemas ) {
115
115
attemptSchemaUpdate (tableId , topic );
@@ -118,7 +118,7 @@ && onlyContainsInvalidSchemaErrors(writeResponse.getInsertErrors()) && updateSch
118
118
}
119
119
}
120
120
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
122
122
int attemptCount = 0 ;
123
123
while (writeResponse == null || writeResponse .hasErrors ()) {
124
124
logger .trace ("insertion failed" );
0 commit comments