summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db.sql18
-rw-r--r--components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db_data.sql46
2 files changed, 32 insertions, 32 deletions
diff --git a/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db.sql b/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db.sql
index 9b391d0f..34e4ece8 100644
--- a/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db.sql
+++ b/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db.sql
@@ -32,7 +32,7 @@ CREATE TABLE db_type (
id varchar(255) NOT NULL,
default_port int DEFAULT NULL,
name varchar(255) NOT NULL,
- tool bit(1) NOT NULL,
+ tool boolean NOT NULL,
PRIMARY KEY (id)
);
CREATE SEQUENCE db_seq;
@@ -40,8 +40,8 @@ CREATE SEQUENCE db_seq;
CREATE TABLE db (
id int NOT NULL DEFAULT NEXTVAL ('db_seq'),
database_name varchar(255) DEFAULT NULL,
- enabled bit(1) NOT NULL,
- encrypt bit(1) DEFAULT NULL,
+ enabled boolean NOT NULL,
+ encrypt boolean DEFAULT NULL,
host varchar(255) DEFAULT NULL,
login varchar(255) DEFAULT NULL,
name varchar(255) DEFAULT NULL,
@@ -74,7 +74,7 @@ CREATE TABLE design (
body text DEFAULT NULL,
name varchar(255) DEFAULT NULL,
note varchar(255) DEFAULT NULL,
- submitted bit(1) DEFAULT NULL,
+ submitted boolean DEFAULT NULL,
design_type_id varchar(255) NOT NULL,
topic_name_id varchar(255) NOT NULL,
PRIMARY KEY (id),
@@ -90,14 +90,14 @@ CREATE TABLE kafka (
id int NOT NULL DEFAULT NEXTVAL ('kafka_seq'),
broker_list varchar(255) NOT NULL,
consumer_count int DEFAULT 3,
- enabled bit(1) NOT NULL,
+ enabled boolean NOT NULL,
excluded_topic varchar(1023) DEFAULT '__consumer_offsets,__transaction_state',
"group" varchar(255) DEFAULT 'datalake',
included_topic varchar(255) DEFAULT NULL,
login varchar(255) DEFAULT NULL,
name varchar(255) NOT NULL,
pass varchar(255) DEFAULT NULL,
- secure bit(1) DEFAULT b'0',
+ secure boolean DEFAULT FALSE,
security_protocol varchar(255) DEFAULT NULL,
timeout_sec int DEFAULT 10,
zk varchar(255) NOT NULL,
@@ -108,14 +108,14 @@ CREATE SEQUENCE topic_seq;
CREATE TABLE topic (
id int NOT NULL DEFAULT NEXTVAL ('topic_seq'),
aggregate_array_path varchar(255) DEFAULT NULL,
- correlate_cleared_message bit(1) NOT NULL DEFAULT b'0',
+ correlate_cleared_message boolean NOT NULL DEFAULT FALSE,
data_format varchar(255) DEFAULT NULL,
- enabled bit(1) NOT NULL,
+ enabled boolean NOT NULL,
flatten_array_path varchar(255) DEFAULT NULL,
login varchar(255) DEFAULT NULL,
message_id_path varchar(255) DEFAULT NULL,
pass varchar(255) DEFAULT NULL,
- save_raw bit(1) NOT NULL DEFAULT b'0',
+ save_raw boolean NOT NULL DEFAULT FALSE,
ttl_day int DEFAULT NULL,
topic_name_id varchar(255) NOT NULL,
PRIMARY KEY (id),
diff --git a/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db_data.sql b/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db_data.sql
index 0e80e088..7defefdc 100644
--- a/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db_data.sql
+++ b/components/datalake-handler/des/src/assembly/init_db/db_scripts/init_db_data.sql
@@ -38,59 +38,59 @@ INSERT INTO kafka(
1
,'main Kafka cluster' -- name - IN varchar (255)
,3 -- consumer_count - IN int(11)
- ,B'1' -- enabled - IN bit(1)
+ ,true -- enabled - IN bit(1)
,'dlgroup' -- group - IN varchar(255)
,'message-router-kafka:9092' -- host_port - IN varchar(255)
,'' -- included_topic - IN varchar(255)
,'admin' -- login - IN varchar(255)
,'admin-secret' -- pass - IN varchar(255)
- ,B'0' -- secure - IN bit(1)
+ ,false -- secure - IN bit(1)
,'SASL_PLAINTEXT' -- security_protocol - IN varchar(255)
,10 -- timeout_sec - IN int(11)
,'message-router-zookeeper:2181' -- zk - IN varchar(255)
);
-insert into db_type (id, name, tool) values ('CB', 'Couchbase', B'0');
-insert into db_type (id, name, tool) values ('ES', 'Elasticsearch', B'0');
-insert into db_type (id, name, tool,default_port) values ('MONGO', 'MongoDB', B'0', 27017);
-insert into db_type (id, name, tool) values ('DRUID', 'Druid', B'0');
-insert into db_type (id, name, tool) values ('HDFS', 'HDFS', B'0');
-insert into db_type (id, name, tool) values ('KIBANA', 'Kibana', B'1');
-insert into db_type (id, name, tool) values ('SUPERSET', 'Apache Superset', B'1');
-insert into db (id, db_type_id, enabled, encrypt, name,host,login,pass,database_name) values (1, 'CB', B'1', B'1', 'Couchbase 1','dl-couchbase','dl','dl1234','datalake');
-insert into db (id, db_type_id, enabled, encrypt, name,host) values (2, 'ES', B'1', B'1', 'Elasticsearch','dl-es');
-insert into db (id, db_type_id, enabled, encrypt, name,host,port,database_name,presto_catalog) values (3, 'MONGO', B'1', B'1', 'MongoDB 1','dl-mongodb',27017,'datalake','mongodb');
-insert into db (id, db_type_id, enabled, encrypt, name,host) values (4, 'DRUID', B'1',B'1', 'Druid','dl-druid');
-insert into db (id, db_type_id, enabled, encrypt, name,host,login) values (5, 'HDFS', B'1', B'1', 'Hadoop Cluster','dl-hdfs','dl');
-insert into db (id, db_type_id, enabled, encrypt, name,host) values (6, 'KIBANA', B'1', B'0', 'Kibana demo','dl-es');
-insert into db (id, db_type_id, enabled, encrypt, name,host) values (7, 'SUPERSET', B'1', B'0', 'Superset demo','dl-druid');
+insert into db_type (id, name, tool) values ('CB', 'Couchbase', false);
+insert into db_type (id, name, tool) values ('ES', 'Elasticsearch', false);
+insert into db_type (id, name, tool,default_port) values ('MONGO', 'MongoDB', false, 27017);
+insert into db_type (id, name, tool) values ('DRUID', 'Druid', false);
+insert into db_type (id, name, tool) values ('HDFS', 'HDFS', false);
+insert into db_type (id, name, tool) values ('KIBANA', 'Kibana', true);
+insert into db_type (id, name, tool) values ('SUPERSET', 'Apache Superset', true);
+insert into db (id, db_type_id, enabled, encrypt, name,host,login,pass,database_name) values (1, 'CB', true, true, 'Couchbase 1','dl-couchbase','dl','dl1234','datalake');
+insert into db (id, db_type_id, enabled, encrypt, name,host) values (2, 'ES', true, true, 'Elasticsearch','dl-es');
+insert into db (id, db_type_id, enabled, encrypt, name,host,port,database_name,presto_catalog) values (3, 'MONGO', true, true, 'MongoDB 1','dl-mongodb',27017,'datalake','mongodb');
+insert into db (id, db_type_id, enabled, encrypt, name,host) values (4, 'DRUID', true,true, 'Druid','dl-druid');
+insert into db (id, db_type_id, enabled, encrypt, name,host,login) values (5, 'HDFS', true, true, 'Hadoop Cluster','dl-hdfs','dl');
+insert into db (id, db_type_id, enabled, encrypt, name,host) values (6, 'KIBANA', true, false, 'Kibana demo','dl-es');
+insert into db (id, db_type_id, enabled, encrypt, name,host) values (7, 'SUPERSET', true, false, 'Superset demo','dl-druid');
insert into topic_name (id) values ('_DL_DEFAULT_');
insert into topic_name (id) values ('unauthenticated.SEC_FAULT_OUTPUT');
insert into topic_name (id) values ('unauthenticated.VES_MEASUREMENT_OUTPUT');
insert into topic_name (id) values ('EPC');
insert into topic_name (id) values ('HW');
-- in production, default enabled should be off
-insert into topic(id, topic_name_id,enabled,save_raw,ttl_day,data_format) values (1, '_DL_DEFAULT_',B'1',B'0',3650,'JSON');
+insert into topic(id, topic_name_id,enabled,save_raw,ttl_day,data_format) values (1, '_DL_DEFAULT_',true,false,3650,'JSON');
insert into topic(id, topic_name_id,correlate_cleared_message,enabled, message_id_path,data_format)
-values (2, 'unauthenticated.SEC_FAULT_OUTPUT',B'1',B'1','/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName,/event/faultFields/specificProblem,/event/commonEventHeader/eventId','JSON');
+values (2, 'unauthenticated.SEC_FAULT_OUTPUT',true,true,'/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName,/event/faultFields/specificProblem,/event/commonEventHeader/eventId','JSON');
insert into topic(id, topic_name_id,enabled, aggregate_array_path,flatten_array_path,data_format)
-values (3, 'unauthenticated.VES_MEASUREMENT_OUTPUT',B'1',
+values (3, 'unauthenticated.VES_MEASUREMENT_OUTPUT',true,
'/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray',
'/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface',
'JSON');
insert into topic(id, topic_name_id,enabled, flatten_array_path,data_format)
-values (4, 'EPC',B'1', '/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface', 'JSON');
+values (4, 'EPC',true, '/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface', 'JSON');
insert into topic(id, topic_name_id,enabled, aggregate_array_path,data_format)
-values (5, 'HW',B'1',
+values (5, 'HW',true,
'/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray',
'JSON');
-insert into map_db_topic(db_id,topic_id) select db.id, topic.id from db_type, db, topic where db.db_type_id=db_type.id and db_type.tool=B'0';
+insert into map_db_topic(db_id,topic_id) select db.id, topic.id from db_type, db, topic where db.db_type_id=db_type.id and db_type.tool=false;
insert into map_kafka_topic(kafka_id,topic_id) select kafka.id, topic.id from kafka, topic;
insert into design_type (id, name, db_type_id) values ('KIBANA_DB', 'Kibana Dashboard', 'KIBANA');
insert into design_type (id, name, db_type_id) values ('KIBANA_SEARCH', 'Kibana Search', 'KIBANA');
insert into design_type (id, name, db_type_id) values ('KIBANA_VISUAL', 'Kibana Visualization', 'KIBANA');
insert into design_type (id, name, db_type_id) values ('ES_MAPPING', 'Elasticsearch Field Mapping Template', 'ES');
insert into design_type (id, name, db_type_id) values ('DRUID_KAFKA_SPEC', 'Druid Kafka Indexing Service Supervisor Spec', 'DRUID');
-insert into design (id, name,topic_name_id, submitted,body, design_type_id) values (1, 'Kibana Dashboard on EPC test1', 'EPC', B'0', 'body here', 'KIBANA_DB');
+insert into design (id, name,topic_name_id, submitted,body, design_type_id) values (1, 'Kibana Dashboard on EPC test1', 'EPC',false, 'body here', 'KIBANA_DB');
insert into map_db_design (design_id,db_id ) values (1, 6);
insert into data_exposure(id,note,sql_template,db_id) values ('totalBandwidth','KPI bandwidth history','select from_unixtime(commonEventHeader.lastEpochMicrosec/1000) as timeStamp, sum(measurementFields.additionalFields."UPF.N3IncPkt._Dnn"+measurementFields.additionalFields."UPF.N3OgPkt._Dnn") as bandwidth from upf where commonEventHeader.sourceId = ''${id}'' and ( from_unixtime(commonEventHeader.lastEpochMicrosec/1000) between from_iso8601_timestamp( ''${timeStamp}'') - interval ''${hour}'' hour and from_iso8601_timestamp( ''${timeStamp}'') ) group by commonEventHeader.lastEpochMicrosec order by commonEventHeader.lastEpochMicrosec desc ',3);
insert into data_exposure(id,note,sql_template,db_id) values ('totalTraffic','KPI sum over history','select commonEventHeader.sourceId as id, sum(measurementFields.additionalFields."UPF.N3IncPkt._Dnn"+measurementFields.additionalFields."UPF.N3OgPkt._Dnn") as totalTraffic from upf where commonEventHeader.sourceId = ''${id}'' and from_unixtime(commonEventHeader.lastEpochMicrosec/1000) <= from_iso8601_timestamp( ''${timeStamp}'') ',3);