Skip to main content

Row, Schema, and Writers

GitHub source:

The current Go SDK exposes a practical set of row and schema helpers through client/.

Schema and Row Construction​

  • NewSchema(...)
  • NewSchemaFromColumns(...)
  • NewRow(...)
  • ParseSchemaColumns(...)

These helpers are central to the current ergonomic path for both log and primary-key workflows.

Typical Flow​

A very common sequence is:

  1. call TableClient.Schema(...)
  2. parse schema columns from returned JSON
  3. build a public client.Schema
  4. construct rows with NewRow(...)
  5. write or decode using row-oriented helpers

This is the pattern used heavily in the demo harness.

Writer Bootstrap​

The most important helper type for richer write flows is:

  • RowWriterBootstrap

It is produced by:

  • BootstrapRowWriter(ctx, WriterBootstrapOptions{...})

What Bootstrap Pins​

The bootstrap flow can pin:

  • table metadata
  • schema ID
  • key-column information
  • bucket routing decisions
  • Arrow compression behavior
  • optional writer ID state via InitWriter

That makes it the best current bridge between “public row helpers” and “real Fluss write behavior”.

Public Writer-Adjacent Operations​

On the bootstrap object, the major operations are:

  • AppendIndexedRow(...)
  • AppendArrowRows(...)
  • AppendArrowRecord(...)
  • AppendArrowChangelogRows(...)
  • UpsertRow(...)
  • PartialUpdateRow(...)
  • DeleteRow(...)
  • BucketIDForRow(...)

Important public types in this area include:

  • Schema
  • Row
  • SchemaColumn
  • SchemaInfo
  • WriterBootstrapOptions
  • AppendOptions
  • UpsertOptions
  • RowKind
  • ChangelogRow

When to Use This Layer​

Use this layer when you want:

  • Go-native row construction
  • helper-first write flows
  • Arrow-friendly write helpers
  • less direct exposure to raw encoded batches

If you need request-level control over payloads and buckets, the lower-level TableClient raw methods may be a better fit.

Positioning​

This part of the SDK is already useful and significantly more ergonomic than raw batch-only flows, but it is still not the final production-hardened writer story. The docs should present it as the best current helper layer, not as the finished end state.