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 INTOcan 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.Visitoris requested to parse INSERT INTO statementStatementRewriter.Rewriteris 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.RewriterPluginis requested to visitInsertIntoKsqlAuthorizationValidatorImplis requested to validateInsertIntoCommandIdAssigneris requested to getInsertIntoCommandIdDistributingExecutoris requested to validateInsertIntoQueries
getSink¶
Sink getSink()
getSink is part of the QueryContainer abstraction.
getSink creates a Sink (with createSink flag disabled).