java.lang.Object
com.darkcollective.relix.semantic.json.SchemaJson

public final class SchemaJson extends Object
Serializes a Schema to JSON, shared by the logical-plan (LogicalPlanJson) and physical-plan (relix-plan's PhysicalPlanJson) serializers so the encoding is defined once.

A schema is rendered as an object:

{ "open": false, "columns": [ { "name": "id", "type": "N" }, … ] } 
An open (schema-on-read) schema has "open": true and an empty columns array. Column type codes use ScalarType.code().
  • Method Details

    • write

      public static void write(JsonWriter writer, Schema schema)
      Writes schema as a JSON object value into writer.
      Parameters:
      writer - the writer to emit into; must not be null
      schema - the schema to serialize; must not be null