You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Column Schema is an opt-in feature. All topic-related features (consumer and produce) will work as before. If column schema is enabled, the record and key are interpreted according to a scheme definition very similar to a relation or SQL database. The column schema can be configured using the YAML file. For example, here is a sample schema fruit.yaml
for performing validation. it needs to return Option<Value>
A key column will be used to interpret the key value. All other columns will be used to interpret the value part of the record.
Creating topic with columns
$ fluvio topic create fruits --columns fruit.yaml
topic "fruits" with the column is created
Produce with JSON
The CLI is extended to create column records using a special JSON format. It has two fields key and value JSON field. For example, fruit records can be specified using the following JSON (`fruits.json'):
for JSON consume, output without column applied, use --ignore-columns keyword:
Topic listing
The topic listing will have a new column: COLUMNS to indicate the topic has columns applied:
$ fluvio topic list
NAME COLUMNS TYPE PARTITIONS REPLICAS RETENTION COMPRESSION STATUS REASON
topic-1 computed 1 1 7days any provisioned
fruits Y computed 1 1 7days any provisioned
NOTE:
Add a new column COLUMNS with Y if applied, nothing if not.
The text was updated successfully, but these errors were encountered:
Topic with Columns
Column Schema is an opt-in feature. All topic-related features (consumer and produce) will work as before. If column schema is enabled, the record and key are interpreted according to a scheme definition very similar to a relation or SQL database. The column schema can be configured using the YAML file. For example, here is a sample schema
fruit.yaml
Column Rules
Each column has the following attributes:
Option<Value>
A key column will be used to interpret the key value. All other columns will be used to interpret the value part of the record.
Creating topic with columns
Produce with JSON
The CLI is extended to create column records using a special JSON format. It has two fields
key
andvalue
JSON field. For example, fruit records can be specified using the following JSON (`fruits.json'):Then it can be processed using this syntax:
The parsing behavior is:
Inspecting (consuming) Data
Existing consumer behavior stays the same except following scenarios
Table Output
With column type, we can interpret records as the table directly.
JSON output
Consume with JSON output format applies columns by default (for columnar topics):
for JSON consume, output without column applied, use --ignore-columns keyword:
Topic listing
The topic listing will have a new column:
COLUMNS
to indicate the topic has columns applied:NOTE:
COLUMNS
withY
if applied, nothing if not.The text was updated successfully, but these errors were encountered: