-
Notifications
You must be signed in to change notification settings - Fork 56
Added support of writing union {string, bytes} to string #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v1.3.3 | ||
| v1.3.4 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -246,13 +246,27 @@ protected boolean validateDataSchema(Table table, Record record, boolean onlyFie | |||||
| case "Enum8": | ||||||
| case "Enum16": | ||||||
| break;//I notice we just break here, rather than actually validate the type | ||||||
| case "STRING": { | ||||||
| if (dataTypeName.equals("BYTES")) { | ||||||
| continue; | ||||||
| } else if (obj.getFieldType().equals(Schema.Type.STRUCT)) { | ||||||
| for (Field field : objSchema.fields()) { | ||||||
| if (!(field.schema().type().equals(Schema.Type.STRING) || field.schema().type().equals(Schema.Type.BYTES))) { | ||||||
| validSchema = false; | ||||||
| break; | ||||||
| } | ||||||
| } | ||||||
| if (!validSchema) { | ||||||
| LOGGER.error(String.format("Cannot write field of union schema '%s' to column [%s] of `String`: only unions of `string` and `bytes` are allowed in this case", | ||||||
| objSchema.schema().fields(), colName)); | ||||||
|
||||||
| objSchema.schema().fields(), colName)); | |
| objSchema.fields(), colName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if it is primitive type it will have empty field.
Uh oh!
There was an error while loading. Please reload this page.