# CREATE STREAM
Create a new hstream stream with the given name. An exception will be thrown if a stream with the same name already exists.
CREATE STREAM stream_name [ AS select_query ] WITH (REPLICATE = INT);
stream_nameis a valid identifier.
select_queryis an optional
SELECT(Stream) query. For more information, see
<select_query>is specified, the created stream will be filled with records from the
SELECTquery continuously. Otherwise, the stream will only be created and kept empty.
WITHclause contains some stream options. Only
REPLICATEoption is supported now, which represents the replication factor of the stream. If it is not specified, the replication factor will be set to default value.
CREATE STREAM foo; CREATE STREAM weather WITH (FORMAT = "JSON"); CREATE STREAM abnormal_weather AS SELECT * FROM weather WHERE temperature > 30 AND humidity > 80 EMIT CHANGES;