Skip to content

InsertInto

InsertInto is a Statement and a QueryContainer that represents INSERT INTO statement.

InsertInto is a distributed command and executed by DistributingExecutor (in REST execution mode).

Requirements

  1. INSERT INTO can only be used to insert into a stream
  2. The target should be registered in MetaStore
  3. The target datasource cannot have header columns
  4. The topic of the target datasource cannot be read-only

Possible Code Duplication

There are two entities that assert these requirements:

Creating Instance

InsertInto takes the following to be created:

InsertInto is created when:

Target DataSource

InsertInto is given the name of the target DataSource (to write records into).

getTarget

SourceName getTarget()

getTarget returns the target.


getTarget is used when:

getSink

Sink getSink()

getSink is part of the QueryContainer abstraction.


getSink creates a Sink (with createSink flag disabled).

Learning Resources

  1. Insert Into | Level Up your KSQL by Confluent
  2. KSQL demo - INSERT INTO