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¶
INSERT INTO
can only be used to insert into a stream- The target should be registered in MetaStore
- The target datasource cannot have header columns
- 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:
-
NodeLocation
- Target DataSource
- Query
-
InsertIntoProperties
InsertInto
is created when:
AstBuilder.Visitor
is requested to parse INSERT INTO statementStatementRewriter.Rewriter
is requested to visitInsertInto
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:
AstSanitizer.RewriterPlugin
is requested to visitInsertIntoKsqlAuthorizationValidatorImpl
is requested to validateInsertIntoCommandIdAssigner
is requested to getInsertIntoCommandIdDistributingExecutor
is requested to validateInsertIntoQueries
getSink¶
Sink getSink()
getSink
is part of the QueryContainer abstraction.
getSink
creates a Sink (with createSink flag disabled).