Hey Team, I was wondering if I could get some help...
# troubleshooting
b
Hey Team, I was wondering if I could get some help troubleshooting. I'm new to Flink and would like to use it with a debezium kafka topic to run queries. at this point I'm just trying a hello world and i'm running into
Table sink '*anonymous_datastream_sink$1*' doesn't support consuming update and delete changes which is produced by node TableSourceScan(table=[[default_catalog, default_database, dbz_tags]], fields=[id, name, description, is_default, is_public, owner_organization_id, owner_team_id, owner_user_id, created_at, created_by, updated_at, updated_by, legacy_id, is_portfolio, tag_type, op])
this is what my app looks like,
Copy code
package io.ssc

import org.apache.flink.api.common.restartstrategy.RestartStrategies
import org.apache.flink.api.common.serialization.SimpleStringSchema
import org.apache.flink.streaming.api.TimeCharacteristic
import org.apache.flink.streaming.api.scala._
import org.apache.flink.table.api.bridge.scala._
import org.apache.flink.types.Row
import org.apache.flink.streaming.api.scala.extensions._
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer

object DebeziumTest {
  def main(args: Array[String]): Unit = {
    val dbzPropertyPrefix = "debezium-avro-confluent"
    val tags =
      s"""
         |CREATE TABLE dbz_tags (
         | id                    STRING, --but it's a uuid
         | name                  STRING,
         | description           STRING,
         | is_default            BOOLEAN,
         | is_public             BOOLEAN,
         | owner_organization_id STRING, --but it's a uuid
         | owner_team_id         STRING, --but it's a uuid
         | owner_user_id         STRING, --but it's a uuid
         | created_at            TIMESTAMP(3), -- WITH TIME ZONE
         | created_by            STRING,
         | updated_at            TIMESTAMP(3), -- WITH TIME ZONE
         | updated_by            STRING,
         | legacy_id             STRING,
         | is_portfolio          BOOLEAN,
         | tag_type              STRING,
         | op                    STRING
         |) WITH (
         | 'connector' = 'kafka',
         | 'topic' = 'platform-users-tags',
         | 'properties.bootstrap.servers' = '',
         | '${dbzPropertyPrefix}.basic-auth.credentials-source' = '',
         | '${dbzPropertyPrefix}.basic-auth.user-info' = '',
         | '${dbzPropertyPrefix}.subject' = 'platform-users-tags-value',
         | '${dbzPropertyPrefix}.url' = '',
         | 'properties.group.id' = 'bb-local',
         | 'scan.startup.mode' = 'earliest-offset',
         | 'format' = 'debezium-avro-confluent'
         |)
         |""".stripMargin
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 10000))

    val tableEnv = StreamTableEnvironment.create(env)

    tableEnv.executeSql(tags)

    val resultStream = tableEnv.toDataStream(tableEnv.sqlQuery("SELECT * FROM dbz_tags;"))//tableEnv.toDataStream(joinTable)

    resultStream.print().name("print-sink")
    env.execute("Debezium Join Job")
  }
}
I'm sure it's something simple but I'm not sure how to solve it
v
Hey, you'd need to use
.toChangelogStream
as the table created using the Debezium format produces updates (not append-only)
b
thanks! I'll give that a look