createOrcaHaStreamTable

Syntax

createOrcaHaStreamTable(name, colNames, colTypes, raftGroup, cacheLimit, [retentionMinutes=1440])

Details

Creates a high-availability stream table. For details, see haStreamTable.

The difference from StreamGraph::haSource is that createOrcaHaStreamTable does not rely on a stream graph.

Parameters

name is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as "trading.orca_table.factors", or just the table name, like "factors". If only the name is given, the system will automatically complete it using the current catalog.

colNames is a STRING vector of column names.

colTypes is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.

raftGroup can be either an integer greater than 1 or a string.

  • Integer: represents the raft group ID.
  • String: represents a raft group alias, which must be preconfigured via streamingRaftGroupAliases.

Examples

if(!existsCatalog("demo")){
    createCatalog("demo")
}
go
use catalog demo

createOrcaHaStreamTable("ha_table",`time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG], 3, 50000)