creating tables and views in Arroyo SQL
INSERT INTO
statement, but can then be
selected from multiple times. For example, you could create an orders
table
with a statement like
CREATE VIEW
is simply an alias for creating a memory table.
CREATE TABLE
statement.
Connection tables are created via special CREATE TABLE
statements that include
a WITH
clause. The WITH
clause specifies the connector, the
format that the data is encoded with, and various other
options that are specific to the connector, as documented on the individual
connector pages. The general form of the statement is:
connector
is one of the connectors documented here and
format is one of of the supported formats.
For example, to create a Kafka source for the topic order_topic
:
results
topic
as
to ensure they
are what you expect.
WITH
clause, with an unquoted
key and a single or double-quoted value. The following options are supported
across all connections. Specific connections have their own options. To see all
of the supported options, refer to the Connector docs.
Option | required | Description |
---|---|---|
connector | yes | The name of the connector to use. |
format | if connector does not have a built-in format | The format of the data to be deserialized. |
idle_micros | no | The number of microseconds to wait before considering a source idle. Defaults to 30000000 (30 seconds). Set to -1 to disable source idleness. |
CREATE TABLE
statement. These are
done using the GENERATED ALWAYS AS (expression)
syntax. expression
must be a
valid Arroyo SQL expression that only depends on non-virtual fields within the
table. For example
orders
with
columns customer_id
and order_id
you could insert into it with a statement
like