namespace vast.fbs.opaque_synopsis;

table v0 {
  /// The serialized synopsis as produced by `caf::serialize()`.
  data: [ubyte];
}

namespace vast.fbs.time_synopsis;

struct v0 {
  /// The earliest timestamp in this column, in nanoseconds since epoch.
  start: int64;

  /// The latest timestamp in this column, in nanoseconds since epoch.
  end: int64;
}

namespace vast.fbs.bool_synopsis;

struct v0 {
  /// Whether this column has any "true" value.
  any_true: bool;

  /// Whether this column has any "false" value.
  any_false: bool;
}

namespace vast.fbs.synopsis;

table v0 {
  /// The caf-serialized record field for this synopsis.
  /// If the name is blank, this is interpreted as a type synopsis.
  // TODO: Use the `Type` flatbuffer once available.
  qualified_record_field: [ubyte];

  /// Synopsis for a bool column.
  bool_synopsis: bool_synopsis.v0;

  /// Synopsis for a time column.
  time_synopsis: time_synopsis.v0;

  /// Other synopsis type with no native flatbuffer layout.
  opaque_synopsis: opaque_synopsis.v0;
}

namespace vast.fbs.partition_synopsis;

table v0 {
  /// Synopses for individual fields.
  // TODO: Split this into separate vectors for field synopses
  // and type synopses.
  synopses: [synopsis.v0];
}

namespace vast.fbs.partition_synopsis;

union PartitionSynopsis {
  v0,
}

namespace vast.fbs;

table PartitionSynopsis {
  partition_synopsis: partition_synopsis.PartitionSynopsis;
}

root_type PartitionSynopsis;

file_identifier "vPSN";
