Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value of a column not getting set #22

Open
swapkh91 opened this issue May 3, 2024 · 0 comments
Open

Default value of a column not getting set #22

swapkh91 opened this issue May 3, 2024 · 0 comments

Comments

@swapkh91
Copy link

swapkh91 commented May 3, 2024

I'm using the connector to load data to a table where I have a column rowtime with default value as CURRENT_TIMESTAMP

When sending json data through the connector, this column doesn't get populated with current timestamp, instead NULL is set as value

table structure

CREATE TABLE `test` (
  `type` varchar(65533) NULL COMMENT "",
  `clientId` varchar(65533) NULL COMMENT "",
  `rowtime` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT "",
  INDEX buyer_clientId_idx (`clientId`) USING BITMAP
) ENGINE=OLAP 
DUPLICATE KEY(`type`, `clientId`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`clientId`)
PROPERTIES (
"replication_num" = "1",
"datacache.partition_duration" = "3 days",
"datacache.enable" = "true",
"storage_volume" = "starrocks_qa_volume",
"enable_async_write_back" = "false",
"enable_persistent_index" = "true",
"persistent_index_type" = "LOCAL",
"compression" = "LZ4"
);

connector yaml

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnector
metadata:
  name: kafka-starrocks-test-sink-qa
  namespace: kafka
  annotations:
    strimzi.io/restart: "true"
  labels:
    strimzi.io/cluster: dp-kafka-connect-cluster 
spec:
 class: com.starrocks.connector.kafka.StarRocksSinkConnector
 tasksMax: 15
 autoRestart:
  enabled: true
  maxRestarts: 5
 config:
  key.converter: org.apache.kafka.connect.json.JsonConverter
  value.converter: org.apache.kafka.connect.json.JsonConverter
  header.converter: org.apache.kafka.connect.storage.SimpleHeaderConverter
  topics: realtime-test
  key.converter.schemas.enable: true
  value.converter.schemas.enable: false
  fetch.max.wait.ms: 500
  starrocks.http.url: <ip>:8030
  starrocks.topic2table.map: realtime-test:test
  starrocks.username: <user>
  starrocks.password: <pass>
  starrocks.database.name: test_db
  sink.properties.strip_outer_array: true
  bootstrap.servers: dp-kafka-cluster-kafka-0.dp-kafka-cluster-kafka-brokers.kafka.svc:9092,dp-kafka-cluster-kafka-1.dp-kafka-cluster-kafka-brokers.kafka.svc:9092,dp-kafka-cluster-kafka-2.dp-kafka-cluster-kafka-brokers.kafka.svc:9092
  kafka.partition.count: 30

ROUTINE LOAD works fine in this case

sample json

{'type': 'OPEN', 'clientId': '0000-asas-sadasd'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant