Field

Specification

{
  "name": String,
  "description": String,
  "length": Long
  "fieldType": <field type spec>,
  "fieldIndex": Integer
}

Structure Values

Field NameTypeDescriptionRequiredDefault
nameStringField name.Required
descriptionStringExpanded field information.
None
lengthLongMaximum length of a string that can be stored in this field. Applicable to string field type.
None
fieldTypeString or object

Field data type. Supported types: int, decimal, string, long, float, double, timestamp, date, boolean, binary, array, map, struct.

int, decimal, string, long, float, double, timestamp, date, boolean, binary fields are specified with string values.

array, map, and struct fields are specified with JSON. 

Required
fieldIndexIntegerOrder of the fields in the table.
None

 

Field type specifications for array, map, and struct fields

Array field

{
  "dataType": "array",
  "elementType": <field type spec>
}

Map field

{
  "dataType": "map",
  "keyType": <field type spec>,
  "valueType": <field type spec>
}

Struct field

{
  "dataType": "struct",
  "fields": [
    {
      "name": String,
      "fieldType": <field type spec>
    }
  ]
}

Example

{
  "name": "price",
  "description": "This is the price for which the product sold.",
  "fieldType": "long"
}
Was this article helpful?
0 out of 0 found this helpful