This topic describes how to use the INSERT INTO statement in Spark Streaming SQL.
Syntax
INSERT INTO tbName[(columnName[,columnName]*)]
queryStatement;
Example
INSERT INTO LargeOrders
SELECT * FROM Orders WHERE units > 1000;
Description
- SELECT queries cannot be independently executed. It must be used in the CREATE TABLE
AS SELECT (CTAS) or
INSERT INTO
statement. - For a single job, an SQL file can contain multiple data manipulation language (DML) operations and multiple data sources and sinks.