CertSafari
    Snowflake SnowPro Advanced: Data Engineer (DEA-C02)· Lessons

    Domain 1 · Lesson 5/22

    Snowflake Kafka connector: install, topic mapping and table shape

    Install, configure, and use connectors for Snowflake integration.

    15 min read
    4% of exam
    4 sources
    Published 20 Oct 2026
    Docs as of 4 Oct 2026

    What you will be able to do

    • Explain where the Snowflake Kafka connector runs and how it is installed in a Kafka Connect cluster
    • Configure a single connector to route several topics to named tables with snowflake.topic2table.map
    • Choose between Snowpipe and Snowpipe Streaming and tune the buffer.* flush settings
    • Predict the shape of a landed table under the classic connector and under v4, and control what RECORD_METADATA contains

    Key concept

    Connector placement — Each Snowflake connector runs inside the framework it extends. The Kafka connector runs in Kafka Connect, the Spark connector runs as a plugin in the Spark cluster, the Python connector runs inside your application, and a native connector runs inside Snowflake as a Native App. Where a connector runs decides who installs it, where its credentials live and what infrastructure you have to operate.

    1.Where the Kafka connector runs and how it is installed

    The Snowflake Connector for Kafka is a sink that reads messages from Kafka topics and writes them into Snowflake tables. It runs in neither Snowflake nor the Kafka brokers. It runs in Kafka Connect, a framework for linking Kafka to external systems. A Kafka Connect cluster is separate from the Kafka cluster, and it is the Connect cluster that runs and scales out connectors. Snowflake sees each topic as a stream of rows. In general each message becomes one row, and the usual pattern is one topic feeding one table.

    Snowflake ships two builds, one for Confluent's Kafka package and one for open-source Apache Kafka. Confluent Cloud also offers a hosted version. There are also two generations. The classic connector (v3 and earlier) is fully supported today, but Snowflake plans to announce its deprecation in mid-2026, and an 18-month migration window starts at that announcement. Use v4 for all new implementations. The generation affects more than support dates, because v4 lands data in a different table shape, as the last section of this page explains.

    To install a self-managed connector, download the connector JAR from Maven Central and copy it into <kafka_dir>/libs. Two extra JARs may be needed. Bouncy Castle decrypts an encrypted private key, and the Avro JAR is needed if your topics carry Avro. The connector authenticates with a key pair: snowflake.user.name plus snowflake.private.key, and snowflake.private.key.passphrase if the key is encrypted. Kafka Connect broadcasts the configuration, private key included, from the master node to the worker nodes. Secure the channel between Connect nodes and restrict read and write access to the configuration file.

    Checkpoint 1 of 8· Check yourself

    A team runs the self-managed Snowflake Connector for Kafka. Ingestion is falling behind, and they want to add capacity where the connector actually runs. What should they scale out?

    Sources12

    2.Configuring the connector and routing topics to tables

    The connector reads one configuration file: JSON in distributed mode, or a properties file in standalone mode. Each file names exactly one database and one schema. A single connector can read any number of topics, but all of their tables must be in that one database and schema.

    Standalone-mode properties file: routing, buffering, location, authentication and convertersproperties
    connector.class=com.snowflake.kafka.connector.SnowflakeSinkConnector
    tasks.max=8
    topics=topic1,topic2
    snowflake.topic2table.map= topic1:table1,topic2:table2
    buffer.count.records=10000
    buffer.flush.time=60
    buffer.size.bytes=5000000
    snowflake.url.name=myorganization-myaccount.snowflakecomputing.com:443
    snowflake.user.name=jane.smith
    snowflake.private.key=xyz123
    snowflake.private.key.passphrase=jkladu098jfd089adsq4r
    snowflake.database.name=mydb
    snowflake.schema.name=myschema
    key.converter=org.apache.kafka.connect.storage.StringConverter
    value.converter=com.snowflake.kafka.connector.records.SnowflakeAvroConverter

    The properties fall into four groups, and each group does a different job:

    • Routing: topics (a comma-separated list) or topics.regex (never both), plus the optional snowflake.topic2table.map.
    • Buffering: buffer.count.records, buffer.flush.time and buffer.size.bytes decide when buffered records are sent to Snowflake.
    • Serialization: value.converter tells the connector how to read record values, for example SnowflakeJsonConverter for JSON or SnowflakeAvroConverter for Avro with a Schema Registry. key.converter handles record keys.
    • Location and identity: snowflake.url.name, the user and key, snowflake.database.name and snowflake.schema.name.

    Only the routing group decides which table a topic lands in. If you leave out snowflake.topic2table.map, the connector derives each table name from its topic name and creates the table if it does not exist. If you set the map, the connector switches to explicit mapping mode. The value is a comma-separated list of topic:table pairs, so one connector can send orders, refunds and shipments to three tables with custom names. Explicit mode can also map several topics to a single table. Buffer sizes, converters and schema settings play no part in naming the destination.

    How a topic name becomes a table name when no topic map is set
    SituationClassic connector (v3)Connector v4
    Valid lowercase nameConverted to uppercaseUsed as the table name, converted to uppercase
    First character is not a letter or underscoreAn underscore is prependedTreated as invalid characters
    Illegal characters inside the nameEach is replaced with an underscoreReplaced with underscores, and an underscore plus a hash code is always appended (my-topic.data becomes MY_TOPIC_DATA_<hash>)
    Two topics clean up to the same nameAn underscore plus a generated hash is appended (numbers+x and numbers-x would both be NUMBERS_X)Already unique, because of the hash

    Checkpoint 2 of 8· Check yourself

    Your properties file sets topics=orders,refunds and leaves out snowflake.topic2table.map. No tables exist yet in the target schema. What happens when the connector starts reading?

    Checkpoint 3 of 8· Exam question

    A data engineering team configures a single Kafka Connect sink connector to ingest from three topics — orders, refunds, and shipments — into three separately named Snowflake tables instead of the connector's default per-topic naming. Which configuration approach lets them redirect each topic to a specific target table without deploying three separate connectors?

    Sources23

    3.Ingestion method and buffer flushing

    The connector only loads data, and it has exactly two loading methods: Snowpipe and Snowpipe Streaming. It cannot write to an external table, and it does not schedule Tasks to load staged files. With Snowpipe, buffered records are ingested into Snowflake as data files. Snowpipe Streaming is Snowflake's row-level, low-latency ingest API, and it skips the file-staging step. With Streaming, the connector calls the API once after each flush, and the data reaches Snowflake about one second later. If dashboards have to show events almost immediately, choose Snowpipe Streaming. With Streaming the connector also delivers exactly-once by default, so messages are neither duplicated nor lost.

    Buffer properties that decide when the connector flushes (Snowpipe Streaming classic)
    PropertyWhat it limitsDefault
    buffer.flush.timeSeconds between buffer flushes (minimum 1)10
    buffer.count.recordsRecords buffered in memory per Kafka partition10000
    buffer.size.bytesCumulative bytes buffered in memory per Kafka partition20000000 (20 MB)

    Under light traffic, a partition's buffer seldom reaches 10,000 records or 20 MB, so the timer triggers almost every flush. A connector that flushes every few seconds and creates many small loads therefore needs a larger buffer.flush.time. Snowflake recommends exactly that when cost matters more than latency, and recommends a smaller value when data arrives at higher rates. The count and size limits apply per Kafka partition, so adding tasks only moves partitions between tasks. It does not change when any partition's buffer fills. Raising the flush time has one limit: the in-memory buffer must still flush before it fills, or the connector can run out of memory.

    Checkpoint 4 of 8· Check yourself

    Operations dashboards must show Kafka events within seconds of their being produced. Which way of landing the data does the Snowflake Kafka connector support for this?

    Checkpoint 5 of 8· Exam question

    A streaming platform team must load Kafka messages into Snowflake with sub-second latency so downstream dashboards reflect events almost immediately, rather than tolerating the file-staging delay of periodic loads. Which ingestion mode should they configure the Kafka connector to use?

    Checkpoint 6 of 8· Exam question

    A connector deployment is flushing to Snowflake every few seconds under low traffic, creating far more small load operations than the team wants, even though the record-count threshold is rarely reached. Which setting should they raise to reduce flush frequency during quiet periods?

    Sources14

    4.What the landed table looks like: classic columns vs v4 schematized tables

    By default, the classic connector lands every message in two VARIANT columns. RECORD_CONTENT holds the Kafka message and RECORD_METADATA holds information about it. The message is stored as JSON or Avro without being parsed or split into columns. If you create the table yourself, any extra columns must allow NULL, because the connector never supplies values for them. When the target is an Iceberg table, the same two columns become structured types instead of VARIANT.

    Querying a classic table: path syntax into the two VARIANT columnssql
    select
           record_metadata:CreateTime,
           record_content:ID
        from table1
        where record_metadata:topic = 'PressureOverloadWarning';

    Connector v4 lands a schematized table instead. If the table does not exist, the connector creates it with one column per first-level JSON key. It then writes through a default pipe named {tableName}-STREAMING, which matches keys to columns by name, ignoring case. Nested objects and arrays fit in VARIANT columns. If a message carries a key that has no matching column, the connector drops it, unless ENABLE_SCHEMA_EVOLUTION is set on the table. With that setting, the new key becomes a new column (table schema evolution). If a pipe with the same name as the target table already exists, the connector uses that pipe instead. Its COPY INTO reads from DATA_SOURCE(TYPE => 'STREAMING') and can rename, cast and pull out metadata. User-defined pipes are not supported with client-side validation (snowflake.validation=client_side).

    A v4 user-defined pipe that reshapes content and extracts RECORD_METADATA fieldssql
    CREATE PIPE ORDERS AS
    COPY INTO ORDERS_TABLE
    FROM (
      SELECT
        $1:order_id::NUMBER,
        $1:customer_name,
        $1:order_total,
        $1:RECORD_METADATA.topic AS source_topic,
        $1:RECORD_METADATA.offset::NUMBER AS kafka_offset,
        $1:RECORD_METADATA.SnowflakeConnectorPushTime::BIGINT AS ingestion_time
      FROM TABLE(DATA_SOURCE(TYPE => 'STREAMING'))
    );
    RECORD_METADATA fields and the v4 flags that control them
    FieldContentsControlled by
    topicKafka topic the record came fromsnowflake.metadata.topic
    partition, offsetKafka partition (not a micro-partition) and offset within itsnowflake.metadata.offset.and.partition
    CreateTime / LogAppendTimeKafka record timestamp, milliseconds since epochsnowflake.metadata.createtime
    SnowflakeConnectorPushTimeWhen the connector pushed the record into the ingest bufferAlways available in v4
    key, headersMessage key and user-defined headerssnowflake.metadata.all; key also needs key.converter set to StringConverter

    All four flags default to true. Setting one to false removes its fields from RECORD_METADATA. The metadata costs about 150 bytes per record, which can be a large share of a small payload and shows up on the bill. If you don't need it, set snowflake.metadata.all=false. Keys are easy to lose: unless key.converter is org.apache.kafka.connect.storage.StringConverter, the connector ignores the message key.

    Checkpoint 7 of 8· Fill the gap

    This query reads a table that the classic Kafka connector loaded with its default schema. Which column completes the query so that it returns the ID field from the Kafka message itself?

    select
           record_metadata:CreateTime,
            ? :ID
        from table1
        where record_metadata:topic = 'PressureOverloadWarning';

    Checkpoint 8 of 8· Check yourself

    Analysts notice that RECORD_METADATA has topic, partition and offset but never a key, even though every message is keyed. The connector uses key.converter=org.apache.kafka.connect.json.JsonConverter and leaves all metadata flags at their defaults. What change makes the connector store the key?

    Sources13

    Sources

    (4)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “A Kafka Connect cluster is a separate cluster from the Kafka cluster.”
      ↩︎ Where the Kafka connector runs and how it is installed
      “With Snowflake, the typical pattern is that one topic supplies messages (rows) for one Snowflake table.”
      ↩︎ Where the Kafka connector runs and how it is installed
      “Recommendation: Use the Snowflake Connector for Kafka (v4) for all new implementations.”
      ↩︎ Where the Kafka connector runs and how it is installed
      “The Kafka connector supports two data loading methods:”
      ↩︎ Ingestion method and buffer flushing
      “any additional columns must allow NULL values because data from the connector does not include values for those columns”
      ↩︎ What the landed table looks like: classic columns vs v4 schematized tables
      “The Kafka connector is designed to run in a Kafka Connect cluster”
      ↩︎ Key concept
      “If the topics are not mapped, then the Kafka connector creates a new table for each topic using the topic name.”
      ↩︎ Exam trap 1
      “The data is not parsed, and the data is not split into multiple columns in the Snowflake table.”
      ↩︎ Exam trap 2
      “A Kafka Connect cluster is a separate cluster from the Kafka cluster. The Kafka Connect cluster supports running and scaling out connectors”
      ↩︎ Checkpoint
      “To avoid accidental duplication of table names, the connector appends a suffix to the table name.”
      ↩︎ Prediction
      “If the topics are not mapped, then the Kafka connector creates a new table for each topic using the topic name.”
      ↩︎ Checkpoint
      “The current version of the Kafka connector is limited to loading data into Snowflake. The Kafka connector supports two data loading methods:”
      ↩︎ Checkpoint
    2. 2.
      “Copy the JAR files you downloaded in Download the Kafka Connector JAR Files to the <kafka_dir>/libs folder.”
      ↩︎ Where the Kafka connector runs and how it is installed
      “a connector can ingest messages from any number of topics, but the corresponding tables must all be stored in a single database and schema.”
      ↩︎ Configuring the connector and routing topics to tables
      “The configuration file should contain either topics or topics.regex, not both.”
      ↩︎ Configuring the connector and routing topics to tables
    3. 3.
      “The snowflake.topic2table.map parameter accepts a comma-separated list of topic-to-table mappings in the format:”
      ↩︎ Configuring the connector and routing topics to tables
      “Appends an underscore followed by a hash code to ensure uniqueness”
      ↩︎ Configuring the connector and routing topics to tables
      “If keys from the JSON don’t match the table columns, the connector ignores the keys unless ENABLE_SCHEMA_EVOLUTION is enabled on the table”
      ↩︎ What the landed table looks like: classic columns vs v4 schematized tables
      “If you don’t need metadata, you can reduce this overhead by setting snowflake.metadata.all=false.”
      ↩︎ What the landed table looks like: classic columns vs v4 schematized tables
      “must be set to org.apache.kafka.connect.storage.StringConverter; otherwise, the connector ignores keys.”
      ↩︎ Exam trap 3
      “the key.converter parameter in the connector configuration properties must be set to org.apache.kafka.connect.storage.StringConverter; otherwise, the connector ignores keys.”
      ↩︎ Checkpoint
    4. 4.
      “After the Kafka buffer flush time is reached, data will be sent with one second latency to Snowflake through Snowpipe Streaming.”
      ↩︎ Ingestion method and buffer flushing
      “If cost is a greater concern than latency, you could increase the buffer flush time.”
      ↩︎ Ingestion method and buffer flushing
      “Number of records buffered in memory per Kafka partition before ingesting to Snowflake.”
      ↩︎ Ingestion method and buffer flushing
      “Note that setting this property to true makes buffer.flush.time and buffer.count.records irrelevant.”
      ↩︎ Ingestion method and buffer flushing
      “This delivery guarantee is set by default for the Kafka connector with Snowpipe Streaming.”
      ↩︎ Ingestion method and buffer flushing

    Continue to part 2 of 2

    Spark, Python and native connectors for Snowflake

    Spotted a mistake, or was something unclear? Tell us.