MAPREDUCE服务 MRS-Kafka表开发规则:Kafka作为sink表时必须指定“topic”配置项

时间:2024-05-20 14:54:49

Kafka作为sink表时必须指定“topic”配置项

【示例】向Kafka的“test_sink”主题插入一条消息:

CREATE TABLE KafkaSink(
   `user_id` VARCHAR,
   `user_name` VARCHAR,
   `age` INT 
) WITH (
   'connector' = 'kafka',
   'topic' = 'test_sink',
   'properties.bootstrap.servers' = 'Kafka的Broker实例业务IP:Kafka端口号',
   'scan.startup.mode' = 'latest-offset',
   'value.format' = 'csv',
   'properties.sasl.kerberos.service.name' = 'kafka',
   'properties.security.protocol' = 'SASL_PLAINTEXT',
   'properties.kerberos.domain.name' = 'hadoop.系统 域名 ' 
);
INSERT INTO KafkaSink (`user_id`, `user_name`, `age`)VALUES ('1', 'John Smith', 35);
support.huaweicloud.com/devg-rule-mrs/mrs_07_450150.html