Skip to content
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

DBZ-7554 AvroConverter fails to parse events #122

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class CassandraSchemaFactory extends SchemaFactory {
/*
* Cell data schema
*/
public static final String CELL_SCHEMA_NAME = "cell_value";
public static final int CELL_SCHEMA_VERSION = 1;

/*
Expand Down Expand Up @@ -195,7 +194,7 @@ static Schema rowSchema(List<String> columnNames, List<DataType> columnsTypes) {
for (int i = 0; i < columnNames.size(); i++) {
Schema valueSchema = CassandraTypeDeserializer.getSchemaBuilder(columnsTypes.get(i)).build();
String columnName = columnNames.get(i);
Schema optionalCellSchema = CellData.cellSchema(valueSchema, true);
Schema optionalCellSchema = CellData.cellSchema(columnName, valueSchema, true);
if (optionalCellSchema != null) {
schemaBuilder.field(columnName, optionalCellSchema);
}
Expand Down Expand Up @@ -296,13 +295,13 @@ public Struct record(Schema schema) {
}
}

static Schema cellSchema(Schema columnSchema, boolean optional) {
static Schema cellSchema(String columnName, Schema columnSchema, boolean optional) {
if (columnSchema == null) {
return null;
}

SchemaBuilder schemaBuilder = SchemaBuilder.struct()
.name(CELL_SCHEMA_NAME)
.name(columnName)
.version(CELL_SCHEMA_VERSION)
.field(CELL_VALUE_KEY, columnSchema)
.field(CELL_DELETION_TS_KEY, OPTIONAL_INT64_SCHEMA)
Expand Down
Loading