Skip to content

Apache DataFusion SQL Query Engine

ARROW-8985: [Format] Add Decimal::bitWidth field with default value of 128 for forward compatibility

Wes McKinneya16c02da18af
diff --git a/format/Schema.fbs b/format/Schema.fbs
index 63a80b0676..d834f9020f 100644
--- a/format/Schema.fbs
+++ b/format/Schema.fbs
@@ -134,11 +134,22 @@ table FixedSizeBinary {
table Bool {
}
+/// Exact decimal value represented as an integer value in two's
+/// complement. Currently only 128-bit (16-byte) integers are used but this may
+/// be expanded in the future. The representation uses the endianness indicated
+/// in the Schema.
table Decimal {
/// Total number of decimal digits
precision: int;
+
/// Number of digits after the decimal point "."
scale: int;
+
+ /// Number of bits per value. The only accepted width right now is 128 but
+ /// this field exists for forward compatibility so that other bit widths may
+ /// be supported in future format versions. We use bitWidth for consistency
+ /// with Int::bitWidth.
+ bitWidth: int = 128;
}
enum DateUnit: short {