KSQL Stream无法反序列化数据,并且出现错误,找不到Subject。错误代码:40401“。需要解决此问题的建议。 另一方面,KSQL的“打印”语句正在从主题读取数据。
从一个主题的Avro模式注册表中读取数据,并将计划转换为JSON转换器,还计划将多个流中的数据合并到一个1主题中。
在我看来,注册表URL正在运行,因为print语句能够转换此avro数据。但是流不能。
SET 'ksql.streams.auto.offset.reset'='earliest';
CREATE STREAM bi_xxx
(before VARCHAR,
after VARCHAR,
source VARCHAR,
op VARCHAR,
ts_ms BIGINT,
source_system VARCHAR)
WITH (KAFKA_TOPIC='xxx',VALUE_FORMAT='AVRO');
select * bi_xxx;
[2019-10-02 04:49:34,744] ERROR {"type":0,"deserializationError":{"errorMessage":"Failed to deserialize data for topic
cdc.warp.warpdelivery.vehicle to Avro: ","recordB64":null,"cause":["Error retrieving Avro schema for id 393","Subject not found.;
error code: 40401"]},"recordProcessingError":null,"productionError":null} (processing.5627749518661920590.KsqlTopic.source.deserializer:44)
Modified the data in schema.
-----
`ksql> print 'xxx' from beginning limit 1;
Format:AVRO
9/13/19 8:27:07 PM UTC,
��v, {"before": {"aaa": 11, "bb": "222"}, "after": {"aa": 9999, "bb": "0000"}, "source": {"version": "0.10.0.Beta4", "connector": "sqlserver", "name": "xxxx", "ts_ms": 1568289310747, "snapshot": "false", "db": "xxx", "schema": "aa", "table": "bbb", "change_lsn": "0015f091:00000f8c:0002", "commit_lsn": "0015f091:00000f8c:0014"}, "op": "u", "ts_ms": 1568406427129, "source_system": "xxx"}
ksql> describe extended BI_xxx;
Name : BI_xxx
Type : STREAM
Key field :
Key format : STRING
Timestamp field : Not set - using <ROWTIME>
Value format : AVRO
Kafka topic : xxx (partitions: 6, replication: 3)
Field | Type
-------------------------------------------
ROWTIME | BIGINT (system)
ROWKEY | VARCHAR(STRING) (system)
BEFORE | VARCHAR(STRING)
AFTER | VARCHAR(STRING)
SOURCE | VARCHAR(STRING)
OP | VARCHAR(STRING)
TS_MS | BIGINT
SOURCE_SYSTEM | VARCHAR(STRING)
-------------------------------------------
Local runtime statistics
------------------------
consumer-messages-per-sec: 0 consumer-total-bytes: 276 consumer-total-messages: 1 last-message: 2019-10-02T18:16:38.765Z
consumer-failed-messages: 1 consumer-failed-messages-per-sec: 0 last-failed: 2019-10-02T18:16:38.796Z