CREATE TABLE sensor_data_table
(
timestamp
timestamp(6) NULL DEFAULT NULL,
name
char(13) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
chid
char(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
lotid
char(15) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
ppid
char(15) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
recipeid
char(15) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
chstep
char(15) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
stepseq
char(13) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
partid
char(15) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
status
char(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
slotno
tinyint(4) DEFAULT NULL,
sensor
char(28) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
value
double DEFAULT NULL,
lcl
double DEFAULT NULL,
ucl
double DEFAULT NULL,
inserttime
timestamp(6) NULL DEFAULT CURRENT_TIMESTAMP(6),
/*!90618 SHARD / KEY name
(name
, sensor
),
KEY inserttime
(inserttime
) /!90619 USING CLUSTERED COLUMNSTORE /
) /!90623 AUTOSTATS_CARDINALITY_MODE=INCREMENTAL, AUTOSTATS_HISTOGRAM_MODE=CREATE, AUTOSTATS_SAMPLING=ON / /!90623 SQL_MODE=‘STRICT_ALL_TABLES’ */;
CREATE PIPELINE quickstart_kafka10 AS LOAD DATA KAFKA ‘$p_kafka_ip/$p_kafka_topic’
BATCH_INTERVAL 1
MAX_PARTITIONS_PER_BATCH 192
INTO TABLE sensor_data_table
(timestamp, name, chid, lotid, ppid, recipeid, chstep, stepseq, partid, status, slotno, sensor, value, lcl, ucl)
FIELDS TERMINATED BY ‘,’
LINES TERMINATED BY ‘\n’;
sample data
2020-01-09 12:19:49.826,eq79941_0001,c1,z7qq,lzlry375kt_2h5v,luvv4n62vt36j,7s3m,w7s7xn5e,fsiainu6u7a3,run,1,kafkaExample.Sensor@73eabe71,3.9998652935028076,2.430484934435185,6.580886940578097
2020-01-09 12:19:49.826,eq79941_0001,c1,z7qq,lzlry375kt_2h5v,luvv4n62vt36j,7s3m,w7s7xn5e,fsiainu6u7a3,run,1,kafkaExample.Sensor@23f02a7d,226.59170532226562,150.84780190109996,306.62161731255765
Thanks you.