# SqlOperation

Processes data through a sequence of SQL statements executed in order. Supports VIEW statements that create temporary tables, OUTPUT statements that produce DataStream results, and IO statements that perform side effects.

**Type**: `object`

## Properties

- name: availableDatasets (optional)
  type: array of string
  description: IDs of datasets whose tables can be referenced in SQL statements. These will be registered as queryable tables in the SQL environment. The tables from each dataset will appear in a separate namespace based on the dataset name.

- name: globalStateTtl (optional)
  type: string
  description: Global time-to-live for operation state. When calculating aggregations or joins in streaming mode, Grepr pipelines will keep track of some state (such as the count and sum of values for an averaging aggregation). To prevent the size of the state from growing indefinitely, Grepr will set a default time-to-live value for any state. If state does not receive updates after this TTL, it will be considered idle and the state will be cleared. Aggregations for will be reset for the idle group for example.

- name: inputs (optional)
  type: object
  description: Input table names that can be referenced in SQL statements. Each input table corresponds to an input stream that is connected to this operation in the job graph. All connected input types must be compatible with the SQL operations. Each type specifies what the schema of the resulting table that is available for the SQL statements looks like. For `COMPLETE_SPAN`, the table schema uses SQL row field names, which differ from the REST JSON property names in the `CompleteSpan` schema.

- name: name (required)
  type: string

- name: statements (required)
  type: array of `SqlExecutable`
  description: List of SQL statements to execute in order. Each statement can reference tables created by previous statements, the input tables, and any tables from the available datasets.

- name: type (required)
  type: enum: `sql-operation`
  description: Processes data through a sequence of SQL statements.

- name: watermarkDelay (optional)
  type: string
  description: Delay for watermark generation. Default is 5 seconds. Watermarks are used to track event time progress in streaming jobs. The watermark is usually the maximum event time seen by a processing task minus this delay. Watermarks are used to trigger time-based operations like windowing. This delay defines how far behind the system can be in processing events before it considers the event time to be 'late'. Late events would not be included in windowing operations that might have already been closed (ie where the data is already sent). This also means that the results of windowing operations will be delayed by this delay, as the system waits for the watermark to catch up. For more information, see the Flink documentation on watermarks.
