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

[INLONG-3815][Sort] Fix meta field sync error #4055

Merged
merged 1 commit into from
May 2, 2022
Merged
Show file tree
Hide file tree
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 @@ -76,7 +76,7 @@ public CanalJsonFormat() {
@JsonIgnore
@Override
public String getFormat() {
return "canal-json";
return "canal-json-inlong";
}

/**
Expand All @@ -89,13 +89,13 @@ public Map<String, String> generateOptions() {
Map<String, String> options = new HashMap<>(16);
options.put("format", getFormat());
if (this.ignoreParseErrors != null) {
options.put("canal-json.ignore-parse-errors", this.ignoreParseErrors.toString());
options.put("canal-json-inlong.ignore-parse-errors", this.ignoreParseErrors.toString());
}
options.put("canal-json.timestamp-format.standard", this.timestampFormatStandard);
options.put("canal-json.map-null-key.mode", this.mapNullKeyMode);
options.put("canal-json.map-null-key.literal", this.mapNullKeyLiteral);
options.put("canal-json-inlong.timestamp-format.standard", this.timestampFormatStandard);
options.put("canal-json-inlong.map-null-key.mode", this.mapNullKeyMode);
options.put("canal-json-inlong.map-null-key.literal", this.mapNullKeyLiteral);
if (this.encodeDecimalAsPlainNumber != null) {
options.put("canal-json.encode.decimal-as-plain-number", this.encodeDecimalAsPlainNumber.toString());
options.put("canal-json-inlong.encode.decimal-as-plain-number", this.encodeDecimalAsPlainNumber.toString());
}
return options;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public Map<String, String> tableOptions() {
options.putAll(format.generateOptions(true));
}
} else if (format instanceof CanalJsonFormat || format instanceof DebeziumJsonFormat) {
options.put("connector", "kafka");
options.put("connector", "kafka-inlong");
options.putAll(format.generateOptions(false));
} else {
throw new IllegalArgumentException("kafka load Node format is IllegalArgument");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,34 +628,34 @@ private String parseKafkaLoadNodeMetaField(BuiltInFieldInfo metaField) {
metaType = "STRING METADATA FROM 'value.database'";
break;
case MYSQL_METADATA_EVENT_TIME:
metaType = "TIMESTAMP(3) METADATA FROM 'value.op_ts'";
metaType = "TIMESTAMP(3) METADATA FROM 'value.event-timestamp'";
break;
case MYSQL_METADATA_EVENT_TYPE:
metaType = "STRING METADATA FROM 'value.op_type'";
metaType = "STRING METADATA FROM 'value.op-type'";
break;
case MYSQL_METADATA_DATA:
metaType = "STRING METADATA FROM 'value.data'";
break;
case MYSQL_METADATA_IS_DDL:
metaType = "BOOLEAN METADATA FROM 'value.is_ddl'";
metaType = "BOOLEAN METADATA FROM 'value.is-ddl'";
break;
case METADATA_TS:
metaType = "TIMESTAMP_LTZ(3) METADATA FROM 'value.ts'";
metaType = "TIMESTAMP_LTZ(3) METADATA FROM 'value.ingestion-timestamp'";
break;
case METADATA_SQL_TYPE:
metaType = "MAP<STRING, INT> METADATA FROM 'value.sql_type'";
metaType = "MAP<STRING, INT> METADATA FROM 'value.sql-type'";
break;
case METADATA_MYSQL_TYPE:
metaType = "MAP<STRING, STRING> METADATA FROM 'value.mysql_type'";
metaType = "MAP<STRING, STRING> METADATA FROM 'value.mysql-type'";
break;
case METADATA_PK_NAMES:
metaType = "ARRAY<STRING> METADATA FROM 'value.pk_names'";
metaType = "ARRAY<STRING> METADATA FROM 'value.pk-names'";
break;
case METADATA_BATCH_ID:
metaType = "BIGINT METADATA FROM 'value.batch_id'";
metaType = "BIGINT METADATA FROM 'value.batch-id'";
break;
case METADATA_UPDATE_BEFORE:
metaType = "ARRAY<MAP<STRING, STRING>> METADATA FROM 'value.update_before'";
metaType = "ARRAY<MAP<STRING, STRING>> METADATA FROM 'value.update-before'";
break;
default:
metaType = TableFormatUtils.deriveLogicalType(metaField.getFormatInfo()).asSummaryString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@

org.apache.inlong.sort.singletenant.flink.cdc.mysql.table.MySqlTableInlongSourceFactory
org.apache.inlong.sort.singletenant.flink.connectors.hive.table.catalog.factories.HiveTableInlongFactory
org.apache.inlong.sort.flink.kafka.KafkaDynamicTableFactory
Loading