You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Robin Moffatt (JIRA)" <ji...@apache.org> on 2018/06/13 09:06:00 UTC
[jira] [Commented] (KAFKA-7052) ExtractField SMT throws NPE - needs
clearer error message
[ https://issues.apache.org/jira/browse/KAFKA-7052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16510814#comment-16510814 ]
Robin Moffatt commented on KAFKA-7052:
--------------------------------------
Tested on Debezium 0.8 (AK 1.1.0) and Debezium 0.7.4 (AK 1.0.0) docker images.
Connector:
{code:java}
curl -i -X POST -H "Accept:application/json" \
-H "Content-Type:application/json" http://localhost:8083/connectors/ \
-d '{
"name": "mysql-source-demo-customers-raw",
"config": {
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"database.hostname": "mysql",
"database.port": "3306",
"database.user": "debezium",
"database.password": "dbz",
"database.server.id": "43",
"database.server.name": "asgard",
"table.whitelist": "demo.customers",
"database.history.kafka.bootstrap.servers": "kafka:29092",
"database.history.kafka.topic": "dbhistory.demo-raw" ,
"include.schema.changes": "true",
"transforms": "ExtractId",
"transforms.ExtractId.type":"org.apache.kafka.connect.transforms.ExtractField$Key",
"transforms.ExtractId.field":"id" }
}'{code}
Source schema + data in MySQL:
{code:java}
create table CUSTOMERS (
id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(50),
gender VARCHAR(50),
club_status VARCHAR(8),
comments VARCHAR(90),
create_ts timestamp DEFAULT CURRENT_TIMESTAMP ,
update_ts timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
insert into CUSTOMERS (id, first_name, last_name, email, gender, club_status, comments) values (1, 'Rica', 'Blaisdell', 'rblaisdell0@rambler.ru', 'Female', 'bronze', 'Universal optimal hierarchy');
{code}
> ExtractField SMT throws NPE - needs clearer error message
> ---------------------------------------------------------
>
> Key: KAFKA-7052
> URL: https://issues.apache.org/jira/browse/KAFKA-7052
> Project: Kafka
> Issue Type: Improvement
> Components: KafkaConnect
> Reporter: Robin Moffatt
> Priority: Major
>
> With the following Single Message Transform:
> {code:java}
> "transforms.ExtractId.type":"org.apache.kafka.connect.transforms.ExtractField$Key",
> "transforms.ExtractId.field":"id"{code}
> Kafka Connect errors with :
> {code:java}
> java.lang.NullPointerException
> at org.apache.kafka.connect.transforms.ExtractField.apply(ExtractField.java:61)
> at org.apache.kafka.connect.runtime.TransformationChain.apply(TransformationChain.java:38){code}
> There should be a better error message here, identifying the reason for the NPE.
> Version: Confluent Platform 4.1.1
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)