Skip to content

Commit b990efe

Browse files
committed
ARROW-9308: [Format] Add Feature enum for forward compatibility.
Will start a discussion on the mailing list shortly. Closes apache#7502 from emkornfield/feature_flag Authored-by: Micah Kornfield <emkornfield@gmail.com> Signed-off-by: Micah Kornfield <emkornfield@gmail.com>
1 parent ae4eb60 commit b990efe

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

format/Schema.fbs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,35 @@ enum MetadataVersion:short {
4040
V5,
4141
}
4242

43+
/// Represents Arrow Features that might not have full support
44+
/// within implementations. This is intended to be used in
45+
/// two scenarios:
46+
/// 1. A mechanism for readers of Arrow Streams
47+
/// and files to understand that the stream or file makes
48+
/// use of a feature that isn't supported or unknown to
49+
/// the implementation (and therefore can meet the Arrow
50+
/// forward compatibility guarantees).
51+
/// 2. A means of negotiating between a client and server
52+
/// what features a stream is allowed to use. The enums
53+
/// values here are intented to represent higher level
54+
/// features, additional details maybe negotiated
55+
/// with key-value pairs specific to the protocol.
56+
///
57+
/// Enums added to this list should be assigned power-of-two values
58+
/// to facilitate exchanging and comparing bitmaps for supported
59+
/// features.
60+
enum Feature : long {
61+
/// Needed to make flatbuffers happy.
62+
UNUSED = 0,
63+
/// The stream makes use of multiple full dictionaries with the
64+
/// same ID and assumes clients implement dictionary replacement
65+
/// correctly.
66+
DICTIONARY_REPLACEMENT = 1,
67+
/// The stream makes use of compressed bodies as described
68+
/// in Message.fbs.
69+
COMPRESSED_BODY = 2
70+
}
71+
4372
/// These are stored in the flatbuffer in the Type union below
4473

4574
table Null {
@@ -369,6 +398,9 @@ table Schema {
369398
fields: [Field];
370399
// User-defined metadata
371400
custom_metadata: [ KeyValue ];
401+
402+
/// Features used in the stream/file.
403+
features : [ Feature ];
372404
}
373405

374406
root_type Schema;

0 commit comments

Comments
 (0)