unable to insert or upsert data from kafka topic to kudu table using lenses kudu sink connector - apache-kafka-connect

lenses kudu sink connector version = kafka-connect-kudu-1.2.3-2.1.0
kudu table schema
CREATE TABLE IF NOT EXISTS table_name(
su_id bigint not null,
su_tenant_id int null,
su_bu_id int null,
su_user_type string null,
su_acpd_id int null,
su_user_code string null,
su_user_title string null,
su_first_name string not null,
su_middle_name string null,
su_last_name string null,
su_dob timestamp null,
su_doj timestamp null,
su_primary_position_id bigint null,
su_role_id int null,
su_masterdataref string null,
su_primary_address bigint null,
su_mobile_no string null,
su_email_id string null,
su_photo string null,
su_isactive boolean not null,
su_created_by bigint not null,
su_created_timestamp timestamp not null,
su_modified_by bigint null,
su_modified_timestamp timestamp null,
su_status string null,
flex_1 string null,
flex_2 string null,
flex_3 string null,
flex_4 string null,
flex_5 string null,
flex_6 string null,
flex_7 string null,
flex_8 string null,
flex_9 string null,
su_gender string null,
su_theme_id int null,
su_activated_timestamp timestamp not null,
su_deactivated_timestamp timestamp null,
su_level_id smallint null,
su_hierarchy_type string null,
su_user_type_id int null,
su_adh_id int null,
su_user_classification int null,
su_credit_limit decimal(18, 4) null,
su_culture_alov_id int null,
su_culture_al_id smallint null,
su_profile_image_file string null,
su_terms_isagree boolean not null,
su_terms_agreed_timestamp timestamp null,
primary key(su_id)
)
PARTITION BY HASH (su_id) PARTITIONS 3
STORED AS KUDU;
Kafka topics data with key.converter.schemas.enable = false,value.converter.schemas.enable = false,
{
"su_id": 1,
"su_tenant_id": 0,
"su_bu_id": 0,
"su_user_type": "A",
"su_acpd_id": null,
"su_user_code": "sampletest",
"su_user_title": null,
"su_first_name": "test_data",
"su_middle_name": null,
"su_last_name": "",
"su_dob": null,
"su_doj": null,
"su_primary_position_id": null,
"su_role_id": 1,
"su_masterdataref": "0",
"su_primary_address": null,
"su_mobile_no": null,
"su_email_id": null,
"su_photo": null,
"su_isactive": true,
"su_created_by": 1,
"su_created_date": 1526324248760,
"su_modified_by": 1,
"su_modified_date": 1547137351267,
"su_status": "I",
"flex_1": null,
"flex_2": null,
"flex_3": null,
"flex_4": null,
"flex_5": null,
"flex_6": null,
"flex_7": null,
"flex_8": null,
"flex_9": null,
"su_gender": null,
"su_theme_id": 406,
"su_activated_date": 1526324248760,
"su_deactivated_date": null,
"su_level_id": null,
"su_hierarchy_type": null,
"su_user_type_id": null,
"su_adh_id": null,
"su_user_classification": null,
"su_credit_limit": null,
"su_culture_alov_id": null,
"su_culture_al_id": null,
"su_profile_image_file": null,
"su_terms_isagree": false,
"su_terms_agreed_date": null
}
kudu sink connector config:
config:1
{
"name": "snk_test",
"config": {
"connector.class": "com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkConnector",
"topics": "mssql.dbo.table_name",
"connect.kudu.schema.registry.url": "http://localhost:8081",
"connect.kudu.master": "*.*.*.*:7051",
"connect.kudu.kcql": "upsert into impala::test_db.table_name select * from mssql.dbo.table_name AUTOCREATE DISTRIBUTEBY su_id INTO 3 BUCKETS AUTOEVOLVE"}
}
config:2
{
"name": "snk_test",
"config": {
"connector.class": "com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkConnector",
"topics": "mssql.dbo.table_name",
"connect.kudu.schema.registry.url": "http://localhost:8081",
"connect.kudu.master": "*.*.*.*:7051",
"connect.kudu.kcql": "upsert into impala::test_db.table_name select * from mssql.dbo.table_name "}
}
with both this config I am getting the below error
org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handler\n\tat
org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)\n\tat
org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.convertAndTransformRecord(WorkerSinkTask.java:484)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:464)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:320)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:224)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:192)\n\tat
org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)\n\tat
org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)\n\tat
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat
java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat
java.lang.Thread.run(Thread.java:748)\nCaused by:
org.apache.kafka.connect.errors.DataException: JsonConverter with
schemas.enable requires \"schema\" and \"payload\" fields and may not
contain additional fields. If you are trying to deserialize plain JSON
data, set schemas.enable=false in your converter configuration.\n\tat
org.apache.kafka.connect.json.JsonConverter.toConnectData(JsonConverter.java:348)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.lambda$convertAndTransformRecord$0(WorkerSinkTask.java:484)\n\tat
org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)\n\tat
org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)\n\t...
13 more\n
Kafka topics with key.converter.schemas.enable = true,value.converter.schemas.enable = true,
{
"schema": {
"type": "struct",
"fields": [
{
"type": "int64",
"optional": false,
"field": "su_id"
},
{
"type": "int32",
"optional": true,
"field": "su_tenant_id"
},
{
"type": "int32",
"optional": true,
"field": "su_bu_id"
},
{
"type": "string",
"optional": true,
"field": "su_user_type"
},
{
"type": "int32",
"optional": true,
"field": "su_acpd_id"
},
{
"type": "string",
"optional": true,
"field": "su_user_code"
},
{
"type": "string",
"optional": true,
"field": "su_user_title"
},
{
"type": "string",
"optional": false,
"field": "su_first_name"
},
{
"type": "string",
"optional": true,
"field": "su_middle_name"
},
{
"type": "string",
"optional": true,
"field": "su_last_name"
},
{
"type": "int32",
"optional": true,
"name": "io.debezium.time.Date",
"version": 1,
"field": "su_dob"
},
{
"type": "int32",
"optional": true,
"name": "io.debezium.time.Date",
"version": 1,
"field": "su_doj"
},
{
"type": "int64",
"optional": true,
"field": "su_primary_position_id"
},
{
"type": "int32",
"optional": true,
"field": "su_role_id"
},
{
"type": "string",
"optional": true,
"field": "su_masterdataref"
},
{
"type": "int64",
"optional": true,
"field": "su_primary_address"
},
{
"type": "string",
"optional": true,
"field": "su_mobile_no"
},
{
"type": "string",
"optional": true,
"field": "su_email_id"
},
{
"type": "string",
"optional": true,
"field": "su_photo"
},
{
"type": "boolean",
"optional": false,
"field": "su_isactive"
},
{
"type": "int64",
"optional": false,
"field": "su_created_by"
},
{
"type": "int64",
"optional": false,
"name": "io.debezium.time.Timestamp",
"version": 1,
"field": "su_created_date"
},
{
"type": "int64",
"optional": true,
"field": "su_modified_by"
},
{
"type": "int64",
"optional": true,
"name": "io.debezium.time.Timestamp",
"version": 1,
"field": "su_modified_date"
},
{
"type": "string",
"optional": true,
"field": "su_status"
},
{
"type": "string",
"optional": true,
"field": "flex_1"
},
{
"type": "string",
"optional": true,
"field": "flex_2"
},
{
"type": "string",
"optional": true,
"field": "flex_3"
},
{
"type": "string",
"optional": true,
"field": "flex_4"
},
{
"type": "string",
"optional": true,
"field": "flex_5"
},
{
"type": "string",
"optional": true,
"field": "flex_6"
},
{
"type": "string",
"optional": true,
"field": "flex_7"
},
{
"type": "string",
"optional": true,
"field": "flex_8"
},
{
"type": "string",
"optional": true,
"field": "flex_9"
},
{
"type": "string",
"optional": true,
"field": "su_gender"
},
{
"type": "int32",
"optional": true,
"field": "su_theme_id"
},
{
"type": "int64",
"optional": false,
"name": "io.debezium.time.Timestamp",
"version": 1,
"field": "su_activated_date"
},
{
"type": "int64",
"optional": true,
"name": "io.debezium.time.Timestamp",
"version": 1,
"field": "su_deactivated_date"
},
{
"type": "int16",
"optional": true,
"field": "su_level_id"
},
{
"type": "string",
"optional": true,
"field": "su_hierarchy_type"
},
{
"type": "int32",
"optional": true,
"field": "su_user_type_id"
},
{
"type": "int32",
"optional": true,
"field": "su_adh_id"
},
{
"type": "int32",
"optional": true,
"field": "su_user_classification"
},
{
"type": "bytes",
"optional": true,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "4",
"connect.decimal.precision": "18"
},
"field": "su_credit_limit"
},
{
"type": "int32",
"optional": true,
"field": "su_culture_alov_id"
},
{
"type": "int16",
"optional": true,
"field": "su_culture_al_id"
},
{
"type": "string",
"optional": true,
"field": "su_profile_image_file"
},
{
"type": "boolean",
"optional": false,
"field": "su_terms_isagree"
},
{
"type": "int64",
"optional": true,
"name": "io.debezium.time.Timestamp",
"version": 1,
"field": "su_terms_agreed_date"
}
],
"optional": true,
"name": "mssql.dbo.table_name.Value"
},
"payload": {
"su_id": 1,
"su_tenant_id": 0,
"su_bu_id": 0,
"su_user_type": "A",
"su_acpd_id": null,
"su_user_code": "sampletest1",
"su_user_title": null,
"su_first_name": "test_data",
"su_middle_name": null,
"su_last_name": "",
"su_dob": null,
"su_doj": null,
"su_primary_position_id": null,
"su_role_id": 1,
"su_masterdataref": "0",
"su_primary_address": null,
"su_mobile_no": null,
"su_email_id": null,
"su_photo": null,
"su_isactive": true,
"su_created_by": 1,
"su_created_date": 1526324248760,
"su_modified_by": 1,
"su_modified_date": 1547137351267,
"su_status": "I",
"flex_1": null,
"flex_2": null,
"flex_3": null,
"flex_4": null,
"flex_5": null,
"flex_6": null,
"flex_7": null,
"flex_8": null,
"flex_9": null,
"su_gender": null,
"su_theme_id": 406,
"su_activated_date": 1526324248760,
"su_deactivated_date": null,
"su_level_id": null,
"su_hierarchy_type": null,
"su_user_type_id": null,
"su_adh_id": null,
"su_user_classification": null,
"su_credit_limit": null,
"su_culture_alov_id": null,
"su_culture_al_id": null,
"su_profile_image_file": null,
"su_terms_isagree": false,
"su_terms_agreed_date": null
}
}
kudu sink connector config:
config:1
{
"name": "snk_test",
"config": {
"connector.class": "com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkConnector",
"topics": "mssql.dbo.table_name",
"connect.kudu.schema.registry.url": "http://localhost:8081",
"connect.kudu.master": "*.*.*.*:7051",
"connect.kudu.kcql": "upsert into impala::test_db.table_name select * from mssql.dbo.table_name AUTOCREATE DISTRIBUTEBY su_id INTO 3 BUCKETS AUTOEVOLVE"}
}
config:2
{
"name": "snk_test",
"config": {
"connector.class": "com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkConnector",
"topics": "mssql.dbo.table_name",
"connect.kudu.schema.registry.url": "http://localhost:8081",
"connect.kudu.master": "*.*.*.*:7051",
"connect.kudu.kcql": "upsert into impala::test_db.table_name select * from mssql.dbo.table_name "}
}
with both this config I am getting the below error
org.apache.kafka.connect.errors.ConnectException: Exiting
WorkerSinkTask due to unrecoverable exception.\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:560)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:321)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:224)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:192)\n\tat
org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)\n\tat
org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)\n\tat
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat
java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat
java.lang.Thread.run(Thread.java:748)\nCaused by:
java.lang.RuntimeException: scala.MatchError: null\n\tat
com.datamountaineer.streamreactor.connect.errors.ThrowErrorPolicy.handle(ErrorPolicy.scala:58)\n\tat
com.datamountaineer.streamreactor.connect.errors.ErrorHandler$class.handleError(ErrorHandler.scala:83)\n\tat
com.datamountaineer.streamreactor.connect.errors.ErrorHandler$class.handleTry(ErrorHandler.scala:64)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.handleTry(KuduWriter.scala:50)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.applyInsert(KuduWriter.scala:143)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.write(KuduWriter.scala:100)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkTask$$anonfun$put$2.apply(KuduSinkTask.scala:68)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkTask$$anonfun$put$2.apply(KuduSinkTask.scala:68)\n\tat
scala.Option.foreach(Option.scala:257)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduSinkTask.put(KuduSinkTask.scala:68)\n\tat
org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:538)\n\t...
10 more\nCaused by: scala.MatchError: null\n\tat
com.datamountaineer.streamreactor.connect.kudu.KuduConverter$class.com$datamountaineer$streamreactor$connect$kudu$KuduConverter$$addFieldToRow(KuduConverter.scala:106)\n\tat
com.datamountaineer.streamreactor.connect.kudu.KuduConverter$$anonfun$convertToKuduUpsert$2.apply(KuduConverter.scala:48)\n\tat
com.datamountaineer.streamreactor.connect.kudu.KuduConverter$$anonfun$convertToKuduUpsert$2.apply(KuduConverter.scala:48)\n\tat
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)\n\tat
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)\n\tat
scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)\n\tat
scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)\n\tat
scala.collection.TraversableLike$class.map(TraversableLike.scala:234)\n\tat
scala.collection.AbstractTraversable.map(Traversable.scala:104)\n\tat
com.datamountaineer.streamreactor.connect.kudu.KuduConverter$class.convertToKuduUpsert(KuduConverter.scala:48)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.convertToKuduUpsert(KuduWriter.scala:50)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.com$datamountaineer$streamreactor$connect$kudu$sink$KuduWriter$$handleSinkRecord$1(KuduWriter.scala:130)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(KuduWriter.scala:138)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(KuduWriter.scala:138)\n\tat
scala.collection.Iterator$$anon$11.next(Iterator.scala:410)\n\tat
scala.collection.Iterator$$anon$11.next(Iterator.scala:410)\n\tat
scala.collection.Iterator$GroupedIterator.takeDestructively(Iterator.scala:1074)\n\tat
scala.collection.Iterator$GroupedIterator.go(Iterator.scala:1089)\n\tat
scala.collection.Iterator$GroupedIterator.fill(Iterator.scala:1126)\n\tat
scala.collection.Iterator$GroupedIterator.hasNext(Iterator.scala:1130)\n\tat
scala.collection.Iterator$class.foreach(Iterator.scala:891)\n\tat
scala.collection.AbstractIterator.foreach(Iterator.scala:1334)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1.apply$mcV$sp(KuduWriter.scala:141)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1.apply(KuduWriter.scala:141)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter$$anonfun$1.apply(KuduWriter.scala:141)\n\tat
scala.util.Try$.apply(Try.scala:192)\n\tat
com.datamountaineer.streamreactor.connect.kudu.sink.KuduWriter.applyInsert(KuduWriter.scala:136)\n\t...
16 more\n"

conversion error,
use key.converter=...AvroConverter
and
value.converter=...AvroConverter
and set
key.converter.schema.registry.url=http://registry-host:8081
value.converter.schema.registry.url=http://registry-host:8081

Related

Groupby using Painless script

I want to use the painless script to group the response received after running the index. I want to group the response based on the group_id tag and return other tags also. So far, I have used the following script:
{
"size": 0,
"_source": true,
"aggs": {
"entity_group_aggregations": {
"terms": {
"field": "group_id",
"order": {
"_term": "asc"
}
}
}
}
}
However, this script is not returning the desired output.
My index response looks like the following
{
"hits": {
"total": {
"value": 8693,
"relation": "eq"
},
"max_score": 1.0,
"hits": [
{
"_index": "entity_group",
"_type": "_doc",
"_id": "100000003628-brokerAssignment-Outbound-100000000483-aldera",
"_score": 1.0,
"_source": {
"interaction_id": 100000000483,
"group_id": "AFV0001789",
"dest_status": "success",
"group_effective_date": "2021-11-30T18:30:00.000Z",
"exception_cause": "",
"executed_dest_json": [
{
"Type": "Validation",
"name": "validateGroupCountry",
"group": "sequence2",
"sequence": 20,
"resultType": "success",
"status": "processed",
"description": "Validation for group country.",
"resultReason": "Success"
},
{
"Type": "Validation",
"name": "validateProductName",
"group": "sequence2",
"sequence": 21,
"resultType": "success",
"status": "processed",
"description": "Validation for product name.",
"resultReason": "Success"
},
{
"Type": "Validation",
"name": "validateProductEffectiveDate",
"group": "sequence2",
"sequence": 22,
"resultType": "success",
"status": "processed",
"description": "Validation for product effective date.",
"resultReason": "Success"
}
],
"file_name": "brokerAssignment",
"no_of_records": 3,
"di_source": "everwellNgl",
"group_name": "CLAXTON HOBBS PHARMACY - MPA7",
"src_status": "success",
"acknowlegment_record": "{\"groupReturn\": [{\"EB ID#\": \"3391F2D6-3035-11EC-B867-DA6E058A38F8\", \" Group Number\": \"dev-MPA7\", \"Dental Group Rating EE\": null, \"Vision Group Rating EE\": \"5.7\", \"Dental Group Rating FAM\": null, \"Everwell Dental Plan ID\": \"\", \"Everwell Vision Plan ID\": \"11964\", \"Vision Group Rating FAM\": \"16.66\", \" Dental Group Number\": \"\", \" Vision Group Number\": \"AFV0001789\", \"Dental Group Rating EE+CH\": null, \"Dental Group Rating EE+SP\": null, \"Vision Group Rating EE+CH\": \"11.96\", \"Vision Group Rating EE+SP\": \"11.4\", \"Dental Minimum Participation Met\": \"\", \"Vision Minimum Participation Met\": \"Y\"}]}",
"pre_br_canonical": {
"groupDetail": {
"contacts": [
{
"faxNumbers": [
{
"faxNumber": "7702272428",
"type": "primary"
}
],
"firstName": null,
"lastName": null,
"phoneNumbers": [
{
"extension": null,
"type": "primary",
"phoneNumber": "7702272428"
}
],
"emailAddresses": [
{
"emailAddress": null,
"type": "primary"
}
],
"type": "group"
},
{
"faxNumbers": [
{
"faxNumber": null,
"type": "primary"
}
],
"firstName": "billingfn",
"lastName": "billingln",
"phoneNumbers": [
{
"extension": null,
"type": "primary",
"phoneNumber": null
}
],
"emailAddresses": [
{
"emailAddress": "contaclmail5343234#gmail.com",
"type": "primary"
}
],
"type": "billing"
},
{
"faxNumbers": [
{
"faxNumber": null,
"type": "primary"
}
],
"firstName": "contactfn",
"lastName": "contactln",
"phoneNumbers": [
{
"extension": null,
"type": "primary",
"phoneNumber": null
}
],
"emailAddresses": [
{
"emailAddress": "akajjamiapin#empoweredbenefits.com",
"type": "primary"
}
],
"type": "admin"
}
],
"transactionType": "A",
"marketer": null,
"ein": null,
"products": [
{
"plans": [
{
"planTakeOverFlag": "N",
"paymentDetail": null,
"networkID": null,
"otherInsuranceCoverageId": null,
"terminationDate": "11-30-2022",
"rating": {
"financialCode": null,
"rateTimeBasis": null,
"rateEffectiveDate": null,
"rateTerminationDate": null,
"coverageTierCode": null,
"initialRateGuaranteePeriod": null,
"rateByCoverageCode": [
{
"maxAge": null,
"rateAmount": "5.7",
"coverageCode": "EMP",
"gender": null,
"minAge": null
},
{
"maxAge": null,
"rateAmount": "11.4",
"coverageCode": "ESP",
"gender": null,
"minAge": null
},
{
"maxAge": null,
"rateAmount": "11.96",
"coverageCode": "ECH",
"gender": null,
"minAge": null
},
{
"maxAge": null,
"rateAmount": "16.66",
"coverageCode": "FAM",
"gender": null,
"minAge": null
}
],
"initialRateGuaranteePeriodType": null,
"rateTableId": null
},
"effectiveDate": "12-01-2021",
"planId": null,
"minParMet": null,
"contract": null,
"planYearType": null,
"enrolledLives": 2,
"externalPlanId": "11964",
"eligibilityValidationCode": null
}
],
"renewalDate": null,
"renewalTimeValue": null,
"product": "VIS",
"terminationDate": null,
"effectiveDate": null,
"renewalTimeBasis": null
}
],
"websiteUrl": null,
"groupName": "HOBBS PHARMACY - MPA7",
"signingProducer": {
"lastName": "agentln",
"email": "agentmailfsd2345#gmail.com",
"firstName": "agentfn",
"writingNumber": "ad126"
},
"tin": "331057747",
"associatedBrokers": [
{
"brokerId": "A123",
"brokerLastName": "Kazhamiakin",
"systemLob": null,
"primaryAgent": null,
"brokerNpn": "15341",
"customLob": null,
"terminationDate": null,
"effectiveDate": "10-18-2021",
"brokerFirstName": "Alex",
"agency": {
"agencyName": null,
"agencyId": null,
"agreementType": null
},
"commissionDetail": {
"agentLevel": null,
"commission": null,
"commissionType": "2",
"commissionPlan": null
},
"splitPercentage": "100"
}
],
"source": "EverwellGroupsetup_20211108155000_Test1.csv",
"groupType": "NGL",
"division": null,
"sicCode": "5912",
"addresses": [
{
"line1": "131 W TAYLOR ST",
"zip": "30223",
"line2": null,
"city": "GRIFFIN",
"state": "GA",
"type": "group",
"country": "US"
},
{
"line1": null,
"zip": null,
"line2": null,
"city": null,
"state": null,
"type": "billing",
"country": "US"
}
],
"businessLevel": null
},
"groupIds": [
{
"system": "everwell",
"parentId": null,
"id": "3391F2D6-3035-11EC-B867-DA6E058A38F8"
},
{
"system": "",
"parentId": null,
"id": "dev-MPA7"
},
{
"system": "",
"parentId": null,
"id": null
}
],
"groupEligibilityDetail": {
"nextRenewalDate": "12-01-2022",
"terminationDate": null,
"groupStatus": null,
"effectiveDate": "12-01-2021",
"lastRenewalDate": null,
"eligibleLives": 9,
"terminationReason": null
},
"groupConfigurations": {
"billingConfiguration": {
"billingFrequency": "M",
"paymentType": null,
"billingParameters": [
{
"billCheckDigit": null,
"paymentType": null,
"applyAutoCash": null,
"terminationDate": null,
"effectiveDate": null,
"invoiceTimingType": null,
"invoiceBasisDateType": null,
"numberOfDaysPriorACH": null,
"invoiceType": null,
"billingParameterIds": [
{
"system": "aldera",
"parentId": null,
"id": null,
"previousId": null
}
]
}
]
},
"miscellaneousConfiguration": {
"preferredLanguage": null,
"orthoMaxInitialPaymentAmount": null,
"orthoInitialPayment": null,
"erApplicationPDFfileName": "71650_CLAXTON_HO.pdf",
"programNumber": null,
"orthoMaxAdditionalPaymentAmount": null,
"orthoPaymentType": null
},
"memberEligibilityConfiguration": {
"cobValidDays": null,
"memberVerificationFrequency": null,
"memberEligibilityFrequency": null,
"memberBenefitExtensionDays": null,
"idCardProductionParmeter": null,
"memberVerificationSource": null,
"waitingMonths": 1,
"memberEligibilityType": null,
"bigLoadAutoGenMemberID": null,
"coverageCodeCalculation": null
},
"groupEligibilityConfiguration": {
"renewalNotificationDays": null,
"memberEligibilityRequired": null,
"cascadeTermToMembers": null,
"retroNumberOfPeriods": null,
"fullTimeEligibilityHours": 11,
"runOutDays": null,
"retroTimePeriodType": null,
"cascadeTermToSubGroups": null
},
"ratingConfiguration": {
"financialCode": null,
"rateTimeBasis": null,
"renewalTimeValue": null,
"rateTableDescription": null,
"genderRated": null,
"coverageTierId": null,
"renewalTimeBasis": null,
"rateTableId": null
}
}
},
"source_status": "warning",
"#version": "1",
"state": "processed",
"source_interaction_type": "sftp",
"processed_date": "2021-12-27T13:48:08.000Z",
"destination_response_result": null,
"exception_cause_source": "",
"destination": "aldera",
"file_interaction_type": "Outbound",
"dest_transaction_id": 3383,
"product": "vision",
"process": "Group",
"initialized_time": "2021-12-27T13:56:44.000Z",
"minparmet": "1",
"received_date": "2021-12-26T18:30:00.000Z",
"group_state": "GA",
"transaction_type": "add",
"destination_response_record": null,
"latest_transaction_date": "2021-12-27T13:48:08.000Z",
"source_file_id": 853,
"record_id": 100000003628,
"status": "success",
"#timestamp": "2022-08-05T10:23:49.002Z",
}
}
]
}
}

Kafka JDBC source not showing numeric values

I am deploying a Kafka Connect JDBC Source. It is connecting properly to the dabase, but the result I am getting is this:
{
"schema": {
"type": "struct",
"fields": [
{
"type": "bytes",
"optional": false,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "0"
},
"field": "ID"
},
{
"type": "bytes",
"optional": false,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "0"
},
"field": "TENANT_ID"
},
{
"type": "bytes",
"optional": false,
"name": "org.apache.kafka.connect.data.Decimal",
"version": 1,
"parameters": {
"scale": "0"
},
"field": "IS_ACTIVE"
},
{
"type": "int64",
"optional": false,
"name": "org.apache.kafka.connect.data.Timestamp",
"version": 1,
"field": "CREATION_DATE"
},
{
"type": "int64",
"optional": true,
"name": "org.apache.kafka.connect.data.Timestamp",
"version": 1,
"field": "LAST_LOGIN"
},
{
"type": "string",
"optional": true,
"field": "NAME"
},
{
"type": "string",
"optional": true,
"field": "MOBILEPHONE"
},
{
"type": "string",
"optional": true,
"field": "EMAIL"
},
{
"type": "string",
"optional": true,
"field": "USERNAME"
},
{
"type": "string",
"optional": true,
"field": "PASSWORD"
},
{
"type": "string",
"optional": true,
"field": "EXTERNAL_ID"
}
],
"optional": false
},
"payload": {
"ID": "fdo=",
"TENANT_ID": "Uw==",
"IS_ACTIVE": "AQ==",
"CREATION_DATE": 1548987456000,
"LAST_LOGIN": 1557401837030,
"NAME": " ",
"MOBILEPHONE": " ",
"EMAIL": " ",
"USERNAME": "ES00613751",
"PASSWORD": " ",
"EXTERNAL_ID": " "
}
}
As you can see, the numeric and timestamp values are not showing the value properly.
The config:
name=jdbc-teradata-source-connector
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=...
numeric.maping=best_fit
topic.prefix=test-2
mode=timestamp+incrementing
timestamp.column.name=LAST_LOGIN
incrementing.column.name=ID
topic=test-jdbc-oracle-source
The numeric mapping does not work since it is Confluent 3.2.2
I have also tried to cast the numbers to numeric but it does not work either.
Add in your connector config numeric.mapping
"numeric.mapping":"best_fit"
you can see all explication here

Is there API based method to create an index pattern in Kibana if its index is present in ES

I have an index in ES.I need to create an index-pattern of the same in .kibana using an API call.In this creation, I even want to set the column which is going to be the timestamp column.Any help would be appreciated.
You can do it, but you'll need to construct the whole structure by yourself. An index pattern definition looks like this:
PUT .kibana/doc/index-pattern:<some-uuid>
{
"type": "index-pattern",
"updated_at": "2018-01-27T07:12:05.373Z",
"index-pattern": {
"title": "test*",
"timeFieldName": "#timestamp",
"fields": """ ... """,
}
}
title is the name of your index pattern, the same one you'd input if you create the index pattern through the UI
timeFieldName is the name of the timestamp field
fields is a string containing a JSON array of all the field definitions in your index pattern (see below)
The fields definition looks like this:
[
{
"name": "#timestamp",
"type": "date",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true
},
{
"name": "_id",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false
},
{
"name": "_index",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false
},
{
"name": "_score",
"type": "number",
"count": 0,
"scripted": false,
"searchable": false,
"aggregatable": false,
"readFromDocValues": false
},
{
"name": "_source",
"type": "_source",
"count": 0,
"scripted": false,
"searchable": false,
"aggregatable": false,
"readFromDocValues": false
},
{
"name": "_type",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false
},
{
"name": "referer",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": false,
"readFromDocValues": false
},
...
]
So you need to create this array for each of your fields, then stringify it and put the string inside the fields field.
Here is a sample document representing an index pattern:
{
"type": "index-pattern",
"updated_at": "2018-01-27T07:12:05.373Z",
"index-pattern": {
"title": "test*",
"timeFieldName": "#timestamp",
"fields": """[{"name":"#timestamp","type":"date","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"referer","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"referer.keyword","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"status","type":"number","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"url","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"url.keyword","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true}]"""
}
}

Couchbase Full text search matching partial numbers

Good day.
I am using couchDB to store data of some entity which includes "firstName", "lastName", "dob" and "idNumber". (Various other dynamic data is also present, but not important now.)
I have created a full-text-search index to index specific types of documents and set up to search on the above mentioned fields only. The search works perfectly for "firstName" and "lastName" with partial matches as well.
However, for the idNumber, the exact number must be given. Partial searches on the idNumber does not work. For example, if '7605054321089' is the idNumber and I search for '760505432', nothing is returned. If I enter the idNumber completely, it is returned successfully. I have fiddled with the properties under the FTS section, to no avail.
My date-of-birth field does not work at all. I cannot search on that field, but I have parked that until I get the idNumber to work at least.
The JSon describing the filter as follows (sorry for the size):
{
"type": "fulltext-index",
"name": "entities_fts",
"uuid": "5c5dc5e32083535f",
"sourceType": "couchbase",
"sourceName": "entities",
"sourceUUID": "04bb2840ed12d26003797737e5a19908",
"planParams": {
"maxPartitionsPerPIndex": 32,
"numReplicas": 0,
"hierarchyRules": null,
"nodePlanParams": null,
"pindexWeights": null,
"planFrozen": false
},
"params": {
"mapping": {
"byte_array_converter": "json",
"default_analyzer": "standard",
"default_datetime_parser": "dateTimeOptional",
"default_field": "_all",
"default_mapping": {
"display_order": "1",
"dynamic": true,
"enabled": false
},
"default_type": "_default",
"index_dynamic": true,
"store_dynamic": false,
"type_field": "header.type",
"types": {
"person": {
"display_order": "0",
"dynamic": false,
"enabled": true,
"properties": {
"basic": {
"display_order": "1",
"dynamic": false,
"enabled": true,
"properties": {
"dob": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "",
"display_order": "0",
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "",
"store": false,
"type": "datetime"
}
]
},
"firstNames": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "",
"display_order": "2",
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "",
"store": false,
"type": "text"
}
]
},
"lastNames": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "",
"display_order": "1",
"include_in_all": true,
"include_term_vectors": false,
"index": true,
"name": "",
"store": false,
"type": "text"
}
]
}
}
},
"extended": {
"display_order": "0",
"dynamic": false,
"enabled": true,
"properties": {
"idNumber": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "keyword",
"display_order": "0",
"include_in_all": true,
"include_term_vectors": false,
"index": true,
"name": "",
"store": false,
"type": "text"
}
]
}
}
}
}
}
}
},
"store": {
"kvStoreName": "forestdb"
}
},
"sourceParams": {
"clusterManagerBackoffFactor": 0,
"clusterManagerSleepInitMS": 0,
"clusterManagerSleepMaxMS": 2000,
"dataManagerBackoffFactor": 0,
"dataManagerSleepInitMS": 0,
"dataManagerSleepMaxMS": 2000,
"feedBufferAckThreshold": 0,
"feedBufferSizeBytes": 0
}
}
Any help will be greatly appreciated, thank you.
for the idNumber search in couchbase FTS, it might be because you're attempting an exact match search? You might want to try a prefix search...
{
"from": 0,
"size": 10,
"query": {
"field": "name",
"prefix": "bobble"
}
}
https://github.com/blevesearch/bleve/blob/master/test/tests/basic/searches.json#L91

Showing Different Document Types in Kibana from ElasticSearch

I'm in the process of trying to setup a Kibana dashboard. This dashboard is hitting an ElasticSearch index. My index has the following mappings:
"myindex": {
"mappings": {
"animals": {
"properties": {
"#timestamp": {
"type": "date",
"format": "dateOptionalTime"
},
"#version": {
"type": "string"
},
"Class": {
"type": "string"
},
"Order": {
"type": "string"
},
"Family": {
"type": "string"
},
"Genus": {
"type": "string"
},
"Species": {
"type": "string"
}
}
},
"elements" : {
"properties": {
"#timestamp": {
"type": "date",
"format": "dateOptionalTime"
},
"#version": {
"type": "string"
},
"Symbol": {
"type": "string"
},
"Name": {
"type": "string"
},
"Group": {
"type": "string"
},
"Period": {
"type": "string"
}
}
}
}
}
As the mappings show, my index has two different types of information. My challenge is, I don't know how to setup my kibana dashboard to just list the information for each type. I've confirmed that the data in my elasticsearch instance is the correct data.
In my dashboard, I'm trying to show two tables. One table will show all of the documents associated with "animals". The other table will show all of the documents associated with "elements". Unfortunately, I can't figure out how to focus the results of a table down to a specific type. I'm basically trying to figure out how to setup either a query or a filter (not sure the difference between the two in the kibana world) for a specific panel. Currently, my dashboard looks like this:
{
"title": "Research",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
"pin": false,
"type": "lucene"
}
},
"ids": [
0
]
},
"filter": {
"list": {
"0": {
"type": "time",
"field": "#timestamp",
"from": "now-{{ARGS.from || '24h'}}",
"to": "now",
"mandate": "must",
"active": true,
"alias": "",
"id": 0
}
},
"ids": [
0
]
}
},
"rows": [
{
"title": "Animals",
"height": "350px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"title": "Animals",
"error": false,
"span": 12,
"editable": true,
"group": [
"default"
],
"type": "table",
"size": 100,
"pages": 5,
"offset": 0,
"sort": [
"#timestamp",
"desc"
],
"style": {
"font-size": "9pt"
},
"overflow": "min-height",
"fields": [
"Class",
"Order",
"Family",
"Genus",
"Species"
],
"localTime": true,
"timeField": "#timestamp",
"highlight": [],
"sortable": true,
"header": true,
"paging": true,
"spyable": true,
"queries": {
"mode": "all",
"ids": [
0
]
},
"field_list": true,
"status": "Stable",
"trimFactor": 300,
"normTimes": true
}
],
"notice": false
},
{
"title": "",
"height": "350px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"title": "Elements",
"error": false,
"span": 12,
"editable": true,
"group": [
"default"
],
"type": "table",
"size": 100,
"pages": 5,
"offset": 0,
"sort": [
"#timestamp",
"desc"
],
"style": {
"font-size": "9pt"
},
"overflow": "min-height",
"fields": [
"Symbol",
"Name",
"Group",
"Period"
],
"localTime": true,
"timeField": "#timestamp",
"highlight": [],
"sortable": true,
"header": true,
"paging": true,
"spyable": true,
"queries": {
"mode": "all",
"ids": [
0
]
},
"field_list": true,
"trimFactor": 300,
"normTimes": true
}
],
"notice": false
}
],
"editable": true,
"failover": false,
"index": {
"interval": "none",
"default": "myindex"
},
"style": "dark",
"panel_hints": true,
"pulldowns": [
{
"type": "query",
"collapse": false,
"notice": false,
"query": "*",
"pinned": true,
"history": [],
"remember": 10
},
{
"type": "filtering",
"collapse": true,
"notice": false
}
],
"loader": {
"save_gist": false,
"save_elasticsearch": true,
"save_local": true,
"save_default": true,
"save_temp": true,
"save_temp_ttl_enable": true,
"save_temp_ttl": "30d",
"load_gist": true,
"load_elasticsearch": true,
"load_elasticsearch_size": 20,
"load_local": true,
"hide": false
},
"refresh": "30s"
}
Can someone tell me how to show two different types of documents in Kibana? I see a queries object on the table panel. Yet, I have no idea how to use it.
Thank you so much
You can use the _type field to narrow the result to a specific elastic search type (e.g. animals).
So when you define the query (or filter) for your table, just make sure to specify the relevant _type (i.e. _type: animals)
You can use scripted fields to have value of type as separate field which will be indexed.
or you can add _type field to search field it will be available.
In case of scripted fields add as doc['_type'].value and give it any name you want.
https://github.com/elastic/kibana/issues/5684

Resources