Skip to content

Commit

Permalink
feat: add schema aware stream writer
Browse files Browse the repository at this point in the history
  • Loading branch information
arturowczarek committed Mar 20, 2023
1 parent c94517b commit b2c069c
Show file tree
Hide file tree
Showing 7 changed files with 792 additions and 288 deletions.
Expand Up @@ -216,7 +216,7 @@ public static StorageException toStorageException(Throwable exception) {
}

/**
* This exception is thrown from {@link JsonStreamWriter#append()} when the client side Json to
* This exception is thrown from {@link SchemaAwareStreamWriter#append()} when the client side Json to
* Proto serializtion fails. It can also be thrown by the server in case rows contains invalid
* data. The exception contains a Map of indexes of faulty rows and the corresponding error
* message.
Expand Down Expand Up @@ -348,15 +348,15 @@ protected InflightBytesLimitExceededException(String writerId, long currentLimit
}
}
/**
* Input Json data has unknown field to the schema of the JsonStreamWriter. User can either turn
* on IgnoreUnknownFields option on the JsonStreamWriter, or if they don't want the error to be
* ignored, they should recreate the JsonStreamWriter with the updated table schema.
* Input data object has unknown field to the schema of the CustomStreamWriter. User can either turn
* on IgnoreUnknownFields option on the CustomStreamWriter, or if they don't want the error to be
* ignored, they should recreate the CustomStreamWriter with the updated table schema.
*/
public static final class JsonDataHasUnknownFieldException extends IllegalArgumentException {
public static final class DataHasUnknownFieldException extends IllegalArgumentException {
private final String jsonFieldName;

protected JsonDataHasUnknownFieldException(String jsonFieldName) {
super(String.format("JSONObject has fields unknown to BigQuery: %s.", jsonFieldName));
public DataHasUnknownFieldException(String jsonFieldName) {
super(String.format("Source object has fields unknown to BigQuery: %s.", jsonFieldName));
this.jsonFieldName = jsonFieldName;
}

Expand Down

0 comments on commit b2c069c

Please sign in to comment.