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 Apr 4, 2023
1 parent 8eda934 commit ede37e8
Show file tree
Hide file tree
Showing 9 changed files with 816 additions and 411 deletions.
Expand Up @@ -243,8 +243,8 @@ public String getStreamName() {
}

/**
* This exception is thrown from {@link JsonStreamWriter#append()} when the client side Json to
* Proto serializtion fails. It can also be thrown by the server in case rows contains invalid
* This exception is thrown from {@link SchemaAwareStreamWriter#append()} when the client side
* Proto serialization 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 @@ -363,15 +363,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 SchemaAwareStreamWriter. User can either turn
* on IgnoreUnknownFields option on the SchemaAwareStreamWriter, or if they don't want the error to be
* ignored, they should recreate the SchemaAwareStreamWriter 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("The source object has fields unknown to BigQuery: %s.", jsonFieldName));
this.jsonFieldName = jsonFieldName;
}

Expand Down

0 comments on commit ede37e8

Please sign in to comment.