Documentation
¶
Overview ¶
Package json converts Arrow IPC streams into JSON-serializable result structures that mirror the LinDB sql/execution/model.ResultSet wire format (schema with typed columns + row-oriented data).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnMetadata ¶
ColumnMetadata describes one column in a query result schema. DataType is the Arrow-derived type name (via pkg/arrow.DataTypeName), e.g. "string" for tag columns, "time_series" / "sum" / "min" for metric fields. The JSON tag "type" matches the LinDB wire format (spi/types.ColumnMetadata).
type ResultSet ¶
type ResultSet struct {
Schema *Schema `json:"schema,omitempty"`
Rows [][]any `json:"rows,omitempty"`
}
ResultSet is the query result returned by the LinDB datasource. It mirrors the structure of LinDB sql/execution/model.ResultSet.
func DecodeArrowToResultSet ¶
DecodeArrowToResultSet reads an Arrow IPC stream from data and converts it into a ResultSet whose structure mirrors LinDB sql/execution/model.ResultSet (schema with typed columns + row-oriented data). Returns nil without error when data is empty.
func DecodeRecordToResultSet ¶
func DecodeRecordToResultSet(rec arrow.RecordBatch) (*ResultSet, error)
DecodeRecordToResultSet converts a single arrow.RecordBatch directly into a ResultSet without any intermediate IPC serialization. Prefer this over DecodeArrowToResultSet when the RecordBatch is already in memory.
type Schema ¶
type Schema struct {
Columns []ColumnMetadata `json:"columns,omitempty"`
}
Schema describes the columns of a query result set.
type TimeSeries ¶
type TimeSeries struct {
Values []float64 `json:"values,omitempty"`
TimeRange TimeRange `json:"timeRange"`
Interval int64 `json:"interval,omitempty"`
NumOfPoints int `json:"numOfPoints,omitempty"`
}
TimeSeries represents time series data for one field in a result row. Its structure mirrors LinDB spi/types.TimeSeries.