Skip to content

Creating a File With Decimal Columns

Selfeer edited this page Nov 12, 2024 · 1 revision

Decimal That Fits Into INT32 Physical Type

Full example here

  {
    "name": "decimal_int32",
    "schemaType": "required",
    "physicalType": "INT32",
    "logicalType": "DECIMAL",
    "precision": 3,
    "scale": 2,
    "data": [123, 321, 424]
  }

Large Decimal That Doesn't Fit Into INT32 Physical Type

Full example here

  {
    "name": "decimal_int64",
    "schemaType": "required",
    "physicalType": "INT64",
    "logicalType": "DECIMAL",
    "precision": 10,
    "scale": 3,
    "data": [2147483648, 2147483649, 2147483650]
  }

Decimal Annotated To BINARY

Full example here

  {
  "name": "decimal_binary",
  "schemaType": "required",
  "physicalType": "BINARY",
  "logicalType": "DECIMAL",
  "precision": 10,
  "scale": 3,
  "data": ["213", "421", "1234"]
}
Clone this wiki locally