From f2ba6e4316de96c87c52773b668ded8a2901bfa3 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Thu, 12 Aug 2021 20:03:27 -0400 Subject: [PATCH 01/96] draft --- cpp/build-support/update-flatbuffers.sh | 1 + format/ComputeIR.fbs | 100 ++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 format/ComputeIR.fbs diff --git a/cpp/build-support/update-flatbuffers.sh b/cpp/build-support/update-flatbuffers.sh index ac870ff12783e..3106b6bb5c311 100755 --- a/cpp/build-support/update-flatbuffers.sh +++ b/cpp/build-support/update-flatbuffers.sh @@ -27,6 +27,7 @@ FLATC="flatc -c --cpp-std c++11" $FLATC -o $SOURCE_DIR/generated \ --scoped-enums \ + $FORMAT_DIR/ComputeIR.fbs \ $FORMAT_DIR/Message.fbs \ $FORMAT_DIR/File.fbs \ $FORMAT_DIR/Schema.fbs \ diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs new file mode 100644 index 0000000000000..9d5c8b18a4fe0 --- /dev/null +++ b/format/ComputeIR.fbs @@ -0,0 +1,100 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +include "Schema.fbs"; + +namespace org.apache.arrow.flatbuf.computeir; + +table Literal { + /// Number of slots. If this is absent, the literal should be considered scalar. + length: long; + + type: Type; + + buffers: [Buffer]; +} + +table FieldRef { + path: [string]; + + relation_index: int; // 0 for left-of-join, 1 for right-of-join, ... +} + +table Call { + function_name: string; + + arguments: [Expression]; + + options: [ubyte]; // user defined data +} + +union Expression { + Literal, FieldRef, Call +} + +table Operation { + /// name is in a namespace known to the producer + /// names with no namespace are reserved for pure relational algebraic operations + /// current operations would include: + /// "filter" + /// "project" + /// "aggregate" + /// "join" + /// ... + name: string; + + out_schema: Schema; + + inputs: [Operation]; + + options: [ubyte]; // user defined data +} + +/// associated with Operation.name = "filter" +table FilterOptions { + filter_expression: Expression; +} + +/// associated with Operation.name = "project" +table ProjectOptions { + expressions: [Expression]; + names: [string]; +} + +/// associated with Operation.name = "aggregate" +table AggregateOptions { + aggregations: [Expression]; + names: [string]; + keys: [Expression]; +} + +enum JoinKind : int { + INNER, + LEFT, + RIGHT, + FULL, + SEMI, + ANTI, +} + +/// associated with Operation.name = "join" +table JoinOptions { + on_expressions: [Expression]; + join_kind: JoinKind; +} + +root_type Operation; From 760c804efca272dafc9a6ff519eaa67d99af6334 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 14:48:23 -0400 Subject: [PATCH 02/96] [RFC] Arrow Compute Serialized Intermediate Representation draft for discussion --- cpp/build-support/update-flatbuffers.sh | 3 +- format/ComputeIR.ExampleExtensions.fbs | 113 +++++++++++++++++ format/ComputeIR.fbs | 158 +++++++++++++++++++----- 3 files changed, 244 insertions(+), 30 deletions(-) create mode 100644 format/ComputeIR.ExampleExtensions.fbs diff --git a/cpp/build-support/update-flatbuffers.sh b/cpp/build-support/update-flatbuffers.sh index 3106b6bb5c311..8cb8967dfe592 100755 --- a/cpp/build-support/update-flatbuffers.sh +++ b/cpp/build-support/update-flatbuffers.sh @@ -28,12 +28,13 @@ FLATC="flatc -c --cpp-std c++11" $FLATC -o $SOURCE_DIR/generated \ --scoped-enums \ $FORMAT_DIR/ComputeIR.fbs \ + $FORMAT_DIR/ComputeIR.ExampleExtensions.fbs \ $FORMAT_DIR/Message.fbs \ $FORMAT_DIR/File.fbs \ $FORMAT_DIR/Schema.fbs \ $FORMAT_DIR/Tensor.fbs \ $FORMAT_DIR/SparseTensor.fbs \ - src/arrow/ipc/feather.fbs + $SOURCE_DIR/arrow/ipc/feather.fbs $FLATC -o $SOURCE_DIR/plasma \ --gen-object-api \ diff --git a/format/ComputeIR.ExampleExtensions.fbs b/format/ComputeIR.ExampleExtensions.fbs new file mode 100644 index 0000000000000..f537b57a026fe --- /dev/null +++ b/format/ComputeIR.ExampleExtensions.fbs @@ -0,0 +1,113 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +include "Schema.fbs"; +include "ComputeIR.fbs"; + +namespace org.apache.arrow.flatbuf.computeir.ext; + +///////////////////////////////////////////////////////////// +// Example source relations: + +// RFC 3986, section 3 +table Uri { + schema: string (required); + userinfo: string; + host: string (required); + port: ushort; + path: string (required); + query: [KeyValue]; + fragment: string; +} + +/// The contents of Relation.options will be Sql_FromOptions +/// if Relation.name = "sql::from" +table Sql_FromOptions { + /// The name of a table referenced as a source relation. + name: string (required); +} + +table Partitioning { + /// Currently supported: "hive", "directory" + flavor: string (required); + + /// Fields on which data is partitioned + schema: Schema (required); +} + +table FileFormat { + /// E.g. "parquet", "csv", ... + name: string (required); + options: Blob; +} + +/// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions +/// if Relation.name = "arrow::filesystem_dataset_scan" +table Arrow_FileSystemDatasetScanOptions { + /// The base directory of a dataset which should be scanned + /// as a source relation. A URI is used to accommodate potentially + /// remote file systems. + base_dir: Uri (required); + + /// The format of files in this dataset. + format: FileFormat (required); + + /// A partitioning scheme in use in this dataset. + partitioning: Partitioning; +} + +///////////////////////////////////////////////////////////// +// Example output relations: + +/// The contents of Relation.options will be Sql_IntoOptions +/// if Relation.name = "sql::into" +table Sql_IntoOptions { + /// The name of a table into which rows will be inserted. + name: string (required); + + /// Whether rows written into the table should be appended + /// to the table's current rows (INSERT INTO). + /// If false, the table will be overwritten (INTO). + append: bool = true; +} + +/// The contents of Relation.options will be Arrow_StreamOutOptions +/// if Relation.name = "arrow::stream_out" +table Arrow_StreamOutOptions { + /// The URI to which RecordBatches of output should be streamed. + destination: Uri (required); +} + +/// The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions +/// if Relation.name = "arrow::filesystem_dataset_write" +table Arrow_FileSystemDatasetWriteOptions { + /// The base directory of a dataset into which output batches should be + /// written. A URI is used to accommodate potentially remote file systems. + /// Files present in this directory will not be explicitly deleted, though + /// they may be overwritten. + base_dir: Uri (required); + + /// The format in which to write files. + format: FileFormat (required); + + /// A partitioning scheme which should be used when writing this dataset. + partitioning: Partitioning; + + /// Template string used to generate written files' basenames. + /// {i} will be replaced by an auto incremented integer. + basename_template: string (required); +} diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 9d5c8b18a4fe0..bf0685de62ed0 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -16,69 +16,118 @@ // under the License. include "Schema.fbs"; +include "Message.fbs"; namespace org.apache.arrow.flatbuf.computeir; +/// Wrapper for blobs of arbitrary bytes +table Blob { + bytes: [ubyte]; +} + +/// An expression is one of +/// - a Literal datum +/// - a reference to a Field from a Relation +/// - a call to a named function +/// On evaluation, an Expression will have either array or scalar shape. +union Expression { + Literal, FieldRef, Call +} + table Literal { - /// Number of slots. If this is absent, the literal should be considered scalar. + /// Number of slots. If this is absent, the literal should be + /// considered scalar. length: long; - type: Type; + /// The type of this literal. + type: Type (required); + /// Buffers containing `length` elements of arrow-formatted data. + /// If `length` is absent (this Literal is scalar), these buffers + /// are sized to accommodate a single element of arrow-formatted data. + /// XXX this can be optimized for trivial scalars later buffers: [Buffer]; } table FieldRef { + /// A sequence of field names to allow referencing potentially nested fields path: [string]; - relation_index: int; // 0 for left-of-join, 1 for right-of-join, ... + /// For Expressions which might reference fields in multiple Relations, + /// this index may be provided to indicate which Relation's fields + /// `path` points into. For example in the case of a join, + /// 0 refers to the left relation and 1 to the right relation. + relation_index: int; + + /// The type of data in the referenced Field. + type: Type; } table Call { - function_name: string; + /// The name of the function whose invocation this Call represents. + function_name: string (required); - arguments: [Expression]; + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + options: Blob; - options: [ubyte]; // user defined data -} + /// The arguments passed to `function_name`. + arguments: [Expression] (required); -union Expression { - Literal, FieldRef, Call + /// The type of data which invoking `function_name` will return. + type: Type; } -table Operation { - /// name is in a namespace known to the producer - /// names with no namespace are reserved for pure relational algebraic operations - /// current operations would include: +/// A relation is a set of rows with consitent schema. +table Relation { + /// The namespaced name of this Relation. + /// + /// Names with no namespace are reserved for pure relational + /// algebraic operations, which currently include: /// "filter" /// "project" /// "aggregate" /// "join" - /// ... - name: string; + /// "order_by" + /// "limit" + /// "literal" + relation_name: string (required); - out_schema: Schema; + /// Parameters for `relation_name`; content/format may be unique to each + /// value of `relation_name`. + options: Blob; - inputs: [Operation]; + /// The arguments passed to `relation_name`. + arguments: [Relation] (required); - options: [ubyte]; // user defined data + /// The schema of rows in this Relation + schema: Schema; } -/// associated with Operation.name = "filter" +/// The contents of Relation.options will be FilterOptions +/// if Relation.name = "filter" table FilterOptions { - filter_expression: Expression; + /// The expression which will be evaluated against input rows + /// to determine whether they should be excluded from the + /// "filter" relation's output. + filter_expression: Expression (required); } -/// associated with Operation.name = "project" +/// The contents of Relation.options will be ProjectOptions +/// if Relation.name = "project" table ProjectOptions { - expressions: [Expression]; - names: [string]; + /// Expressions which will be evaluated to produce to + /// the rows of the "project" relation's output. + expressions: [Expression] (required); } -/// associated with Operation.name = "aggregate" +/// The contents of Relation.options will be AggregateOptions +/// if Relation.name = "aggregate" table AggregateOptions { - aggregations: [Expression]; - names: [string]; + /// Expressions which will be evaluated to produce to + /// the rows of the "aggregate" relation's output. + aggregations: [Expression] (required); + /// Keys by which `aggregations` will be grouped. keys: [Expression]; } @@ -91,10 +140,61 @@ enum JoinKind : int { ANTI, } -/// associated with Operation.name = "join" +/// The contents of Relation.options will be JoinOptions +/// if Relation.name = "join" table JoinOptions { - on_expressions: [Expression]; + /// The expression which will be evaluated against rows from each + /// input to determine whether they should be included in the + /// "join" relation's output. + on_expression: Expression (required); join_kind: JoinKind; } -root_type Operation; +/// Whether lesser values should precede greater or vice versa. +enum Ordering : uint8 { + ASCENDING, + DESCENDING, +} + +/// Whether nulls should precede or follow other values. +enum NullOrdering : uint8 { + FIRST, + LAST +} + +table SortKey { + value: Expression (required); + ordering: Ordering = ASCENDING; + null_ordering: NullOrdering = LAST; +} + +/// The contents of Relation.options will be OrderByOptions +/// if Relation.name = "order_by" +table OrderByOptions { + /// Define sort order for rows of output. + /// Keys with higher precedence are ordered ahead of other keys. + keys: [SortKey] (required); +} + +/// The contents of Relation.options will be LimitOptions +/// if Relation.name = "limit" +table LimitOptions { + /// Set the maximum number of rows of output. + count: long; +} + +/// The contents of Relation.options will be LiteralOptions +/// if Relation.name = "literal" +table LiteralOptions { + /// Batches of rows in this literal. + batches: [RecordBatch] (required); + /// A dictionary batch for this literal. + dictionary_batch: DictionaryBatch; +} + +table Plan { + /// One or more output relations. + sinks: [Relation] (required); +} + +root_type Plan; From 13c5bbac88782cc36467211cf338fc19941fa632 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 15:33:25 -0400 Subject: [PATCH 03/96] add interactive_output relation --- format/ComputeIR.fbs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index bf0685de62ed0..0024d47ffe8f2 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -91,6 +91,7 @@ table Relation { /// "order_by" /// "limit" /// "literal" + /// "interactive_output" relation_name: string (required); /// Parameters for `relation_name`; content/format may be unique to each @@ -192,6 +193,15 @@ table LiteralOptions { dictionary_batch: DictionaryBatch; } +/// The contents of Relation.options will be InteractiveOutputOptions +/// if Relation.name = "interactive_output" +table InteractiveOutputOptions { + /// In an interactive context there is an implicit pipe open between + /// the producer and the consumer along which output may be sent. + /// `id` is an opaque identifier for such outputs. + id: long; +} + table Plan { /// One or more output relations. sinks: [Relation] (required); From 8cd9894bd9531bc739227725f051f465680e5666 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 15:38:52 -0400 Subject: [PATCH 04/96] Update format/ComputeIR.fbs --- format/ComputeIR.fbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 0024d47ffe8f2..291aa80b47e2a 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -198,7 +198,8 @@ table LiteralOptions { table InteractiveOutputOptions { /// In an interactive context there is an implicit pipe open between /// the producer and the consumer along which output may be sent. - /// `id` is an opaque identifier for such outputs. + /// `id` is an opaque identifier for such outputs; for example it could be used to + /// identify which Jupyter output cell should receive the output. id: long; } From 8cd6c4684d112b944fe8f14758855ce47bd6c182 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 16:18:18 -0400 Subject: [PATCH 05/96] add explicit shaping for Literals --- format/ComputeIR.fbs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 291aa80b47e2a..92423acaec8c3 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -34,10 +34,20 @@ union Expression { Literal, FieldRef, Call } -table Literal { - /// Number of slots. If this is absent, the literal should be - /// considered scalar. +union Shape { + ArrayShape, ScalarShape +} + +table ScalarShape {} + +table ArrayShape { + /// Number of slots. length: long; +} + +table Literal { + /// Shape of this literal. + shape: Shape (required); /// The type of this literal. type: Type (required); From 7bcb504a26783f82c07c1aea1cd39567fc045d65 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 15:41:21 -0400 Subject: [PATCH 06/96] Update format/ComputeIR.fbs --- format/ComputeIR.fbs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 92423acaec8c3..beb48ae5a69fb 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -208,9 +208,7 @@ table LiteralOptions { table InteractiveOutputOptions { /// In an interactive context there is an implicit pipe open between /// the producer and the consumer along which output may be sent. - /// `id` is an opaque identifier for such outputs; for example it could be used to - /// identify which Jupyter output cell should receive the output. - id: long; + options: Blob; } table Plan { From f2e319abece05f275befbd32294e3c0b3159ab0d Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 16:37:47 -0400 Subject: [PATCH 07/96] allow join_kind to be an arbitrary string --- format/ComputeIR.fbs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index beb48ae5a69fb..bf67f4b9a7165 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -142,15 +142,6 @@ table AggregateOptions { keys: [Expression]; } -enum JoinKind : int { - INNER, - LEFT, - RIGHT, - FULL, - SEMI, - ANTI, -} - /// The contents of Relation.options will be JoinOptions /// if Relation.name = "join" table JoinOptions { @@ -158,7 +149,7 @@ table JoinOptions { /// input to determine whether they should be included in the /// "join" relation's output. on_expression: Expression (required); - join_kind: JoinKind; + join_kind: string; } /// Whether lesser values should precede greater or vice versa. From 134faee73933678a773f1d38c625c523dcbb66ab Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 21:17:43 -0400 Subject: [PATCH 08/96] ensure Blob.bytes are aligned --- format/ComputeIR.fbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index bf67f4b9a7165..de9854b28a012 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -22,7 +22,8 @@ namespace org.apache.arrow.flatbuf.computeir; /// Wrapper for blobs of arbitrary bytes table Blob { - bytes: [ubyte]; + // ulong is used instead of ubyte to guarantee alignment + bytes: [ulong]; } /// An expression is one of From 213964a1f6d3eee0f5e079034735f05aed650f0c Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 21:20:14 -0400 Subject: [PATCH 09/96] use a single enum to specify ordering --- format/ComputeIR.fbs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index de9854b28a012..c718a5e2a501e 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -153,22 +153,18 @@ table JoinOptions { join_kind: string; } -/// Whether lesser values should precede greater or vice versa. +/// Whether lesser values should precede greater or vice versa, +/// whether nulls should preced or follow values. enum Ordering : uint8 { - ASCENDING, - DESCENDING, -} - -/// Whether nulls should precede or follow other values. -enum NullOrdering : uint8 { - FIRST, - LAST + ASCENDING_THEN_NULLS, + NULLS_THEN_ASCENDING, + DESCENDING_THEN_NULLS, + NULLS_THEN_DESCENDING } table SortKey { value: Expression (required); - ordering: Ordering = ASCENDING; - null_ordering: NullOrdering = LAST; + ordering: Ordering = ASCENDING_THEN_NULLS; } /// The contents of Relation.options will be OrderByOptions From 194d51be006db9a0ab93eb02d23e5288c2ae6643 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Fri, 13 Aug 2021 19:59:37 -0400 Subject: [PATCH 10/96] Update format/ComputeIR.fbs Co-authored-by: Keith Kraus <3665167+kkraus14@users.noreply.github.com> --- format/ComputeIR.fbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index c718a5e2a501e..5d5599e8e2fce 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -89,7 +89,7 @@ table Call { type: Type; } -/// A relation is a set of rows with consitent schema. +/// A relation is a set of rows with consistent schema. table Relation { /// The namespaced name of this Relation. /// From a6b107b475c67107ed611b1b7a83a2909195fadf Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Sat, 14 Aug 2021 08:19:17 -0400 Subject: [PATCH 11/96] Use Buffers for byte blobs --- format/ComputeIR.ExampleExtensions.fbs | 2 +- format/ComputeIR.fbs | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/format/ComputeIR.ExampleExtensions.fbs b/format/ComputeIR.ExampleExtensions.fbs index f537b57a026fe..b545cea97f4df 100644 --- a/format/ComputeIR.ExampleExtensions.fbs +++ b/format/ComputeIR.ExampleExtensions.fbs @@ -52,7 +52,7 @@ table Partitioning { table FileFormat { /// E.g. "parquet", "csv", ... name: string (required); - options: Blob; + options: Buffer; } /// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 5d5599e8e2fce..d96052eb982c2 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -20,12 +20,6 @@ include "Message.fbs"; namespace org.apache.arrow.flatbuf.computeir; -/// Wrapper for blobs of arbitrary bytes -table Blob { - // ulong is used instead of ubyte to guarantee alignment - bytes: [ulong]; -} - /// An expression is one of /// - a Literal datum /// - a reference to a Field from a Relation @@ -80,7 +74,7 @@ table Call { /// Parameters for `function_name`; content/format may be unique to each /// value of `function_name`. - options: Blob; + options: Buffer; /// The arguments passed to `function_name`. arguments: [Expression] (required); @@ -107,7 +101,7 @@ table Relation { /// Parameters for `relation_name`; content/format may be unique to each /// value of `relation_name`. - options: Blob; + options: Buffer; /// The arguments passed to `relation_name`. arguments: [Relation] (required); @@ -196,7 +190,7 @@ table LiteralOptions { table InteractiveOutputOptions { /// In an interactive context there is an implicit pipe open between /// the producer and the consumer along which output may be sent. - options: Blob; + options: Buffer; } table Plan { From 38731e20ece94ef839fc7897225f29c26b426ce4 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Sat, 14 Aug 2021 17:12:19 -0400 Subject: [PATCH 12/96] clarify interactive_output by adding an rpc_service --- format/ComputeIR.fbs | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index d96052eb982c2..7c9f7459fe5ea 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -148,11 +148,11 @@ table JoinOptions { } /// Whether lesser values should precede greater or vice versa, -/// whether nulls should preced or follow values. +/// also whether nulls should preced or follow values. enum Ordering : uint8 { ASCENDING_THEN_NULLS, - NULLS_THEN_ASCENDING, DESCENDING_THEN_NULLS, + NULLS_THEN_ASCENDING, NULLS_THEN_DESCENDING } @@ -181,21 +181,33 @@ table LimitOptions { table LiteralOptions { /// Batches of rows in this literal. batches: [RecordBatch] (required); - /// A dictionary batch for this literal. - dictionary_batch: DictionaryBatch; -} - -/// The contents of Relation.options will be InteractiveOutputOptions -/// if Relation.name = "interactive_output" -table InteractiveOutputOptions { - /// In an interactive context there is an implicit pipe open between - /// the producer and the consumer along which output may be sent. - options: Buffer; } +/// A specification of a query. table Plan { /// One or more output relations. sinks: [Relation] (required); + + /// Dictionary batches which may be referenced by Literals. + dictionary_batch: [DictionaryBatch]; +} + +/// Frequently there is an open direct channel between producers +/// of queries (client) and their consumers (server). +/// `Interactive` is provided to reify this case: +rpc_service Interactive { + /// Restructure the provided Plan into one which contains only + /// Relations that are directly executable by the server. + /// These relations will usually be opaque to the client, but should + /// be descriptively named and validly structured to provide a client + /// with information on how the query will be executed. + explain(Plan): Plan (streaming: "none"); + + /// Execute a Plan. + /// The Plan may contain a single Relation with name="interactive_output", + /// in which case data which is received by that sink will be streamed back + /// to the client. + execute(Plan): Message (streaming: "server"); } root_type Plan; From 4e087577f51646df472d6a3b06c93a18cb6fa8c9 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Sun, 15 Aug 2021 15:06:58 -0400 Subject: [PATCH 13/96] add common, union relations --- format/ComputeIR.fbs | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 7c9f7459fe5ea..640a316d3ca2d 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -95,6 +95,8 @@ table Relation { /// "join" /// "order_by" /// "limit" + /// "common" + /// "union" /// "literal" /// "interactive_output" relation_name: string (required); @@ -111,7 +113,7 @@ table Relation { } /// The contents of Relation.options will be FilterOptions -/// if Relation.name = "filter" +/// if Relation.relation_name = "filter" table FilterOptions { /// The expression which will be evaluated against input rows /// to determine whether they should be excluded from the @@ -120,7 +122,7 @@ table FilterOptions { } /// The contents of Relation.options will be ProjectOptions -/// if Relation.name = "project" +/// if Relation.relation_name = "project" table ProjectOptions { /// Expressions which will be evaluated to produce to /// the rows of the "project" relation's output. @@ -128,7 +130,7 @@ table ProjectOptions { } /// The contents of Relation.options will be AggregateOptions -/// if Relation.name = "aggregate" +/// if Relation.relation_name = "aggregate" table AggregateOptions { /// Expressions which will be evaluated to produce to /// the rows of the "aggregate" relation's output. @@ -138,7 +140,7 @@ table AggregateOptions { } /// The contents of Relation.options will be JoinOptions -/// if Relation.name = "join" +/// if Relation.relation_name = "join" table JoinOptions { /// The expression which will be evaluated against rows from each /// input to determine whether they should be included in the @@ -162,7 +164,7 @@ table SortKey { } /// The contents of Relation.options will be OrderByOptions -/// if Relation.name = "order_by" +/// if Relation.relation_name = "order_by" table OrderByOptions { /// Define sort order for rows of output. /// Keys with higher precedence are ordered ahead of other keys. @@ -170,14 +172,31 @@ table OrderByOptions { } /// The contents of Relation.options will be LimitOptions -/// if Relation.name = "limit" +/// if Relation.relation_name = "limit" table LimitOptions { /// Set the maximum number of rows of output. count: long; } +/// The contents of Relation.options will be CommonOptions +/// if Relation.relation_name = "common" +table CommonOptions { + /// Commons (CTEs in SQL) allow assigning a name to a stream + /// of data and reusing it, potentially multiple times and + /// potentially recursively. + name: string; +} + +/// The contents of Relation.options will be UnionOptions +/// if Relation.relation_name = "union" +table UnionOptions { + /// For simplicity, all rows from any input to a "union" relation + /// will always be concatenated into a single output- establishing + /// uniqueness of output rows is deferred to other relations. +} + /// The contents of Relation.options will be LiteralOptions -/// if Relation.name = "literal" +/// if Relation.relation_name = "literal" table LiteralOptions { /// Batches of rows in this literal. batches: [RecordBatch] (required); @@ -204,9 +223,9 @@ rpc_service Interactive { explain(Plan): Plan (streaming: "none"); /// Execute a Plan. - /// The Plan may contain a single Relation with name="interactive_output", - /// in which case data which is received by that sink will be streamed back - /// to the client. + /// The Plan may contain a single Relation with + /// relation_name="interactive_output", in which case data which + /// is received by that sink will be streamed back to the client. execute(Plan): Message (streaming: "server"); } From 58176d828407af6e8d1c36cd4f3fc20011c66ef8 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Mon, 16 Aug 2021 12:51:36 -0400 Subject: [PATCH 14/96] add ComputeIR.rst with basic introduction to Compute IR --- docs/source/format/ComputeIR.rst | 59 ++++++++++++++++++++++++++++++++ format/ComputeIR.fbs | 5 +++ 2 files changed, 64 insertions(+) create mode 100644 docs/source/format/ComputeIR.rst diff --git a/docs/source/format/ComputeIR.rst b/docs/source/format/ComputeIR.rst new file mode 100644 index 0000000000000..9ebe1d5afb263 --- /dev/null +++ b/docs/source/format/ComputeIR.rst @@ -0,0 +1,59 @@ +.. Licensed to the Apache Software Foundation (ASF) under one +.. or more contributor license agreements. See the NOTICE file +.. distributed with this work for additional information +.. regarding copyright ownership. The ASF licenses this file +.. to you under the Apache License, Version 2.0 (the +.. "License"); you may not use this file except in compliance +.. with the License. You may obtain a copy of the License at + +.. http://www.apache.org/licenses/LICENSE-2.0 + +.. Unless required by applicable law or agreed to in writing, +.. software distributed under the License is distributed on an +.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +.. KIND, either express or implied. See the License for the +.. specific language governing permissions and limitations +.. under the License. + +********************************************** +Arrow Compute IR (Intermediate Representation) +********************************************** + +In the same way that the Arrow format provides a powerful tool +for communicating data, Compute IR is intended to provide a +consistent format for representing analytical operations against +that data. As an arrow-native expression of computation it includes +information such as explicit types and schemas and arrow formatted +literal data. It is also optimized for low runtime overhead in both +serialization and deserialization. + +Built-in definitions are included to enable representation of +relational algebraic operations- the contents of a "logical query plan". +Compute IR also has first class support for representing operations +which are not members of a minimal relational algebra, including +implementation and optimization details- the contents of a "physical +query plan". This approach is taken in emulation of `MLIR`_ (Multi-Level +Intermediate Representation), a system which has had strong successes in +spaces of comparable complexity to representation of analytic operations. +To borrow terms from that project, there are two mutations of interest: + +* Replacement of representations with semantically equivalent representations + which will yield better performance for consumers- an optimization pass. +* Replacement of abstract or generic representations with more specific + and potentially consumer-specific representations- a lowering pass. + This modification corresponds to the translation of a logical plan + to a physical plan. + +Allowing representation of physical plans (and plans which are between +logical and physical) in Compute IR enables systems to define incremental +optimization and lowering passes which operate on and produce valid +Compute IR. This in turn enables communication, manipulation, and inspection +at every stage of lowering/optimization by the same tools +used for logical-plan-equivalent-IR. This is especially useful for systems +where such passes may depend on information only available on every node +of a distributed consumer (for example statistics unique to that node's +local data) or may not be universal to all backends in a heterogeneous +consumer (for example which optimizations nodes are capable of for +non equi joins). + +.. _MLIR: https://mlir.llvm.org diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 640a316d3ca2d..e84bdaf16d30c 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -209,6 +209,11 @@ table Plan { /// Dictionary batches which may be referenced by Literals. dictionary_batch: [DictionaryBatch]; + + /// If this Plan was derived from another (for example by running + /// an optimization pass), that plan may be included here to + /// provide a backtrace of derivations. + derived_from: Plan; } /// Frequently there is an open direct channel between producers From 62ec6c94e23d73a77ec60e7c617df614d9767766 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Mon, 16 Aug 2021 13:25:35 -0400 Subject: [PATCH 15/96] add gRPC generation, don't require vector-of-unions --- cpp/build-support/update-flatbuffers.sh | 2 +- .../ComputeIR.ExampleExtensions_generated.h | 680 ++++++ cpp/src/generated/ComputeIR.grpc.fb.cc | 97 + cpp/src/generated/ComputeIR.grpc.fb.h | 230 ++ cpp/src/generated/ComputeIR_generated.h | 2077 +++++++++++++++++ format/ComputeIR.fbs | 6 +- 6 files changed, 3090 insertions(+), 2 deletions(-) create mode 100644 cpp/src/generated/ComputeIR.ExampleExtensions_generated.h create mode 100644 cpp/src/generated/ComputeIR.grpc.fb.cc create mode 100644 cpp/src/generated/ComputeIR.grpc.fb.h create mode 100644 cpp/src/generated/ComputeIR_generated.h diff --git a/cpp/build-support/update-flatbuffers.sh b/cpp/build-support/update-flatbuffers.sh index 8cb8967dfe592..5c1528e5cb671 100755 --- a/cpp/build-support/update-flatbuffers.sh +++ b/cpp/build-support/update-flatbuffers.sh @@ -23,7 +23,7 @@ CWD="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)" SOURCE_DIR=$CWD/../src FORMAT_DIR=$CWD/../../format -FLATC="flatc -c --cpp-std c++11" +FLATC="flatc --cpp --grpc --cpp-std c++11" $FLATC -o $SOURCE_DIR/generated \ --scoped-enums \ diff --git a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h new file mode 100644 index 0000000000000..0f65c034443e9 --- /dev/null +++ b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h @@ -0,0 +1,680 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_EXT_H_ +#define FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_EXT_H_ + +#include "flatbuffers/flatbuffers.h" + +#include "ComputeIR_generated.h" +#include "Message_generated.h" +#include "Schema_generated.h" +#include "SparseTensor_generated.h" +#include "Tensor_generated.h" + +namespace org { +namespace apache { +namespace arrow { +namespace flatbuf { +namespace computeir { +namespace ext { + +struct Uri; +struct UriBuilder; + +struct Sql_FromOptions; +struct Sql_FromOptionsBuilder; + +struct Partitioning; +struct PartitioningBuilder; + +struct FileFormat; +struct FileFormatBuilder; + +struct Arrow_FileSystemDatasetScanOptions; +struct Arrow_FileSystemDatasetScanOptionsBuilder; + +struct Sql_IntoOptions; +struct Sql_IntoOptionsBuilder; + +struct Arrow_StreamOutOptions; +struct Arrow_StreamOutOptionsBuilder; + +struct Arrow_FileSystemDatasetWriteOptions; +struct Arrow_FileSystemDatasetWriteOptionsBuilder; + +///////////////////////////////////////////////////////////// +struct Uri FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UriBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SCHEMA = 4, + VT_USERINFO = 6, + VT_HOST = 8, + VT_PORT = 10, + VT_PATH = 12, + VT_QUERY = 14, + VT_FRAGMENT = 16 + }; + const flatbuffers::String *schema() const { + return GetPointer(VT_SCHEMA); + } + const flatbuffers::String *userinfo() const { + return GetPointer(VT_USERINFO); + } + const flatbuffers::String *host() const { + return GetPointer(VT_HOST); + } + uint16_t port() const { + return GetField(VT_PORT, 0); + } + const flatbuffers::String *path() const { + return GetPointer(VT_PATH); + } + const flatbuffers::Vector> *query() const { + return GetPointer> *>(VT_QUERY); + } + const flatbuffers::String *fragment() const { + return GetPointer(VT_FRAGMENT); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyString(schema()) && + VerifyOffset(verifier, VT_USERINFO) && + verifier.VerifyString(userinfo()) && + VerifyOffsetRequired(verifier, VT_HOST) && + verifier.VerifyString(host()) && + VerifyField(verifier, VT_PORT) && + VerifyOffsetRequired(verifier, VT_PATH) && + verifier.VerifyString(path()) && + VerifyOffset(verifier, VT_QUERY) && + verifier.VerifyVector(query()) && + verifier.VerifyVectorOfTables(query()) && + VerifyOffset(verifier, VT_FRAGMENT) && + verifier.VerifyString(fragment()) && + verifier.EndTable(); + } +}; + +struct UriBuilder { + typedef Uri Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Uri::VT_SCHEMA, schema); + } + void add_userinfo(flatbuffers::Offset userinfo) { + fbb_.AddOffset(Uri::VT_USERINFO, userinfo); + } + void add_host(flatbuffers::Offset host) { + fbb_.AddOffset(Uri::VT_HOST, host); + } + void add_port(uint16_t port) { + fbb_.AddElement(Uri::VT_PORT, port, 0); + } + void add_path(flatbuffers::Offset path) { + fbb_.AddOffset(Uri::VT_PATH, path); + } + void add_query(flatbuffers::Offset>> query) { + fbb_.AddOffset(Uri::VT_QUERY, query); + } + void add_fragment(flatbuffers::Offset fragment) { + fbb_.AddOffset(Uri::VT_FRAGMENT, fragment); + } + explicit UriBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UriBuilder &operator=(const UriBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Uri::VT_SCHEMA); + fbb_.Required(o, Uri::VT_HOST); + fbb_.Required(o, Uri::VT_PATH); + return o; + } +}; + +inline flatbuffers::Offset CreateUri( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset schema = 0, + flatbuffers::Offset userinfo = 0, + flatbuffers::Offset host = 0, + uint16_t port = 0, + flatbuffers::Offset path = 0, + flatbuffers::Offset>> query = 0, + flatbuffers::Offset fragment = 0) { + UriBuilder builder_(_fbb); + builder_.add_fragment(fragment); + builder_.add_query(query); + builder_.add_path(path); + builder_.add_host(host); + builder_.add_userinfo(userinfo); + builder_.add_schema(schema); + builder_.add_port(port); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUriDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *schema = nullptr, + const char *userinfo = nullptr, + const char *host = nullptr, + uint16_t port = 0, + const char *path = nullptr, + const std::vector> *query = nullptr, + const char *fragment = nullptr) { + auto schema__ = schema ? _fbb.CreateString(schema) : 0; + auto userinfo__ = userinfo ? _fbb.CreateString(userinfo) : 0; + auto host__ = host ? _fbb.CreateString(host) : 0; + auto path__ = path ? _fbb.CreateString(path) : 0; + auto query__ = query ? _fbb.CreateVector>(*query) : 0; + auto fragment__ = fragment ? _fbb.CreateString(fragment) : 0; + return org::apache::arrow::flatbuf::computeir::ext::CreateUri( + _fbb, + schema__, + userinfo__, + host__, + port, + path__, + query__, + fragment__); +} + +/// The contents of Relation.options will be Sql_FromOptions +/// if Relation.name = "sql::from" +struct Sql_FromOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Sql_FromOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4 + }; + /// The name of a table referenced as a source relation. + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct Sql_FromOptionsBuilder { + typedef Sql_FromOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(Sql_FromOptions::VT_NAME, name); + } + explicit Sql_FromOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Sql_FromOptionsBuilder &operator=(const Sql_FromOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Sql_FromOptions::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateSql_FromOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0) { + Sql_FromOptionsBuilder builder_(_fbb); + builder_.add_name(name); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateSql_FromOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::flatbuf::computeir::ext::CreateSql_FromOptions( + _fbb, + name__); +} + +struct Partitioning FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef PartitioningBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_FLAVOR = 4, + VT_SCHEMA = 6 + }; + /// Currently supported: "hive", "directory" + const flatbuffers::String *flavor() const { + return GetPointer(VT_FLAVOR); + } + /// Fields on which data is partitioned + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_FLAVOR) && + verifier.VerifyString(flavor()) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct PartitioningBuilder { + typedef Partitioning Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_flavor(flatbuffers::Offset flavor) { + fbb_.AddOffset(Partitioning::VT_FLAVOR, flavor); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Partitioning::VT_SCHEMA, schema); + } + explicit PartitioningBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + PartitioningBuilder &operator=(const PartitioningBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Partitioning::VT_FLAVOR); + fbb_.Required(o, Partitioning::VT_SCHEMA); + return o; + } +}; + +inline flatbuffers::Offset CreatePartitioning( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset flavor = 0, + flatbuffers::Offset schema = 0) { + PartitioningBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_flavor(flavor); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreatePartitioningDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *flavor = nullptr, + flatbuffers::Offset schema = 0) { + auto flavor__ = flavor ? _fbb.CreateString(flavor) : 0; + return org::apache::arrow::flatbuf::computeir::ext::CreatePartitioning( + _fbb, + flavor__, + schema); +} + +struct FileFormat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FileFormatBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4, + VT_OPTIONS = 6 + }; + /// E.g. "parquet", "csv", ... + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + const org::apache::arrow::flatbuf::Buffer *options() const { + return GetStruct(VT_OPTIONS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + VerifyField(verifier, VT_OPTIONS) && + verifier.EndTable(); + } +}; + +struct FileFormatBuilder { + typedef FileFormat Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(FileFormat::VT_NAME, name); + } + void add_options(const org::apache::arrow::flatbuf::Buffer *options) { + fbb_.AddStruct(FileFormat::VT_OPTIONS, options); + } + explicit FileFormatBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FileFormatBuilder &operator=(const FileFormatBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, FileFormat::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateFileFormat( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0, + const org::apache::arrow::flatbuf::Buffer *options = 0) { + FileFormatBuilder builder_(_fbb); + builder_.add_options(options); + builder_.add_name(name); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateFileFormatDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr, + const org::apache::arrow::flatbuf::Buffer *options = 0) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::flatbuf::computeir::ext::CreateFileFormat( + _fbb, + name__, + options); +} + +/// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions +/// if Relation.name = "arrow::filesystem_dataset_scan" +struct Arrow_FileSystemDatasetScanOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Arrow_FileSystemDatasetScanOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE_DIR = 4, + VT_FORMAT = 6, + VT_PARTITIONING = 8 + }; + /// The base directory of a dataset which should be scanned + /// as a source relation. A URI is used to accommodate potentially + /// remote file systems. + const org::apache::arrow::flatbuf::computeir::ext::Uri *base_dir() const { + return GetPointer(VT_BASE_DIR); + } + /// The format of files in this dataset. + const org::apache::arrow::flatbuf::computeir::ext::FileFormat *format() const { + return GetPointer(VT_FORMAT); + } + /// A partitioning scheme in use in this dataset. + const org::apache::arrow::flatbuf::computeir::ext::Partitioning *partitioning() const { + return GetPointer(VT_PARTITIONING); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE_DIR) && + verifier.VerifyTable(base_dir()) && + VerifyOffsetRequired(verifier, VT_FORMAT) && + verifier.VerifyTable(format()) && + VerifyOffset(verifier, VT_PARTITIONING) && + verifier.VerifyTable(partitioning()) && + verifier.EndTable(); + } +}; + +struct Arrow_FileSystemDatasetScanOptionsBuilder { + typedef Arrow_FileSystemDatasetScanOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base_dir(flatbuffers::Offset base_dir) { + fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR, base_dir); + } + void add_format(flatbuffers::Offset format) { + fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_FORMAT, format); + } + void add_partitioning(flatbuffers::Offset partitioning) { + fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_PARTITIONING, partitioning); + } + explicit Arrow_FileSystemDatasetScanOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Arrow_FileSystemDatasetScanOptionsBuilder &operator=(const Arrow_FileSystemDatasetScanOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR); + fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_FORMAT); + return o; + } +}; + +inline flatbuffers::Offset CreateArrow_FileSystemDatasetScanOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0) { + Arrow_FileSystemDatasetScanOptionsBuilder builder_(_fbb); + builder_.add_partitioning(partitioning); + builder_.add_format(format); + builder_.add_base_dir(base_dir); + return builder_.Finish(); +} + +///////////////////////////////////////////////////////////// +/// The contents of Relation.options will be Sql_IntoOptions +/// if Relation.name = "sql::into" +struct Sql_IntoOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Sql_IntoOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4, + VT_APPEND = 6 + }; + /// The name of a table into which rows will be inserted. + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + /// Whether rows written into the table should be appended + /// to the table's current rows (INSERT INTO). + /// If false, the table will be overwritten (INTO). + bool append() const { + return GetField(VT_APPEND, 1) != 0; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + VerifyField(verifier, VT_APPEND) && + verifier.EndTable(); + } +}; + +struct Sql_IntoOptionsBuilder { + typedef Sql_IntoOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(Sql_IntoOptions::VT_NAME, name); + } + void add_append(bool append) { + fbb_.AddElement(Sql_IntoOptions::VT_APPEND, static_cast(append), 1); + } + explicit Sql_IntoOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Sql_IntoOptionsBuilder &operator=(const Sql_IntoOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Sql_IntoOptions::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateSql_IntoOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0, + bool append = true) { + Sql_IntoOptionsBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_append(append); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateSql_IntoOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr, + bool append = true) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::flatbuf::computeir::ext::CreateSql_IntoOptions( + _fbb, + name__, + append); +} + +/// The contents of Relation.options will be Arrow_StreamOutOptions +/// if Relation.name = "arrow::stream_out" +struct Arrow_StreamOutOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Arrow_StreamOutOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_DESTINATION = 4 + }; + /// The URI to which RecordBatches of output should be streamed. + const org::apache::arrow::flatbuf::computeir::ext::Uri *destination() const { + return GetPointer(VT_DESTINATION); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_DESTINATION) && + verifier.VerifyTable(destination()) && + verifier.EndTable(); + } +}; + +struct Arrow_StreamOutOptionsBuilder { + typedef Arrow_StreamOutOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_destination(flatbuffers::Offset destination) { + fbb_.AddOffset(Arrow_StreamOutOptions::VT_DESTINATION, destination); + } + explicit Arrow_StreamOutOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Arrow_StreamOutOptionsBuilder &operator=(const Arrow_StreamOutOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Arrow_StreamOutOptions::VT_DESTINATION); + return o; + } +}; + +inline flatbuffers::Offset CreateArrow_StreamOutOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset destination = 0) { + Arrow_StreamOutOptionsBuilder builder_(_fbb); + builder_.add_destination(destination); + return builder_.Finish(); +} + +/// The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions +/// if Relation.name = "arrow::filesystem_dataset_write" +struct Arrow_FileSystemDatasetWriteOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Arrow_FileSystemDatasetWriteOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE_DIR = 4, + VT_FORMAT = 6, + VT_PARTITIONING = 8, + VT_BASENAME_TEMPLATE = 10 + }; + /// The base directory of a dataset into which output batches should be + /// written. A URI is used to accommodate potentially remote file systems. + /// Files present in this directory will not be explicitly deleted, though + /// they may be overwritten. + const org::apache::arrow::flatbuf::computeir::ext::Uri *base_dir() const { + return GetPointer(VT_BASE_DIR); + } + /// The format in which to write files. + const org::apache::arrow::flatbuf::computeir::ext::FileFormat *format() const { + return GetPointer(VT_FORMAT); + } + /// A partitioning scheme which should be used when writing this dataset. + const org::apache::arrow::flatbuf::computeir::ext::Partitioning *partitioning() const { + return GetPointer(VT_PARTITIONING); + } + /// Template string used to generate written files' basenames. + /// {i} will be replaced by an auto incremented integer. + const flatbuffers::String *basename_template() const { + return GetPointer(VT_BASENAME_TEMPLATE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE_DIR) && + verifier.VerifyTable(base_dir()) && + VerifyOffsetRequired(verifier, VT_FORMAT) && + verifier.VerifyTable(format()) && + VerifyOffset(verifier, VT_PARTITIONING) && + verifier.VerifyTable(partitioning()) && + VerifyOffsetRequired(verifier, VT_BASENAME_TEMPLATE) && + verifier.VerifyString(basename_template()) && + verifier.EndTable(); + } +}; + +struct Arrow_FileSystemDatasetWriteOptionsBuilder { + typedef Arrow_FileSystemDatasetWriteOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base_dir(flatbuffers::Offset base_dir) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR, base_dir); + } + void add_format(flatbuffers::Offset format) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_FORMAT, format); + } + void add_partitioning(flatbuffers::Offset partitioning) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_PARTITIONING, partitioning); + } + void add_basename_template(flatbuffers::Offset basename_template) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE, basename_template); + } + explicit Arrow_FileSystemDatasetWriteOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Arrow_FileSystemDatasetWriteOptionsBuilder &operator=(const Arrow_FileSystemDatasetWriteOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR); + fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_FORMAT); + fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE); + return o; + } +}; + +inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0, + flatbuffers::Offset basename_template = 0) { + Arrow_FileSystemDatasetWriteOptionsBuilder builder_(_fbb); + builder_.add_basename_template(basename_template); + builder_.add_partitioning(partitioning); + builder_.add_format(format); + builder_.add_base_dir(base_dir); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0, + const char *basename_template = nullptr) { + auto basename_template__ = basename_template ? _fbb.CreateString(basename_template) : 0; + return org::apache::arrow::flatbuf::computeir::ext::CreateArrow_FileSystemDatasetWriteOptions( + _fbb, + base_dir, + format, + partitioning, + basename_template__); +} + +} // namespace ext +} // namespace computeir +} // namespace flatbuf +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_EXT_H_ diff --git a/cpp/src/generated/ComputeIR.grpc.fb.cc b/cpp/src/generated/ComputeIR.grpc.fb.cc new file mode 100644 index 0000000000000..66789402f2a59 --- /dev/null +++ b/cpp/src/generated/ComputeIR.grpc.fb.cc @@ -0,0 +1,97 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: ComputeIR + +#include "ComputeIR_generated.h" +#include "ComputeIR.grpc.fb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +namespace org { +namespace apache { +namespace arrow { +namespace flatbuf { +namespace computeir { + +static const char* Interactive_method_names[] = { + "/org.apache.arrow.flatbuf.computeir.Interactive/explain", + "/org.apache.arrow.flatbuf.computeir.Interactive/execute", +}; + +std::unique_ptr< Interactive::Stub> Interactive::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + std::unique_ptr< Interactive::Stub> stub(new Interactive::Stub(channel)); + return stub; +} + +Interactive::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) + : channel_(channel) , rpcmethod_explain_(Interactive_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_execute_(Interactive_method_names[1], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + {} + +::grpc::Status Interactive::Stub::explain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, flatbuffers::grpc::Message* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_explain_, context, request, response); +} + +::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* Interactive::Stub::AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_explain_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* Interactive::Stub::PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_explain_, context, request, false); +} + +::grpc::ClientReader< flatbuffers::grpc::Message>* Interactive::Stub::executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { + return ::grpc::internal::ClientReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), rpcmethod_execute_, context, request); +} + +::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { + return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, true, tag); +} + +::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, false, nullptr); +} + +Interactive::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + Interactive_method_names[0], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< Interactive::Service, flatbuffers::grpc::Message, flatbuffers::grpc::Message>( + std::mem_fn(&Interactive::Service::explain), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + Interactive_method_names[1], + ::grpc::internal::RpcMethod::SERVER_STREAMING, + new ::grpc::internal::ServerStreamingHandler< Interactive::Service, flatbuffers::grpc::Message, flatbuffers::grpc::Message>( + std::mem_fn(&Interactive::Service::execute), this))); +} + +Interactive::Service::~Service() { +} + +::grpc::Status Interactive::Service::explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status Interactive::Service::execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) { + (void) context; + (void) request; + (void) writer; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace org +} // namespace apache +} // namespace arrow +} // namespace flatbuf +} // namespace computeir + diff --git a/cpp/src/generated/ComputeIR.grpc.fb.h b/cpp/src/generated/ComputeIR.grpc.fb.h new file mode 100644 index 0000000000000..85f1fc1f6239b --- /dev/null +++ b/cpp/src/generated/ComputeIR.grpc.fb.h @@ -0,0 +1,230 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: ComputeIR +#ifndef GRPC_ComputeIR__INCLUDED +#define GRPC_ComputeIR__INCLUDED + +#include "ComputeIR_generated.h" +#include "flatbuffers/grpc.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc { +class CompletionQueue; +class Channel; +class ServerCompletionQueue; +class ServerContext; +} // namespace grpc + +namespace org { +namespace apache { +namespace arrow { +namespace flatbuf { +namespace computeir { + +class Interactive final { + public: + static constexpr char const* service_full_name() { + return "org.apache.arrow.flatbuf.computeir.Interactive"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + virtual ::grpc::Status explain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, flatbuffers::grpc::Message* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>> Asyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>>(AsyncexplainRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>> PrepareAsyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>>(PrepareAsyncexplainRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { + return std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>>(executeRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); + } + private: + virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>* AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>* PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) = 0; + virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) = 0; + virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); + ::grpc::Status explain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, flatbuffers::grpc::Message* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>> Asyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>>(AsyncexplainRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>> PrepareAsyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>>(PrepareAsyncexplainRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { + return std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>>(executeRaw(context, request)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); + } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientReader< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) override; + ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) override; + ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_explain_; + const ::grpc::internal::RpcMethod rpcmethod_execute_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + virtual ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response); + virtual ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer); + }; + template + class WithAsyncMethod_explain : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_explain() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_explain() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) final override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void Requestexplain(::grpc::ServerContext* context, flatbuffers::grpc::Message* request, ::grpc::ServerAsyncResponseWriter< flatbuffers::grpc::Message>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_execute : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_execute() { + ::grpc::Service::MarkMethodAsync(1); + } + ~WithAsyncMethod_execute() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void Requestexecute(::grpc::ServerContext* context, flatbuffers::grpc::Message* request, ::grpc::ServerAsyncWriter< flatbuffers::grpc::Message>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_explain< WithAsyncMethod_execute< Service > > AsyncService; + template + class WithGenericMethod_explain : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_explain() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_explain() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) final override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_execute : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_execute() { + ::grpc::Service::MarkMethodGeneric(1); + } + ~WithGenericMethod_execute() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithStreamedUnaryMethod_explain : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithStreamedUnaryMethod_explain() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< flatbuffers::grpc::Message, flatbuffers::grpc::Message>(std::bind(&WithStreamedUnaryMethod_explain::Streamedexplain, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_explain() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) final override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status Streamedexplain(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< flatbuffers::grpc::Message,flatbuffers::grpc::Message>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_explain< Service > StreamedUnaryService; + template + class WithSplitStreamingMethod_execute : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithSplitStreamingMethod_execute() { + ::grpc::Service::MarkMethodStreamed(1, + new ::grpc::internal::SplitServerStreamingHandler< flatbuffers::grpc::Message, flatbuffers::grpc::Message>(std::bind(&WithSplitStreamingMethod_execute::Streamedexecute, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithSplitStreamingMethod_execute() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with split streamed + virtual ::grpc::Status Streamedexecute(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< flatbuffers::grpc::Message,flatbuffers::grpc::Message>* server_split_streamer) = 0; + }; + typedef WithSplitStreamingMethod_execute< Service > SplitStreamedService; + typedef WithStreamedUnaryMethod_explain< WithSplitStreamingMethod_execute< Service > > StreamedService; +}; + +} // namespace computeir +} // namespace flatbuf +} // namespace arrow +} // namespace apache +} // namespace org + + +#endif // GRPC_ComputeIR__INCLUDED diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h new file mode 100644 index 0000000000000..6a68cb1575db0 --- /dev/null +++ b/cpp/src/generated/ComputeIR_generated.h @@ -0,0 +1,2077 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_H_ +#define FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_H_ + +#include "flatbuffers/flatbuffers.h" + +#include "Message_generated.h" +#include "Schema_generated.h" +#include "SparseTensor_generated.h" +#include "Tensor_generated.h" + +namespace org { +namespace apache { +namespace arrow { +namespace flatbuf { +namespace computeir { + +struct ScalarShape; +struct ScalarShapeBuilder; + +struct ArrayShape; +struct ArrayShapeBuilder; + +struct Literal; +struct LiteralBuilder; + +struct FieldRef; +struct FieldRefBuilder; + +struct Call; +struct CallBuilder; + +struct Relation; +struct RelationBuilder; + +struct FilterOptions; +struct FilterOptionsBuilder; + +struct ProjectOptions; +struct ProjectOptionsBuilder; + +struct AggregateOptions; +struct AggregateOptionsBuilder; + +struct JoinOptions; +struct JoinOptionsBuilder; + +struct SortKey; +struct SortKeyBuilder; + +struct OrderByOptions; +struct OrderByOptionsBuilder; + +struct LimitOptions; +struct LimitOptionsBuilder; + +struct CommonOptions; +struct CommonOptionsBuilder; + +struct UnionOptions; +struct UnionOptionsBuilder; + +struct LiteralOptions; +struct LiteralOptionsBuilder; + +struct Plan; +struct PlanBuilder; + +/// An expression is one of +/// - a Literal datum +/// - a reference to a Field from a Relation +/// - a call to a named function +/// On evaluation, an Expression will have either array or scalar shape. +enum class Expression : uint8_t { + NONE = 0, + Literal = 1, + FieldRef = 2, + Call = 3, + MIN = NONE, + MAX = Call +}; + +inline const Expression (&EnumValuesExpression())[4] { + static const Expression values[] = { + Expression::NONE, + Expression::Literal, + Expression::FieldRef, + Expression::Call + }; + return values; +} + +inline const char * const *EnumNamesExpression() { + static const char * const names[5] = { + "NONE", + "Literal", + "FieldRef", + "Call", + nullptr + }; + return names; +} + +inline const char *EnumNameExpression(Expression e) { + if (flatbuffers::IsOutRange(e, Expression::NONE, Expression::Call)) return ""; + const size_t index = static_cast(e); + return EnumNamesExpression()[index]; +} + +template struct ExpressionTraits { + static const Expression enum_value = Expression::NONE; +}; + +template<> struct ExpressionTraits { + static const Expression enum_value = Expression::Literal; +}; + +template<> struct ExpressionTraits { + static const Expression enum_value = Expression::FieldRef; +}; + +template<> struct ExpressionTraits { + static const Expression enum_value = Expression::Call; +}; + +bool VerifyExpression(flatbuffers::Verifier &verifier, const void *obj, Expression type); +bool VerifyExpressionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class Shape : uint8_t { + NONE = 0, + ArrayShape = 1, + ScalarShape = 2, + MIN = NONE, + MAX = ScalarShape +}; + +inline const Shape (&EnumValuesShape())[3] { + static const Shape values[] = { + Shape::NONE, + Shape::ArrayShape, + Shape::ScalarShape + }; + return values; +} + +inline const char * const *EnumNamesShape() { + static const char * const names[4] = { + "NONE", + "ArrayShape", + "ScalarShape", + nullptr + }; + return names; +} + +inline const char *EnumNameShape(Shape e) { + if (flatbuffers::IsOutRange(e, Shape::NONE, Shape::ScalarShape)) return ""; + const size_t index = static_cast(e); + return EnumNamesShape()[index]; +} + +template struct ShapeTraits { + static const Shape enum_value = Shape::NONE; +}; + +template<> struct ShapeTraits { + static const Shape enum_value = Shape::ArrayShape; +}; + +template<> struct ShapeTraits { + static const Shape enum_value = Shape::ScalarShape; +}; + +bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape type); +bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// Whether lesser values should precede greater or vice versa, +/// also whether nulls should preced or follow values. +enum class Ordering : uint8_t { + ASCENDING_THEN_NULLS = 0, + DESCENDING_THEN_NULLS = 1, + NULLS_THEN_ASCENDING = 2, + NULLS_THEN_DESCENDING = 3, + MIN = ASCENDING_THEN_NULLS, + MAX = NULLS_THEN_DESCENDING +}; + +inline const Ordering (&EnumValuesOrdering())[4] { + static const Ordering values[] = { + Ordering::ASCENDING_THEN_NULLS, + Ordering::DESCENDING_THEN_NULLS, + Ordering::NULLS_THEN_ASCENDING, + Ordering::NULLS_THEN_DESCENDING + }; + return values; +} + +inline const char * const *EnumNamesOrdering() { + static const char * const names[5] = { + "ASCENDING_THEN_NULLS", + "DESCENDING_THEN_NULLS", + "NULLS_THEN_ASCENDING", + "NULLS_THEN_DESCENDING", + nullptr + }; + return names; +} + +inline const char *EnumNameOrdering(Ordering e) { + if (flatbuffers::IsOutRange(e, Ordering::ASCENDING_THEN_NULLS, Ordering::NULLS_THEN_DESCENDING)) return ""; + const size_t index = static_cast(e); + return EnumNamesOrdering()[index]; +} + +struct ScalarShape FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ScalarShapeBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct ScalarShapeBuilder { + typedef ScalarShape Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit ScalarShapeBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ScalarShapeBuilder &operator=(const ScalarShapeBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateScalarShape( + flatbuffers::FlatBufferBuilder &_fbb) { + ScalarShapeBuilder builder_(_fbb); + return builder_.Finish(); +} + +struct ArrayShape FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ArrayShapeBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_LENGTH = 4 + }; + /// Number of slots. + int64_t length() const { + return GetField(VT_LENGTH, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_LENGTH) && + verifier.EndTable(); + } +}; + +struct ArrayShapeBuilder { + typedef ArrayShape Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_length(int64_t length) { + fbb_.AddElement(ArrayShape::VT_LENGTH, length, 0); + } + explicit ArrayShapeBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ArrayShapeBuilder &operator=(const ArrayShapeBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateArrayShape( + flatbuffers::FlatBufferBuilder &_fbb, + int64_t length = 0) { + ArrayShapeBuilder builder_(_fbb); + builder_.add_length(length); + return builder_.Finish(); +} + +struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SHAPE_TYPE = 4, + VT_SHAPE = 6, + VT_TYPE_TYPE = 8, + VT_TYPE = 10, + VT_BUFFERS = 12 + }; + org::apache::arrow::flatbuf::computeir::Shape shape_type() const { + return static_cast(GetField(VT_SHAPE_TYPE, 0)); + } + /// Shape of this literal. + const void *shape() const { + return GetPointer(VT_SHAPE); + } + template const T *shape_as() const; + const org::apache::arrow::flatbuf::computeir::ArrayShape *shape_as_ArrayShape() const { + return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::ArrayShape ? static_cast(shape()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::ScalarShape *shape_as_ScalarShape() const { + return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::ScalarShape ? static_cast(shape()) : nullptr; + } + org::apache::arrow::flatbuf::Type type_type() const { + return static_cast(GetField(VT_TYPE_TYPE, 0)); + } + /// The type of this literal. + const void *type() const { + return GetPointer(VT_TYPE); + } + template const T *type_as() const; + const org::apache::arrow::flatbuf::Null *type_as_Null() const { + return type_type() == org::apache::arrow::flatbuf::Type::Null ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Int *type_as_Int() const { + return type_type() == org::apache::arrow::flatbuf::Type::Int ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FloatingPoint *type_as_FloatingPoint() const { + return type_type() == org::apache::arrow::flatbuf::Type::FloatingPoint ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Binary *type_as_Binary() const { + return type_type() == org::apache::arrow::flatbuf::Type::Binary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Utf8 *type_as_Utf8() const { + return type_type() == org::apache::arrow::flatbuf::Type::Utf8 ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Bool *type_as_Bool() const { + return type_type() == org::apache::arrow::flatbuf::Type::Bool ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Decimal *type_as_Decimal() const { + return type_type() == org::apache::arrow::flatbuf::Type::Decimal ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Date *type_as_Date() const { + return type_type() == org::apache::arrow::flatbuf::Type::Date ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Time *type_as_Time() const { + return type_type() == org::apache::arrow::flatbuf::Type::Time ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Timestamp *type_as_Timestamp() const { + return type_type() == org::apache::arrow::flatbuf::Type::Timestamp ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Interval *type_as_Interval() const { + return type_type() == org::apache::arrow::flatbuf::Type::Interval ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::List *type_as_List() const { + return type_type() == org::apache::arrow::flatbuf::Type::List ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Struct_ *type_as_Struct_() const { + return type_type() == org::apache::arrow::flatbuf::Type::Struct_ ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Union *type_as_Union() const { + return type_type() == org::apache::arrow::flatbuf::Type::Union ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FixedSizeBinary *type_as_FixedSizeBinary() const { + return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeBinary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FixedSizeList *type_as_FixedSizeList() const { + return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeList ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Map *type_as_Map() const { + return type_type() == org::apache::arrow::flatbuf::Type::Map ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Duration *type_as_Duration() const { + return type_type() == org::apache::arrow::flatbuf::Type::Duration ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeBinary *type_as_LargeBinary() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeBinary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeUtf8 *type_as_LargeUtf8() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeUtf8 ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeList *type_as_LargeList() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeList ? static_cast(type()) : nullptr; + } + /// Buffers containing `length` elements of arrow-formatted data. + /// If `length` is absent (this Literal is scalar), these buffers + /// are sized to accommodate a single element of arrow-formatted data. + /// XXX this can be optimized for trivial scalars later + const flatbuffers::Vector *buffers() const { + return GetPointer *>(VT_BUFFERS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_SHAPE_TYPE) && + VerifyOffsetRequired(verifier, VT_SHAPE) && + VerifyShape(verifier, shape(), shape_type()) && + VerifyField(verifier, VT_TYPE_TYPE) && + VerifyOffsetRequired(verifier, VT_TYPE) && + VerifyType(verifier, type(), type_type()) && + VerifyOffset(verifier, VT_BUFFERS) && + verifier.VerifyVector(buffers()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::flatbuf::computeir::ArrayShape *Literal::shape_as() const { + return shape_as_ArrayShape(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::ScalarShape *Literal::shape_as() const { + return shape_as_ScalarShape(); +} + +template<> inline const org::apache::arrow::flatbuf::Null *Literal::type_as() const { + return type_as_Null(); +} + +template<> inline const org::apache::arrow::flatbuf::Int *Literal::type_as() const { + return type_as_Int(); +} + +template<> inline const org::apache::arrow::flatbuf::FloatingPoint *Literal::type_as() const { + return type_as_FloatingPoint(); +} + +template<> inline const org::apache::arrow::flatbuf::Binary *Literal::type_as() const { + return type_as_Binary(); +} + +template<> inline const org::apache::arrow::flatbuf::Utf8 *Literal::type_as() const { + return type_as_Utf8(); +} + +template<> inline const org::apache::arrow::flatbuf::Bool *Literal::type_as() const { + return type_as_Bool(); +} + +template<> inline const org::apache::arrow::flatbuf::Decimal *Literal::type_as() const { + return type_as_Decimal(); +} + +template<> inline const org::apache::arrow::flatbuf::Date *Literal::type_as() const { + return type_as_Date(); +} + +template<> inline const org::apache::arrow::flatbuf::Time *Literal::type_as() const { + return type_as_Time(); +} + +template<> inline const org::apache::arrow::flatbuf::Timestamp *Literal::type_as() const { + return type_as_Timestamp(); +} + +template<> inline const org::apache::arrow::flatbuf::Interval *Literal::type_as() const { + return type_as_Interval(); +} + +template<> inline const org::apache::arrow::flatbuf::List *Literal::type_as() const { + return type_as_List(); +} + +template<> inline const org::apache::arrow::flatbuf::Struct_ *Literal::type_as() const { + return type_as_Struct_(); +} + +template<> inline const org::apache::arrow::flatbuf::Union *Literal::type_as() const { + return type_as_Union(); +} + +template<> inline const org::apache::arrow::flatbuf::FixedSizeBinary *Literal::type_as() const { + return type_as_FixedSizeBinary(); +} + +template<> inline const org::apache::arrow::flatbuf::FixedSizeList *Literal::type_as() const { + return type_as_FixedSizeList(); +} + +template<> inline const org::apache::arrow::flatbuf::Map *Literal::type_as() const { + return type_as_Map(); +} + +template<> inline const org::apache::arrow::flatbuf::Duration *Literal::type_as() const { + return type_as_Duration(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeBinary *Literal::type_as() const { + return type_as_LargeBinary(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeUtf8 *Literal::type_as() const { + return type_as_LargeUtf8(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeList *Literal::type_as() const { + return type_as_LargeList(); +} + +struct LiteralBuilder { + typedef Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_shape_type(org::apache::arrow::flatbuf::computeir::Shape shape_type) { + fbb_.AddElement(Literal::VT_SHAPE_TYPE, static_cast(shape_type), 0); + } + void add_shape(flatbuffers::Offset shape) { + fbb_.AddOffset(Literal::VT_SHAPE, shape); + } + void add_type_type(org::apache::arrow::flatbuf::Type type_type) { + fbb_.AddElement(Literal::VT_TYPE_TYPE, static_cast(type_type), 0); + } + void add_type(flatbuffers::Offset type) { + fbb_.AddOffset(Literal::VT_TYPE, type); + } + void add_buffers(flatbuffers::Offset> buffers) { + fbb_.AddOffset(Literal::VT_BUFFERS, buffers); + } + explicit LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + LiteralBuilder &operator=(const LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Literal::VT_SHAPE); + fbb_.Required(o, Literal::VT_TYPE); + return o; + } +}; + +inline flatbuffers::Offset CreateLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, + flatbuffers::Offset shape = 0, + org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, + flatbuffers::Offset type = 0, + flatbuffers::Offset> buffers = 0) { + LiteralBuilder builder_(_fbb); + builder_.add_buffers(buffers); + builder_.add_type(type); + builder_.add_shape(shape); + builder_.add_type_type(type_type); + builder_.add_shape_type(shape_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, + flatbuffers::Offset shape = 0, + org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, + flatbuffers::Offset type = 0, + const std::vector *buffers = nullptr) { + auto buffers__ = buffers ? _fbb.CreateVectorOfStructs(*buffers) : 0; + return org::apache::arrow::flatbuf::computeir::CreateLiteral( + _fbb, + shape_type, + shape, + type_type, + type, + buffers__); +} + +struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FieldRefBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_PATH = 4, + VT_RELATION_INDEX = 6, + VT_TYPE_TYPE = 8, + VT_TYPE = 10 + }; + /// A sequence of field names to allow referencing potentially nested fields + const flatbuffers::Vector> *path() const { + return GetPointer> *>(VT_PATH); + } + /// For Expressions which might reference fields in multiple Relations, + /// this index may be provided to indicate which Relation's fields + /// `path` points into. For example in the case of a join, + /// 0 refers to the left relation and 1 to the right relation. + int32_t relation_index() const { + return GetField(VT_RELATION_INDEX, 0); + } + org::apache::arrow::flatbuf::Type type_type() const { + return static_cast(GetField(VT_TYPE_TYPE, 0)); + } + /// The type of data in the referenced Field. + const void *type() const { + return GetPointer(VT_TYPE); + } + template const T *type_as() const; + const org::apache::arrow::flatbuf::Null *type_as_Null() const { + return type_type() == org::apache::arrow::flatbuf::Type::Null ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Int *type_as_Int() const { + return type_type() == org::apache::arrow::flatbuf::Type::Int ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FloatingPoint *type_as_FloatingPoint() const { + return type_type() == org::apache::arrow::flatbuf::Type::FloatingPoint ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Binary *type_as_Binary() const { + return type_type() == org::apache::arrow::flatbuf::Type::Binary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Utf8 *type_as_Utf8() const { + return type_type() == org::apache::arrow::flatbuf::Type::Utf8 ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Bool *type_as_Bool() const { + return type_type() == org::apache::arrow::flatbuf::Type::Bool ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Decimal *type_as_Decimal() const { + return type_type() == org::apache::arrow::flatbuf::Type::Decimal ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Date *type_as_Date() const { + return type_type() == org::apache::arrow::flatbuf::Type::Date ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Time *type_as_Time() const { + return type_type() == org::apache::arrow::flatbuf::Type::Time ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Timestamp *type_as_Timestamp() const { + return type_type() == org::apache::arrow::flatbuf::Type::Timestamp ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Interval *type_as_Interval() const { + return type_type() == org::apache::arrow::flatbuf::Type::Interval ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::List *type_as_List() const { + return type_type() == org::apache::arrow::flatbuf::Type::List ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Struct_ *type_as_Struct_() const { + return type_type() == org::apache::arrow::flatbuf::Type::Struct_ ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Union *type_as_Union() const { + return type_type() == org::apache::arrow::flatbuf::Type::Union ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FixedSizeBinary *type_as_FixedSizeBinary() const { + return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeBinary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FixedSizeList *type_as_FixedSizeList() const { + return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeList ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Map *type_as_Map() const { + return type_type() == org::apache::arrow::flatbuf::Type::Map ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Duration *type_as_Duration() const { + return type_type() == org::apache::arrow::flatbuf::Type::Duration ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeBinary *type_as_LargeBinary() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeBinary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeUtf8 *type_as_LargeUtf8() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeUtf8 ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeList *type_as_LargeList() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeList ? static_cast(type()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_PATH) && + verifier.VerifyVector(path()) && + verifier.VerifyVectorOfStrings(path()) && + VerifyField(verifier, VT_RELATION_INDEX) && + VerifyField(verifier, VT_TYPE_TYPE) && + VerifyOffset(verifier, VT_TYPE) && + VerifyType(verifier, type(), type_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::flatbuf::Null *FieldRef::type_as() const { + return type_as_Null(); +} + +template<> inline const org::apache::arrow::flatbuf::Int *FieldRef::type_as() const { + return type_as_Int(); +} + +template<> inline const org::apache::arrow::flatbuf::FloatingPoint *FieldRef::type_as() const { + return type_as_FloatingPoint(); +} + +template<> inline const org::apache::arrow::flatbuf::Binary *FieldRef::type_as() const { + return type_as_Binary(); +} + +template<> inline const org::apache::arrow::flatbuf::Utf8 *FieldRef::type_as() const { + return type_as_Utf8(); +} + +template<> inline const org::apache::arrow::flatbuf::Bool *FieldRef::type_as() const { + return type_as_Bool(); +} + +template<> inline const org::apache::arrow::flatbuf::Decimal *FieldRef::type_as() const { + return type_as_Decimal(); +} + +template<> inline const org::apache::arrow::flatbuf::Date *FieldRef::type_as() const { + return type_as_Date(); +} + +template<> inline const org::apache::arrow::flatbuf::Time *FieldRef::type_as() const { + return type_as_Time(); +} + +template<> inline const org::apache::arrow::flatbuf::Timestamp *FieldRef::type_as() const { + return type_as_Timestamp(); +} + +template<> inline const org::apache::arrow::flatbuf::Interval *FieldRef::type_as() const { + return type_as_Interval(); +} + +template<> inline const org::apache::arrow::flatbuf::List *FieldRef::type_as() const { + return type_as_List(); +} + +template<> inline const org::apache::arrow::flatbuf::Struct_ *FieldRef::type_as() const { + return type_as_Struct_(); +} + +template<> inline const org::apache::arrow::flatbuf::Union *FieldRef::type_as() const { + return type_as_Union(); +} + +template<> inline const org::apache::arrow::flatbuf::FixedSizeBinary *FieldRef::type_as() const { + return type_as_FixedSizeBinary(); +} + +template<> inline const org::apache::arrow::flatbuf::FixedSizeList *FieldRef::type_as() const { + return type_as_FixedSizeList(); +} + +template<> inline const org::apache::arrow::flatbuf::Map *FieldRef::type_as() const { + return type_as_Map(); +} + +template<> inline const org::apache::arrow::flatbuf::Duration *FieldRef::type_as() const { + return type_as_Duration(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeBinary *FieldRef::type_as() const { + return type_as_LargeBinary(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeUtf8 *FieldRef::type_as() const { + return type_as_LargeUtf8(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeList *FieldRef::type_as() const { + return type_as_LargeList(); +} + +struct FieldRefBuilder { + typedef FieldRef Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_path(flatbuffers::Offset>> path) { + fbb_.AddOffset(FieldRef::VT_PATH, path); + } + void add_relation_index(int32_t relation_index) { + fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); + } + void add_type_type(org::apache::arrow::flatbuf::Type type_type) { + fbb_.AddElement(FieldRef::VT_TYPE_TYPE, static_cast(type_type), 0); + } + void add_type(flatbuffers::Offset type) { + fbb_.AddOffset(FieldRef::VT_TYPE, type); + } + explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FieldRefBuilder &operator=(const FieldRefBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateFieldRef( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> path = 0, + int32_t relation_index = 0, + org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, + flatbuffers::Offset type = 0) { + FieldRefBuilder builder_(_fbb); + builder_.add_type(type); + builder_.add_relation_index(relation_index); + builder_.add_path(path); + builder_.add_type_type(type_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateFieldRefDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *path = nullptr, + int32_t relation_index = 0, + org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, + flatbuffers::Offset type = 0) { + auto path__ = path ? _fbb.CreateVector>(*path) : 0; + return org::apache::arrow::flatbuf::computeir::CreateFieldRef( + _fbb, + path__, + relation_index, + type_type, + type); +} + +struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CallBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_FUNCTION_NAME = 4, + VT_OPTIONS = 6, + VT_ARGUMENTS_TYPE = 8, + VT_ARGUMENTS = 10, + VT_TYPE_TYPE = 12, + VT_TYPE = 14 + }; + /// The name of the function whose invocation this Call represents. + const flatbuffers::String *function_name() const { + return GetPointer(VT_FUNCTION_NAME); + } + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + const org::apache::arrow::flatbuf::Buffer *options() const { + return GetStruct(VT_OPTIONS); + } + const flatbuffers::Vector *arguments_type() const { + return GetPointer *>(VT_ARGUMENTS_TYPE); + } + /// The arguments passed to `function_name`. + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); + } + org::apache::arrow::flatbuf::Type type_type() const { + return static_cast(GetField(VT_TYPE_TYPE, 0)); + } + /// The type of data which invoking `function_name` will return. + const void *type() const { + return GetPointer(VT_TYPE); + } + template const T *type_as() const; + const org::apache::arrow::flatbuf::Null *type_as_Null() const { + return type_type() == org::apache::arrow::flatbuf::Type::Null ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Int *type_as_Int() const { + return type_type() == org::apache::arrow::flatbuf::Type::Int ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FloatingPoint *type_as_FloatingPoint() const { + return type_type() == org::apache::arrow::flatbuf::Type::FloatingPoint ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Binary *type_as_Binary() const { + return type_type() == org::apache::arrow::flatbuf::Type::Binary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Utf8 *type_as_Utf8() const { + return type_type() == org::apache::arrow::flatbuf::Type::Utf8 ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Bool *type_as_Bool() const { + return type_type() == org::apache::arrow::flatbuf::Type::Bool ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Decimal *type_as_Decimal() const { + return type_type() == org::apache::arrow::flatbuf::Type::Decimal ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Date *type_as_Date() const { + return type_type() == org::apache::arrow::flatbuf::Type::Date ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Time *type_as_Time() const { + return type_type() == org::apache::arrow::flatbuf::Type::Time ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Timestamp *type_as_Timestamp() const { + return type_type() == org::apache::arrow::flatbuf::Type::Timestamp ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Interval *type_as_Interval() const { + return type_type() == org::apache::arrow::flatbuf::Type::Interval ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::List *type_as_List() const { + return type_type() == org::apache::arrow::flatbuf::Type::List ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Struct_ *type_as_Struct_() const { + return type_type() == org::apache::arrow::flatbuf::Type::Struct_ ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Union *type_as_Union() const { + return type_type() == org::apache::arrow::flatbuf::Type::Union ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FixedSizeBinary *type_as_FixedSizeBinary() const { + return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeBinary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::FixedSizeList *type_as_FixedSizeList() const { + return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeList ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Map *type_as_Map() const { + return type_type() == org::apache::arrow::flatbuf::Type::Map ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::Duration *type_as_Duration() const { + return type_type() == org::apache::arrow::flatbuf::Type::Duration ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeBinary *type_as_LargeBinary() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeBinary ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeUtf8 *type_as_LargeUtf8() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeUtf8 ? static_cast(type()) : nullptr; + } + const org::apache::arrow::flatbuf::LargeList *type_as_LargeList() const { + return type_type() == org::apache::arrow::flatbuf::Type::LargeList ? static_cast(type()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_FUNCTION_NAME) && + verifier.VerifyString(function_name()) && + VerifyField(verifier, VT_OPTIONS) && + VerifyOffsetRequired(verifier, VT_ARGUMENTS_TYPE) && + verifier.VerifyVector(arguments_type()) && + VerifyOffsetRequired(verifier, VT_ARGUMENTS) && + verifier.VerifyVector(arguments()) && + VerifyExpressionVector(verifier, arguments(), arguments_type()) && + VerifyField(verifier, VT_TYPE_TYPE) && + VerifyOffset(verifier, VT_TYPE) && + VerifyType(verifier, type(), type_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::flatbuf::Null *Call::type_as() const { + return type_as_Null(); +} + +template<> inline const org::apache::arrow::flatbuf::Int *Call::type_as() const { + return type_as_Int(); +} + +template<> inline const org::apache::arrow::flatbuf::FloatingPoint *Call::type_as() const { + return type_as_FloatingPoint(); +} + +template<> inline const org::apache::arrow::flatbuf::Binary *Call::type_as() const { + return type_as_Binary(); +} + +template<> inline const org::apache::arrow::flatbuf::Utf8 *Call::type_as() const { + return type_as_Utf8(); +} + +template<> inline const org::apache::arrow::flatbuf::Bool *Call::type_as() const { + return type_as_Bool(); +} + +template<> inline const org::apache::arrow::flatbuf::Decimal *Call::type_as() const { + return type_as_Decimal(); +} + +template<> inline const org::apache::arrow::flatbuf::Date *Call::type_as() const { + return type_as_Date(); +} + +template<> inline const org::apache::arrow::flatbuf::Time *Call::type_as() const { + return type_as_Time(); +} + +template<> inline const org::apache::arrow::flatbuf::Timestamp *Call::type_as() const { + return type_as_Timestamp(); +} + +template<> inline const org::apache::arrow::flatbuf::Interval *Call::type_as() const { + return type_as_Interval(); +} + +template<> inline const org::apache::arrow::flatbuf::List *Call::type_as() const { + return type_as_List(); +} + +template<> inline const org::apache::arrow::flatbuf::Struct_ *Call::type_as() const { + return type_as_Struct_(); +} + +template<> inline const org::apache::arrow::flatbuf::Union *Call::type_as() const { + return type_as_Union(); +} + +template<> inline const org::apache::arrow::flatbuf::FixedSizeBinary *Call::type_as() const { + return type_as_FixedSizeBinary(); +} + +template<> inline const org::apache::arrow::flatbuf::FixedSizeList *Call::type_as() const { + return type_as_FixedSizeList(); +} + +template<> inline const org::apache::arrow::flatbuf::Map *Call::type_as() const { + return type_as_Map(); +} + +template<> inline const org::apache::arrow::flatbuf::Duration *Call::type_as() const { + return type_as_Duration(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeBinary *Call::type_as() const { + return type_as_LargeBinary(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeUtf8 *Call::type_as() const { + return type_as_LargeUtf8(); +} + +template<> inline const org::apache::arrow::flatbuf::LargeList *Call::type_as() const { + return type_as_LargeList(); +} + +struct CallBuilder { + typedef Call Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_function_name(flatbuffers::Offset function_name) { + fbb_.AddOffset(Call::VT_FUNCTION_NAME, function_name); + } + void add_options(const org::apache::arrow::flatbuf::Buffer *options) { + fbb_.AddStruct(Call::VT_OPTIONS, options); + } + void add_arguments_type(flatbuffers::Offset> arguments_type) { + fbb_.AddOffset(Call::VT_ARGUMENTS_TYPE, arguments_type); + } + void add_arguments(flatbuffers::Offset>> arguments) { + fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); + } + void add_type_type(org::apache::arrow::flatbuf::Type type_type) { + fbb_.AddElement(Call::VT_TYPE_TYPE, static_cast(type_type), 0); + } + void add_type(flatbuffers::Offset type) { + fbb_.AddOffset(Call::VT_TYPE, type); + } + explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CallBuilder &operator=(const CallBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Call::VT_FUNCTION_NAME); + fbb_.Required(o, Call::VT_ARGUMENTS_TYPE); + fbb_.Required(o, Call::VT_ARGUMENTS); + return o; + } +}; + +inline flatbuffers::Offset CreateCall( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset function_name = 0, + const org::apache::arrow::flatbuf::Buffer *options = 0, + flatbuffers::Offset> arguments_type = 0, + flatbuffers::Offset>> arguments = 0, + org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, + flatbuffers::Offset type = 0) { + CallBuilder builder_(_fbb); + builder_.add_type(type); + builder_.add_arguments(arguments); + builder_.add_arguments_type(arguments_type); + builder_.add_options(options); + builder_.add_function_name(function_name); + builder_.add_type_type(type_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateCallDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *function_name = nullptr, + const org::apache::arrow::flatbuf::Buffer *options = 0, + const std::vector *arguments_type = nullptr, + const std::vector> *arguments = nullptr, + org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, + flatbuffers::Offset type = 0) { + auto function_name__ = function_name ? _fbb.CreateString(function_name) : 0; + auto arguments_type__ = arguments_type ? _fbb.CreateVector(*arguments_type) : 0; + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + return org::apache::arrow::flatbuf::computeir::CreateCall( + _fbb, + function_name__, + options, + arguments_type__, + arguments__, + type_type, + type); +} + +/// A relation is a set of rows with consistent schema. +struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef RelationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_RELATION_NAME = 4, + VT_OPTIONS = 6, + VT_ARGUMENTS = 8, + VT_SCHEMA = 10 + }; + /// The namespaced name of this Relation. + /// + /// Names with no namespace are reserved for pure relational + /// algebraic operations, which currently include: + /// "filter" + /// "project" + /// "aggregate" + /// "join" + /// "order_by" + /// "limit" + /// "common" + /// "union" + /// "literal" + /// "interactive_output" + const flatbuffers::String *relation_name() const { + return GetPointer(VT_RELATION_NAME); + } + /// Parameters for `relation_name`; content/format may be unique to each + /// value of `relation_name`. + const org::apache::arrow::flatbuf::Buffer *options() const { + return GetStruct(VT_OPTIONS); + } + /// The arguments passed to `relation_name`. + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); + } + /// The schema of rows in this Relation + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_RELATION_NAME) && + verifier.VerifyString(relation_name()) && + VerifyField(verifier, VT_OPTIONS) && + VerifyOffsetRequired(verifier, VT_ARGUMENTS) && + verifier.VerifyVector(arguments()) && + verifier.VerifyVectorOfTables(arguments()) && + VerifyOffset(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct RelationBuilder { + typedef Relation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_relation_name(flatbuffers::Offset relation_name) { + fbb_.AddOffset(Relation::VT_RELATION_NAME, relation_name); + } + void add_options(const org::apache::arrow::flatbuf::Buffer *options) { + fbb_.AddStruct(Relation::VT_OPTIONS, options); + } + void add_arguments(flatbuffers::Offset>> arguments) { + fbb_.AddOffset(Relation::VT_ARGUMENTS, arguments); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Relation::VT_SCHEMA, schema); + } + explicit RelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + RelationBuilder &operator=(const RelationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Relation::VT_RELATION_NAME); + fbb_.Required(o, Relation::VT_ARGUMENTS); + return o; + } +}; + +inline flatbuffers::Offset CreateRelation( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset relation_name = 0, + const org::apache::arrow::flatbuf::Buffer *options = 0, + flatbuffers::Offset>> arguments = 0, + flatbuffers::Offset schema = 0) { + RelationBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_arguments(arguments); + builder_.add_options(options); + builder_.add_relation_name(relation_name); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateRelationDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *relation_name = nullptr, + const org::apache::arrow::flatbuf::Buffer *options = 0, + const std::vector> *arguments = nullptr, + flatbuffers::Offset schema = 0) { + auto relation_name__ = relation_name ? _fbb.CreateString(relation_name) : 0; + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + return org::apache::arrow::flatbuf::computeir::CreateRelation( + _fbb, + relation_name__, + options, + arguments__, + schema); +} + +/// The contents of Relation.options will be FilterOptions +/// if Relation.relation_name = "filter" +struct FilterOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FilterOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_FILTER_EXPRESSION_TYPE = 4, + VT_FILTER_EXPRESSION = 6 + }; + org::apache::arrow::flatbuf::computeir::Expression filter_expression_type() const { + return static_cast(GetField(VT_FILTER_EXPRESSION_TYPE, 0)); + } + /// The expression which will be evaluated against input rows + /// to determine whether they should be excluded from the + /// "filter" relation's output. + const void *filter_expression() const { + return GetPointer(VT_FILTER_EXPRESSION); + } + template const T *filter_expression_as() const; + const org::apache::arrow::flatbuf::computeir::Literal *filter_expression_as_Literal() const { + return filter_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Literal ? static_cast(filter_expression()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::FieldRef *filter_expression_as_FieldRef() const { + return filter_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::FieldRef ? static_cast(filter_expression()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Call *filter_expression_as_Call() const { + return filter_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Call ? static_cast(filter_expression()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_FILTER_EXPRESSION_TYPE) && + VerifyOffsetRequired(verifier, VT_FILTER_EXPRESSION) && + VerifyExpression(verifier, filter_expression(), filter_expression_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::flatbuf::computeir::Literal *FilterOptions::filter_expression_as() const { + return filter_expression_as_Literal(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *FilterOptions::filter_expression_as() const { + return filter_expression_as_FieldRef(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Call *FilterOptions::filter_expression_as() const { + return filter_expression_as_Call(); +} + +struct FilterOptionsBuilder { + typedef FilterOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_filter_expression_type(org::apache::arrow::flatbuf::computeir::Expression filter_expression_type) { + fbb_.AddElement(FilterOptions::VT_FILTER_EXPRESSION_TYPE, static_cast(filter_expression_type), 0); + } + void add_filter_expression(flatbuffers::Offset filter_expression) { + fbb_.AddOffset(FilterOptions::VT_FILTER_EXPRESSION, filter_expression); + } + explicit FilterOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FilterOptionsBuilder &operator=(const FilterOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, FilterOptions::VT_FILTER_EXPRESSION); + return o; + } +}; + +inline flatbuffers::Offset CreateFilterOptions( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::Expression filter_expression_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, + flatbuffers::Offset filter_expression = 0) { + FilterOptionsBuilder builder_(_fbb); + builder_.add_filter_expression(filter_expression); + builder_.add_filter_expression_type(filter_expression_type); + return builder_.Finish(); +} + +/// The contents of Relation.options will be ProjectOptions +/// if Relation.relation_name = "project" +struct ProjectOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ProjectOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_EXPRESSIONS_TYPE = 4, + VT_EXPRESSIONS = 6 + }; + const flatbuffers::Vector *expressions_type() const { + return GetPointer *>(VT_EXPRESSIONS_TYPE); + } + /// Expressions which will be evaluated to produce to + /// the rows of the "project" relation's output. + const flatbuffers::Vector> *expressions() const { + return GetPointer> *>(VT_EXPRESSIONS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_EXPRESSIONS_TYPE) && + verifier.VerifyVector(expressions_type()) && + VerifyOffsetRequired(verifier, VT_EXPRESSIONS) && + verifier.VerifyVector(expressions()) && + VerifyExpressionVector(verifier, expressions(), expressions_type()) && + verifier.EndTable(); + } +}; + +struct ProjectOptionsBuilder { + typedef ProjectOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_expressions_type(flatbuffers::Offset> expressions_type) { + fbb_.AddOffset(ProjectOptions::VT_EXPRESSIONS_TYPE, expressions_type); + } + void add_expressions(flatbuffers::Offset>> expressions) { + fbb_.AddOffset(ProjectOptions::VT_EXPRESSIONS, expressions); + } + explicit ProjectOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ProjectOptionsBuilder &operator=(const ProjectOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, ProjectOptions::VT_EXPRESSIONS_TYPE); + fbb_.Required(o, ProjectOptions::VT_EXPRESSIONS); + return o; + } +}; + +inline flatbuffers::Offset CreateProjectOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> expressions_type = 0, + flatbuffers::Offset>> expressions = 0) { + ProjectOptionsBuilder builder_(_fbb); + builder_.add_expressions(expressions); + builder_.add_expressions_type(expressions_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateProjectOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *expressions_type = nullptr, + const std::vector> *expressions = nullptr) { + auto expressions_type__ = expressions_type ? _fbb.CreateVector(*expressions_type) : 0; + auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; + return org::apache::arrow::flatbuf::computeir::CreateProjectOptions( + _fbb, + expressions_type__, + expressions__); +} + +/// The contents of Relation.options will be AggregateOptions +/// if Relation.relation_name = "aggregate" +struct AggregateOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef AggregateOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_AGGREGATIONS_TYPE = 4, + VT_AGGREGATIONS = 6, + VT_KEYS_TYPE = 8, + VT_KEYS = 10 + }; + const flatbuffers::Vector *aggregations_type() const { + return GetPointer *>(VT_AGGREGATIONS_TYPE); + } + /// Expressions which will be evaluated to produce to + /// the rows of the "aggregate" relation's output. + const flatbuffers::Vector> *aggregations() const { + return GetPointer> *>(VT_AGGREGATIONS); + } + const flatbuffers::Vector *keys_type() const { + return GetPointer *>(VT_KEYS_TYPE); + } + /// Keys by which `aggregations` will be grouped. + const flatbuffers::Vector> *keys() const { + return GetPointer> *>(VT_KEYS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_AGGREGATIONS_TYPE) && + verifier.VerifyVector(aggregations_type()) && + VerifyOffsetRequired(verifier, VT_AGGREGATIONS) && + verifier.VerifyVector(aggregations()) && + VerifyExpressionVector(verifier, aggregations(), aggregations_type()) && + VerifyOffset(verifier, VT_KEYS_TYPE) && + verifier.VerifyVector(keys_type()) && + VerifyOffset(verifier, VT_KEYS) && + verifier.VerifyVector(keys()) && + VerifyExpressionVector(verifier, keys(), keys_type()) && + verifier.EndTable(); + } +}; + +struct AggregateOptionsBuilder { + typedef AggregateOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_aggregations_type(flatbuffers::Offset> aggregations_type) { + fbb_.AddOffset(AggregateOptions::VT_AGGREGATIONS_TYPE, aggregations_type); + } + void add_aggregations(flatbuffers::Offset>> aggregations) { + fbb_.AddOffset(AggregateOptions::VT_AGGREGATIONS, aggregations); + } + void add_keys_type(flatbuffers::Offset> keys_type) { + fbb_.AddOffset(AggregateOptions::VT_KEYS_TYPE, keys_type); + } + void add_keys(flatbuffers::Offset>> keys) { + fbb_.AddOffset(AggregateOptions::VT_KEYS, keys); + } + explicit AggregateOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + AggregateOptionsBuilder &operator=(const AggregateOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, AggregateOptions::VT_AGGREGATIONS_TYPE); + fbb_.Required(o, AggregateOptions::VT_AGGREGATIONS); + return o; + } +}; + +inline flatbuffers::Offset CreateAggregateOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> aggregations_type = 0, + flatbuffers::Offset>> aggregations = 0, + flatbuffers::Offset> keys_type = 0, + flatbuffers::Offset>> keys = 0) { + AggregateOptionsBuilder builder_(_fbb); + builder_.add_keys(keys); + builder_.add_keys_type(keys_type); + builder_.add_aggregations(aggregations); + builder_.add_aggregations_type(aggregations_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateAggregateOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *aggregations_type = nullptr, + const std::vector> *aggregations = nullptr, + const std::vector *keys_type = nullptr, + const std::vector> *keys = nullptr) { + auto aggregations_type__ = aggregations_type ? _fbb.CreateVector(*aggregations_type) : 0; + auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; + auto keys_type__ = keys_type ? _fbb.CreateVector(*keys_type) : 0; + auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; + return org::apache::arrow::flatbuf::computeir::CreateAggregateOptions( + _fbb, + aggregations_type__, + aggregations__, + keys_type__, + keys__); +} + +/// The contents of Relation.options will be JoinOptions +/// if Relation.relation_name = "join" +struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef JoinOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ON_EXPRESSION_TYPE = 4, + VT_ON_EXPRESSION = 6, + VT_JOIN_KIND = 8 + }; + org::apache::arrow::flatbuf::computeir::Expression on_expression_type() const { + return static_cast(GetField(VT_ON_EXPRESSION_TYPE, 0)); + } + /// The expression which will be evaluated against rows from each + /// input to determine whether they should be included in the + /// "join" relation's output. + const void *on_expression() const { + return GetPointer(VT_ON_EXPRESSION); + } + template const T *on_expression_as() const; + const org::apache::arrow::flatbuf::computeir::Literal *on_expression_as_Literal() const { + return on_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Literal ? static_cast(on_expression()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::FieldRef *on_expression_as_FieldRef() const { + return on_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::FieldRef ? static_cast(on_expression()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Call *on_expression_as_Call() const { + return on_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Call ? static_cast(on_expression()) : nullptr; + } + const flatbuffers::String *join_kind() const { + return GetPointer(VT_JOIN_KIND); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ON_EXPRESSION_TYPE) && + VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && + VerifyExpression(verifier, on_expression(), on_expression_type()) && + VerifyOffset(verifier, VT_JOIN_KIND) && + verifier.VerifyString(join_kind()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::flatbuf::computeir::Literal *JoinOptions::on_expression_as() const { + return on_expression_as_Literal(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *JoinOptions::on_expression_as() const { + return on_expression_as_FieldRef(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Call *JoinOptions::on_expression_as() const { + return on_expression_as_Call(); +} + +struct JoinOptionsBuilder { + typedef JoinOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_on_expression_type(org::apache::arrow::flatbuf::computeir::Expression on_expression_type) { + fbb_.AddElement(JoinOptions::VT_ON_EXPRESSION_TYPE, static_cast(on_expression_type), 0); + } + void add_on_expression(flatbuffers::Offset on_expression) { + fbb_.AddOffset(JoinOptions::VT_ON_EXPRESSION, on_expression); + } + void add_join_kind(flatbuffers::Offset join_kind) { + fbb_.AddOffset(JoinOptions::VT_JOIN_KIND, join_kind); + } + explicit JoinOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + JoinOptionsBuilder &operator=(const JoinOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, JoinOptions::VT_ON_EXPRESSION); + return o; + } +}; + +inline flatbuffers::Offset CreateJoinOptions( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::Expression on_expression_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, + flatbuffers::Offset on_expression = 0, + flatbuffers::Offset join_kind = 0) { + JoinOptionsBuilder builder_(_fbb); + builder_.add_join_kind(join_kind); + builder_.add_on_expression(on_expression); + builder_.add_on_expression_type(on_expression_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateJoinOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::Expression on_expression_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, + flatbuffers::Offset on_expression = 0, + const char *join_kind = nullptr) { + auto join_kind__ = join_kind ? _fbb.CreateString(join_kind) : 0; + return org::apache::arrow::flatbuf::computeir::CreateJoinOptions( + _fbb, + on_expression_type, + on_expression, + join_kind__); +} + +struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef SortKeyBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE_TYPE = 4, + VT_VALUE = 6, + VT_ORDERING = 8 + }; + org::apache::arrow::flatbuf::computeir::Expression value_type() const { + return static_cast(GetField(VT_VALUE_TYPE, 0)); + } + const void *value() const { + return GetPointer(VT_VALUE); + } + template const T *value_as() const; + const org::apache::arrow::flatbuf::computeir::Literal *value_as_Literal() const { + return value_type() == org::apache::arrow::flatbuf::computeir::Expression::Literal ? static_cast(value()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::FieldRef *value_as_FieldRef() const { + return value_type() == org::apache::arrow::flatbuf::computeir::Expression::FieldRef ? static_cast(value()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Call *value_as_Call() const { + return value_type() == org::apache::arrow::flatbuf::computeir::Expression::Call ? static_cast(value()) : nullptr; + } + org::apache::arrow::flatbuf::computeir::Ordering ordering() const { + return static_cast(GetField(VT_ORDERING, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE_TYPE) && + VerifyOffsetRequired(verifier, VT_VALUE) && + VerifyExpression(verifier, value(), value_type()) && + VerifyField(verifier, VT_ORDERING) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::flatbuf::computeir::Literal *SortKey::value_as() const { + return value_as_Literal(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *SortKey::value_as() const { + return value_as_FieldRef(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Call *SortKey::value_as() const { + return value_as_Call(); +} + +struct SortKeyBuilder { + typedef SortKey Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value_type(org::apache::arrow::flatbuf::computeir::Expression value_type) { + fbb_.AddElement(SortKey::VT_VALUE_TYPE, static_cast(value_type), 0); + } + void add_value(flatbuffers::Offset value) { + fbb_.AddOffset(SortKey::VT_VALUE, value); + } + void add_ordering(org::apache::arrow::flatbuf::computeir::Ordering ordering) { + fbb_.AddElement(SortKey::VT_ORDERING, static_cast(ordering), 0); + } + explicit SortKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + SortKeyBuilder &operator=(const SortKeyBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, SortKey::VT_VALUE); + return o; + } +}; + +inline flatbuffers::Offset CreateSortKey( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::Expression value_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, + flatbuffers::Offset value = 0, + org::apache::arrow::flatbuf::computeir::Ordering ordering = org::apache::arrow::flatbuf::computeir::Ordering::ASCENDING_THEN_NULLS) { + SortKeyBuilder builder_(_fbb); + builder_.add_value(value); + builder_.add_ordering(ordering); + builder_.add_value_type(value_type); + return builder_.Finish(); +} + +/// The contents of Relation.options will be OrderByOptions +/// if Relation.relation_name = "order_by" +struct OrderByOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef OrderByOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_KEYS = 4 + }; + /// Define sort order for rows of output. + /// Keys with higher precedence are ordered ahead of other keys. + const flatbuffers::Vector> *keys() const { + return GetPointer> *>(VT_KEYS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_KEYS) && + verifier.VerifyVector(keys()) && + verifier.VerifyVectorOfTables(keys()) && + verifier.EndTable(); + } +}; + +struct OrderByOptionsBuilder { + typedef OrderByOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_keys(flatbuffers::Offset>> keys) { + fbb_.AddOffset(OrderByOptions::VT_KEYS, keys); + } + explicit OrderByOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + OrderByOptionsBuilder &operator=(const OrderByOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, OrderByOptions::VT_KEYS); + return o; + } +}; + +inline flatbuffers::Offset CreateOrderByOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> keys = 0) { + OrderByOptionsBuilder builder_(_fbb); + builder_.add_keys(keys); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateOrderByOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *keys = nullptr) { + auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; + return org::apache::arrow::flatbuf::computeir::CreateOrderByOptions( + _fbb, + keys__); +} + +/// The contents of Relation.options will be LimitOptions +/// if Relation.relation_name = "limit" +struct LimitOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LimitOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_COUNT = 4 + }; + /// Set the maximum number of rows of output. + int64_t count() const { + return GetField(VT_COUNT, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_COUNT) && + verifier.EndTable(); + } +}; + +struct LimitOptionsBuilder { + typedef LimitOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_count(int64_t count) { + fbb_.AddElement(LimitOptions::VT_COUNT, count, 0); + } + explicit LimitOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + LimitOptionsBuilder &operator=(const LimitOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateLimitOptions( + flatbuffers::FlatBufferBuilder &_fbb, + int64_t count = 0) { + LimitOptionsBuilder builder_(_fbb); + builder_.add_count(count); + return builder_.Finish(); +} + +/// The contents of Relation.options will be CommonOptions +/// if Relation.relation_name = "common" +struct CommonOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CommonOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4 + }; + /// Commons (CTEs in SQL) allow assigning a name to a stream + /// of data and reusing it, potentially multiple times and + /// potentially recursively. + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct CommonOptionsBuilder { + typedef CommonOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(CommonOptions::VT_NAME, name); + } + explicit CommonOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CommonOptionsBuilder &operator=(const CommonOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCommonOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0) { + CommonOptionsBuilder builder_(_fbb); + builder_.add_name(name); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateCommonOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::flatbuf::computeir::CreateCommonOptions( + _fbb, + name__); +} + +/// The contents of Relation.options will be UnionOptions +/// if Relation.relation_name = "union" +struct UnionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UnionOptionsBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct UnionOptionsBuilder { + typedef UnionOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit UnionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UnionOptionsBuilder &operator=(const UnionOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateUnionOptions( + flatbuffers::FlatBufferBuilder &_fbb) { + UnionOptionsBuilder builder_(_fbb); + return builder_.Finish(); +} + +/// The contents of Relation.options will be LiteralOptions +/// if Relation.relation_name = "literal" +struct LiteralOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LiteralOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BATCHES = 4 + }; + /// Batches of rows in this literal. + const flatbuffers::Vector> *batches() const { + return GetPointer> *>(VT_BATCHES); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BATCHES) && + verifier.VerifyVector(batches()) && + verifier.VerifyVectorOfTables(batches()) && + verifier.EndTable(); + } +}; + +struct LiteralOptionsBuilder { + typedef LiteralOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_batches(flatbuffers::Offset>> batches) { + fbb_.AddOffset(LiteralOptions::VT_BATCHES, batches); + } + explicit LiteralOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + LiteralOptionsBuilder &operator=(const LiteralOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, LiteralOptions::VT_BATCHES); + return o; + } +}; + +inline flatbuffers::Offset CreateLiteralOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> batches = 0) { + LiteralOptionsBuilder builder_(_fbb); + builder_.add_batches(batches); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateLiteralOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *batches = nullptr) { + auto batches__ = batches ? _fbb.CreateVector>(*batches) : 0; + return org::apache::arrow::flatbuf::computeir::CreateLiteralOptions( + _fbb, + batches__); +} + +/// A specification of a query. +struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef PlanBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SINKS = 4, + VT_DICTIONARY_BATCH = 6, + VT_DERIVED_FROM = 8 + }; + /// One or more output relations. + const flatbuffers::Vector> *sinks() const { + return GetPointer> *>(VT_SINKS); + } + /// Dictionary batches which may be referenced by Literals. + const flatbuffers::Vector> *dictionary_batch() const { + return GetPointer> *>(VT_DICTIONARY_BATCH); + } + /// If this Plan was derived from another (for example by running + /// an optimization pass), that plan may be included here to + /// provide a backtrace of derivations. + const org::apache::arrow::flatbuf::computeir::Plan *derived_from() const { + return GetPointer(VT_DERIVED_FROM); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_SINKS) && + verifier.VerifyVector(sinks()) && + verifier.VerifyVectorOfTables(sinks()) && + VerifyOffset(verifier, VT_DICTIONARY_BATCH) && + verifier.VerifyVector(dictionary_batch()) && + verifier.VerifyVectorOfTables(dictionary_batch()) && + VerifyOffset(verifier, VT_DERIVED_FROM) && + verifier.VerifyTable(derived_from()) && + verifier.EndTable(); + } +}; + +struct PlanBuilder { + typedef Plan Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_sinks(flatbuffers::Offset>> sinks) { + fbb_.AddOffset(Plan::VT_SINKS, sinks); + } + void add_dictionary_batch(flatbuffers::Offset>> dictionary_batch) { + fbb_.AddOffset(Plan::VT_DICTIONARY_BATCH, dictionary_batch); + } + void add_derived_from(flatbuffers::Offset derived_from) { + fbb_.AddOffset(Plan::VT_DERIVED_FROM, derived_from); + } + explicit PlanBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + PlanBuilder &operator=(const PlanBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Plan::VT_SINKS); + return o; + } +}; + +inline flatbuffers::Offset CreatePlan( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> sinks = 0, + flatbuffers::Offset>> dictionary_batch = 0, + flatbuffers::Offset derived_from = 0) { + PlanBuilder builder_(_fbb); + builder_.add_derived_from(derived_from); + builder_.add_dictionary_batch(dictionary_batch); + builder_.add_sinks(sinks); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreatePlanDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *sinks = nullptr, + const std::vector> *dictionary_batch = nullptr, + flatbuffers::Offset derived_from = 0) { + auto sinks__ = sinks ? _fbb.CreateVector>(*sinks) : 0; + auto dictionary_batch__ = dictionary_batch ? _fbb.CreateVector>(*dictionary_batch) : 0; + return org::apache::arrow::flatbuf::computeir::CreatePlan( + _fbb, + sinks__, + dictionary_batch__, + derived_from); +} + +inline bool VerifyExpression(flatbuffers::Verifier &verifier, const void *obj, Expression type) { + switch (type) { + case Expression::NONE: { + return true; + } + case Expression::Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Expression::FieldRef: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Expression::Call: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyExpressionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyExpression( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape type) { + switch (type) { + case Shape::NONE: { + return true; + } + case Shape::ArrayShape: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Shape::ScalarShape: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyShape( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const org::apache::arrow::flatbuf::computeir::Plan *GetPlan(const void *buf) { + return flatbuffers::GetRoot(buf); +} + +inline const org::apache::arrow::flatbuf::computeir::Plan *GetSizePrefixedPlan(const void *buf) { + return flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyPlanBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedPlanBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishPlanBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedPlanBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace computeir +} // namespace flatbuf +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_H_ diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index e84bdaf16d30c..346a013810048 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -25,10 +25,14 @@ namespace org.apache.arrow.flatbuf.computeir; /// - a reference to a Field from a Relation /// - a call to a named function /// On evaluation, an Expression will have either array or scalar shape. -union Expression { +union ExpressionImpl { Literal, FieldRef, Call } +table Expression { + impl: ExpressionImpl (required); +} + union Shape { ArrayShape, ScalarShape } From de14e46a4118b5e18c0807ddd2f62b1f22104939 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Mon, 16 Aug 2021 16:08:01 -0400 Subject: [PATCH 16/96] make common name required --- format/ComputeIR.fbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 346a013810048..6b2eb3ccea327 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -188,7 +188,7 @@ table CommonOptions { /// Commons (CTEs in SQL) allow assigning a name to a stream /// of data and reusing it, potentially multiple times and /// potentially recursively. - name: string; + name: string (required); } /// The contents of Relation.options will be UnionOptions From 3b4d33c2c9037ea298f2c1c36eca069afb2ed3f9 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Mon, 16 Aug 2021 16:12:46 -0400 Subject: [PATCH 17/96] make aggregate keys required (may still be empty) --- format/ComputeIR.fbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 6b2eb3ccea327..e88545d135db2 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -140,7 +140,7 @@ table AggregateOptions { /// the rows of the "aggregate" relation's output. aggregations: [Expression] (required); /// Keys by which `aggregations` will be grouped. - keys: [Expression]; + keys: [Expression] (required); } /// The contents of Relation.options will be JoinOptions From e91e8dc79df532b4be571f632c89f3bae5a9f15a Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Mon, 16 Aug 2021 16:21:36 -0400 Subject: [PATCH 18/96] remove Shape suffix --- cpp/src/generated/ComputeIR_generated.h | 508 ++++++++++-------------- format/ComputeIR.fbs | 6 +- 2 files changed, 219 insertions(+), 295 deletions(-) diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index 6a68cb1575db0..77926b337e7fa 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -17,11 +17,14 @@ namespace arrow { namespace flatbuf { namespace computeir { -struct ScalarShape; -struct ScalarShapeBuilder; +struct Expression; +struct ExpressionBuilder; -struct ArrayShape; -struct ArrayShapeBuilder; +struct Scalar; +struct ScalarBuilder; + +struct Array; +struct ArrayBuilder; struct Literal; struct LiteralBuilder; @@ -73,7 +76,7 @@ struct PlanBuilder; /// - a reference to a Field from a Relation /// - a call to a named function /// On evaluation, an Expression will have either array or scalar shape. -enum class Expression : uint8_t { +enum class ExpressionImpl : uint8_t { NONE = 0, Literal = 1, FieldRef = 2, @@ -82,17 +85,17 @@ enum class Expression : uint8_t { MAX = Call }; -inline const Expression (&EnumValuesExpression())[4] { - static const Expression values[] = { - Expression::NONE, - Expression::Literal, - Expression::FieldRef, - Expression::Call +inline const ExpressionImpl (&EnumValuesExpressionImpl())[4] { + static const ExpressionImpl values[] = { + ExpressionImpl::NONE, + ExpressionImpl::Literal, + ExpressionImpl::FieldRef, + ExpressionImpl::Call }; return values; } -inline const char * const *EnumNamesExpression() { +inline const char * const *EnumNamesExpressionImpl() { static const char * const names[5] = { "NONE", "Literal", @@ -103,44 +106,44 @@ inline const char * const *EnumNamesExpression() { return names; } -inline const char *EnumNameExpression(Expression e) { - if (flatbuffers::IsOutRange(e, Expression::NONE, Expression::Call)) return ""; +inline const char *EnumNameExpressionImpl(ExpressionImpl e) { + if (flatbuffers::IsOutRange(e, ExpressionImpl::NONE, ExpressionImpl::Call)) return ""; const size_t index = static_cast(e); - return EnumNamesExpression()[index]; + return EnumNamesExpressionImpl()[index]; } -template struct ExpressionTraits { - static const Expression enum_value = Expression::NONE; +template struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::NONE; }; -template<> struct ExpressionTraits { - static const Expression enum_value = Expression::Literal; +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::Literal; }; -template<> struct ExpressionTraits { - static const Expression enum_value = Expression::FieldRef; +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::FieldRef; }; -template<> struct ExpressionTraits { - static const Expression enum_value = Expression::Call; +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::Call; }; -bool VerifyExpression(flatbuffers::Verifier &verifier, const void *obj, Expression type); -bool VerifyExpressionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); +bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type); +bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); enum class Shape : uint8_t { NONE = 0, - ArrayShape = 1, - ScalarShape = 2, + Array = 1, + Scalar = 2, MIN = NONE, - MAX = ScalarShape + MAX = Scalar }; inline const Shape (&EnumValuesShape())[3] { static const Shape values[] = { Shape::NONE, - Shape::ArrayShape, - Shape::ScalarShape + Shape::Array, + Shape::Scalar }; return values; } @@ -148,15 +151,15 @@ inline const Shape (&EnumValuesShape())[3] { inline const char * const *EnumNamesShape() { static const char * const names[4] = { "NONE", - "ArrayShape", - "ScalarShape", + "Array", + "Scalar", nullptr }; return names; } inline const char *EnumNameShape(Shape e) { - if (flatbuffers::IsOutRange(e, Shape::NONE, Shape::ScalarShape)) return ""; + if (flatbuffers::IsOutRange(e, Shape::NONE, Shape::Scalar)) return ""; const size_t index = static_cast(e); return EnumNamesShape()[index]; } @@ -165,12 +168,12 @@ template struct ShapeTraits { static const Shape enum_value = Shape::NONE; }; -template<> struct ShapeTraits { - static const Shape enum_value = Shape::ArrayShape; +template<> struct ShapeTraits { + static const Shape enum_value = Shape::Array; }; -template<> struct ShapeTraits { - static const Shape enum_value = Shape::ScalarShape; +template<> struct ShapeTraits { + static const Shape enum_value = Shape::Scalar; }; bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape type); @@ -214,38 +217,114 @@ inline const char *EnumNameOrdering(Ordering e) { return EnumNamesOrdering()[index]; } -struct ScalarShape FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ScalarShapeBuilder Builder; +struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ExpressionBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IMPL_TYPE = 4, + VT_IMPL = 6 + }; + org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::flatbuf::computeir::Literal *impl_as_Literal() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::ExpressionImpl::Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::FieldRef *impl_as_FieldRef() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::ExpressionImpl::FieldRef ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Call *impl_as_Call() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::ExpressionImpl::Call ? static_cast(impl()) : nullptr; + } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyExpressionImpl(verifier, impl(), impl_type()) && verifier.EndTable(); } }; -struct ScalarShapeBuilder { - typedef ScalarShape Table; +template<> inline const org::apache::arrow::flatbuf::computeir::Literal *Expression::impl_as() const { + return impl_as_Literal(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *Expression::impl_as() const { + return impl_as_FieldRef(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Call *Expression::impl_as() const { + return impl_as_Call(); +} + +struct ExpressionBuilder { + typedef Expression Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - explicit ScalarShapeBuilder(flatbuffers::FlatBufferBuilder &_fbb) + void add_impl_type(org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type) { + fbb_.AddElement(Expression::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(Expression::VT_IMPL, impl); + } + explicit ExpressionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ScalarShapeBuilder &operator=(const ScalarShapeBuilder &); - flatbuffers::Offset Finish() { + ExpressionBuilder &operator=(const ExpressionBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Expression::VT_IMPL); return o; } }; -inline flatbuffers::Offset CreateScalarShape( +inline flatbuffers::Offset CreateExpression( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type = org::apache::arrow::flatbuf::computeir::ExpressionImpl::NONE, + flatbuffers::Offset impl = 0) { + ExpressionBuilder builder_(_fbb); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); + return builder_.Finish(); +} + +struct Scalar FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ScalarBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct ScalarBuilder { + typedef Scalar Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit ScalarBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ScalarBuilder &operator=(const ScalarBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateScalar( flatbuffers::FlatBufferBuilder &_fbb) { - ScalarShapeBuilder builder_(_fbb); + ScalarBuilder builder_(_fbb); return builder_.Finish(); } -struct ArrayShape FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ArrayShapeBuilder Builder; +struct Array FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ArrayBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_LENGTH = 4 }; @@ -260,29 +339,29 @@ struct ArrayShape FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -struct ArrayShapeBuilder { - typedef ArrayShape Table; +struct ArrayBuilder { + typedef Array Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_length(int64_t length) { - fbb_.AddElement(ArrayShape::VT_LENGTH, length, 0); + fbb_.AddElement(Array::VT_LENGTH, length, 0); } - explicit ArrayShapeBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit ArrayBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ArrayShapeBuilder &operator=(const ArrayShapeBuilder &); - flatbuffers::Offset Finish() { + ArrayBuilder &operator=(const ArrayBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateArrayShape( +inline flatbuffers::Offset CreateArray( flatbuffers::FlatBufferBuilder &_fbb, int64_t length = 0) { - ArrayShapeBuilder builder_(_fbb); + ArrayBuilder builder_(_fbb); builder_.add_length(length); return builder_.Finish(); } @@ -304,11 +383,11 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { return GetPointer(VT_SHAPE); } template const T *shape_as() const; - const org::apache::arrow::flatbuf::computeir::ArrayShape *shape_as_ArrayShape() const { - return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::ArrayShape ? static_cast(shape()) : nullptr; + const org::apache::arrow::flatbuf::computeir::Array *shape_as_Array() const { + return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::Array ? static_cast(shape()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::ScalarShape *shape_as_ScalarShape() const { - return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::ScalarShape ? static_cast(shape()) : nullptr; + const org::apache::arrow::flatbuf::computeir::Scalar *shape_as_Scalar() const { + return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::Scalar ? static_cast(shape()) : nullptr; } org::apache::arrow::flatbuf::Type type_type() const { return static_cast(GetField(VT_TYPE_TYPE, 0)); @@ -402,12 +481,12 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -template<> inline const org::apache::arrow::flatbuf::computeir::ArrayShape *Literal::shape_as() const { - return shape_as_ArrayShape(); +template<> inline const org::apache::arrow::flatbuf::computeir::Array *Literal::shape_as() const { + return shape_as_Array(); } -template<> inline const org::apache::arrow::flatbuf::computeir::ScalarShape *Literal::shape_as() const { - return shape_as_ScalarShape(); +template<> inline const org::apache::arrow::flatbuf::computeir::Scalar *Literal::shape_as() const { + return shape_as_Scalar(); } template<> inline const org::apache::arrow::flatbuf::Null *Literal::type_as() const { @@ -809,10 +888,9 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_FUNCTION_NAME = 4, VT_OPTIONS = 6, - VT_ARGUMENTS_TYPE = 8, - VT_ARGUMENTS = 10, - VT_TYPE_TYPE = 12, - VT_TYPE = 14 + VT_ARGUMENTS = 8, + VT_TYPE_TYPE = 10, + VT_TYPE = 12 }; /// The name of the function whose invocation this Call represents. const flatbuffers::String *function_name() const { @@ -823,12 +901,9 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const org::apache::arrow::flatbuf::Buffer *options() const { return GetStruct(VT_OPTIONS); } - const flatbuffers::Vector *arguments_type() const { - return GetPointer *>(VT_ARGUMENTS_TYPE); - } /// The arguments passed to `function_name`. - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); } org::apache::arrow::flatbuf::Type type_type() const { return static_cast(GetField(VT_TYPE_TYPE, 0)); @@ -906,11 +981,9 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyOffsetRequired(verifier, VT_FUNCTION_NAME) && verifier.VerifyString(function_name()) && VerifyField(verifier, VT_OPTIONS) && - VerifyOffsetRequired(verifier, VT_ARGUMENTS_TYPE) && - verifier.VerifyVector(arguments_type()) && VerifyOffsetRequired(verifier, VT_ARGUMENTS) && verifier.VerifyVector(arguments()) && - VerifyExpressionVector(verifier, arguments(), arguments_type()) && + verifier.VerifyVectorOfTables(arguments()) && VerifyField(verifier, VT_TYPE_TYPE) && VerifyOffset(verifier, VT_TYPE) && VerifyType(verifier, type(), type_type()) && @@ -1012,10 +1085,7 @@ struct CallBuilder { void add_options(const org::apache::arrow::flatbuf::Buffer *options) { fbb_.AddStruct(Call::VT_OPTIONS, options); } - void add_arguments_type(flatbuffers::Offset> arguments_type) { - fbb_.AddOffset(Call::VT_ARGUMENTS_TYPE, arguments_type); - } - void add_arguments(flatbuffers::Offset>> arguments) { + void add_arguments(flatbuffers::Offset>> arguments) { fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); } void add_type_type(org::apache::arrow::flatbuf::Type type_type) { @@ -1033,7 +1103,6 @@ struct CallBuilder { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); fbb_.Required(o, Call::VT_FUNCTION_NAME); - fbb_.Required(o, Call::VT_ARGUMENTS_TYPE); fbb_.Required(o, Call::VT_ARGUMENTS); return o; } @@ -1043,14 +1112,12 @@ inline flatbuffers::Offset CreateCall( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset function_name = 0, const org::apache::arrow::flatbuf::Buffer *options = 0, - flatbuffers::Offset> arguments_type = 0, - flatbuffers::Offset>> arguments = 0, + flatbuffers::Offset>> arguments = 0, org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, flatbuffers::Offset type = 0) { CallBuilder builder_(_fbb); builder_.add_type(type); builder_.add_arguments(arguments); - builder_.add_arguments_type(arguments_type); builder_.add_options(options); builder_.add_function_name(function_name); builder_.add_type_type(type_type); @@ -1061,18 +1128,15 @@ inline flatbuffers::Offset CreateCallDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *function_name = nullptr, const org::apache::arrow::flatbuf::Buffer *options = 0, - const std::vector *arguments_type = nullptr, - const std::vector> *arguments = nullptr, + const std::vector> *arguments = nullptr, org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, flatbuffers::Offset type = 0) { auto function_name__ = function_name ? _fbb.CreateString(function_name) : 0; - auto arguments_type__ = arguments_type ? _fbb.CreateVector(*arguments_type) : 0; - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; return org::apache::arrow::flatbuf::computeir::CreateCall( _fbb, function_name__, options, - arguments_type__, arguments__, type_type, type); @@ -1196,57 +1260,27 @@ inline flatbuffers::Offset CreateRelationDirect( struct FilterOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef FilterOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_FILTER_EXPRESSION_TYPE = 4, - VT_FILTER_EXPRESSION = 6 + VT_FILTER_EXPRESSION = 4 }; - org::apache::arrow::flatbuf::computeir::Expression filter_expression_type() const { - return static_cast(GetField(VT_FILTER_EXPRESSION_TYPE, 0)); - } /// The expression which will be evaluated against input rows /// to determine whether they should be excluded from the /// "filter" relation's output. - const void *filter_expression() const { - return GetPointer(VT_FILTER_EXPRESSION); - } - template const T *filter_expression_as() const; - const org::apache::arrow::flatbuf::computeir::Literal *filter_expression_as_Literal() const { - return filter_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Literal ? static_cast(filter_expression()) : nullptr; - } - const org::apache::arrow::flatbuf::computeir::FieldRef *filter_expression_as_FieldRef() const { - return filter_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::FieldRef ? static_cast(filter_expression()) : nullptr; - } - const org::apache::arrow::flatbuf::computeir::Call *filter_expression_as_Call() const { - return filter_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Call ? static_cast(filter_expression()) : nullptr; + const org::apache::arrow::flatbuf::computeir::Expression *filter_expression() const { + return GetPointer(VT_FILTER_EXPRESSION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_FILTER_EXPRESSION_TYPE) && VerifyOffsetRequired(verifier, VT_FILTER_EXPRESSION) && - VerifyExpression(verifier, filter_expression(), filter_expression_type()) && + verifier.VerifyTable(filter_expression()) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::computeir::Literal *FilterOptions::filter_expression_as() const { - return filter_expression_as_Literal(); -} - -template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *FilterOptions::filter_expression_as() const { - return filter_expression_as_FieldRef(); -} - -template<> inline const org::apache::arrow::flatbuf::computeir::Call *FilterOptions::filter_expression_as() const { - return filter_expression_as_Call(); -} - struct FilterOptionsBuilder { typedef FilterOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_filter_expression_type(org::apache::arrow::flatbuf::computeir::Expression filter_expression_type) { - fbb_.AddElement(FilterOptions::VT_FILTER_EXPRESSION_TYPE, static_cast(filter_expression_type), 0); - } - void add_filter_expression(flatbuffers::Offset filter_expression) { + void add_filter_expression(flatbuffers::Offset filter_expression) { fbb_.AddOffset(FilterOptions::VT_FILTER_EXPRESSION, filter_expression); } explicit FilterOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) @@ -1264,11 +1298,9 @@ struct FilterOptionsBuilder { inline flatbuffers::Offset CreateFilterOptions( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Expression filter_expression_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, - flatbuffers::Offset filter_expression = 0) { + flatbuffers::Offset filter_expression = 0) { FilterOptionsBuilder builder_(_fbb); builder_.add_filter_expression(filter_expression); - builder_.add_filter_expression_type(filter_expression_type); return builder_.Finish(); } @@ -1277,24 +1309,18 @@ inline flatbuffers::Offset CreateFilterOptions( struct ProjectOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ProjectOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_EXPRESSIONS_TYPE = 4, - VT_EXPRESSIONS = 6 + VT_EXPRESSIONS = 4 }; - const flatbuffers::Vector *expressions_type() const { - return GetPointer *>(VT_EXPRESSIONS_TYPE); - } /// Expressions which will be evaluated to produce to /// the rows of the "project" relation's output. - const flatbuffers::Vector> *expressions() const { - return GetPointer> *>(VT_EXPRESSIONS); + const flatbuffers::Vector> *expressions() const { + return GetPointer> *>(VT_EXPRESSIONS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_EXPRESSIONS_TYPE) && - verifier.VerifyVector(expressions_type()) && VerifyOffsetRequired(verifier, VT_EXPRESSIONS) && verifier.VerifyVector(expressions()) && - VerifyExpressionVector(verifier, expressions(), expressions_type()) && + verifier.VerifyVectorOfTables(expressions()) && verifier.EndTable(); } }; @@ -1303,10 +1329,7 @@ struct ProjectOptionsBuilder { typedef ProjectOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_expressions_type(flatbuffers::Offset> expressions_type) { - fbb_.AddOffset(ProjectOptions::VT_EXPRESSIONS_TYPE, expressions_type); - } - void add_expressions(flatbuffers::Offset>> expressions) { + void add_expressions(flatbuffers::Offset>> expressions) { fbb_.AddOffset(ProjectOptions::VT_EXPRESSIONS, expressions); } explicit ProjectOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) @@ -1317,7 +1340,6 @@ struct ProjectOptionsBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, ProjectOptions::VT_EXPRESSIONS_TYPE); fbb_.Required(o, ProjectOptions::VT_EXPRESSIONS); return o; } @@ -1325,23 +1347,18 @@ struct ProjectOptionsBuilder { inline flatbuffers::Offset CreateProjectOptions( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> expressions_type = 0, - flatbuffers::Offset>> expressions = 0) { + flatbuffers::Offset>> expressions = 0) { ProjectOptionsBuilder builder_(_fbb); builder_.add_expressions(expressions); - builder_.add_expressions_type(expressions_type); return builder_.Finish(); } inline flatbuffers::Offset CreateProjectOptionsDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *expressions_type = nullptr, - const std::vector> *expressions = nullptr) { - auto expressions_type__ = expressions_type ? _fbb.CreateVector(*expressions_type) : 0; - auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; + const std::vector> *expressions = nullptr) { + auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; return org::apache::arrow::flatbuf::computeir::CreateProjectOptions( _fbb, - expressions_type__, expressions__); } @@ -1350,38 +1367,26 @@ inline flatbuffers::Offset CreateProjectOptionsDirect( struct AggregateOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AggregateOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_AGGREGATIONS_TYPE = 4, - VT_AGGREGATIONS = 6, - VT_KEYS_TYPE = 8, - VT_KEYS = 10 + VT_AGGREGATIONS = 4, + VT_KEYS = 6 }; - const flatbuffers::Vector *aggregations_type() const { - return GetPointer *>(VT_AGGREGATIONS_TYPE); - } /// Expressions which will be evaluated to produce to /// the rows of the "aggregate" relation's output. - const flatbuffers::Vector> *aggregations() const { - return GetPointer> *>(VT_AGGREGATIONS); - } - const flatbuffers::Vector *keys_type() const { - return GetPointer *>(VT_KEYS_TYPE); + const flatbuffers::Vector> *aggregations() const { + return GetPointer> *>(VT_AGGREGATIONS); } /// Keys by which `aggregations` will be grouped. - const flatbuffers::Vector> *keys() const { - return GetPointer> *>(VT_KEYS); + const flatbuffers::Vector> *keys() const { + return GetPointer> *>(VT_KEYS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_AGGREGATIONS_TYPE) && - verifier.VerifyVector(aggregations_type()) && VerifyOffsetRequired(verifier, VT_AGGREGATIONS) && verifier.VerifyVector(aggregations()) && - VerifyExpressionVector(verifier, aggregations(), aggregations_type()) && - VerifyOffset(verifier, VT_KEYS_TYPE) && - verifier.VerifyVector(keys_type()) && - VerifyOffset(verifier, VT_KEYS) && + verifier.VerifyVectorOfTables(aggregations()) && + VerifyOffsetRequired(verifier, VT_KEYS) && verifier.VerifyVector(keys()) && - VerifyExpressionVector(verifier, keys(), keys_type()) && + verifier.VerifyVectorOfTables(keys()) && verifier.EndTable(); } }; @@ -1390,16 +1395,10 @@ struct AggregateOptionsBuilder { typedef AggregateOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_aggregations_type(flatbuffers::Offset> aggregations_type) { - fbb_.AddOffset(AggregateOptions::VT_AGGREGATIONS_TYPE, aggregations_type); - } - void add_aggregations(flatbuffers::Offset>> aggregations) { + void add_aggregations(flatbuffers::Offset>> aggregations) { fbb_.AddOffset(AggregateOptions::VT_AGGREGATIONS, aggregations); } - void add_keys_type(flatbuffers::Offset> keys_type) { - fbb_.AddOffset(AggregateOptions::VT_KEYS_TYPE, keys_type); - } - void add_keys(flatbuffers::Offset>> keys) { + void add_keys(flatbuffers::Offset>> keys) { fbb_.AddOffset(AggregateOptions::VT_KEYS, keys); } explicit AggregateOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) @@ -1410,41 +1409,31 @@ struct AggregateOptionsBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, AggregateOptions::VT_AGGREGATIONS_TYPE); fbb_.Required(o, AggregateOptions::VT_AGGREGATIONS); + fbb_.Required(o, AggregateOptions::VT_KEYS); return o; } }; inline flatbuffers::Offset CreateAggregateOptions( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> aggregations_type = 0, - flatbuffers::Offset>> aggregations = 0, - flatbuffers::Offset> keys_type = 0, - flatbuffers::Offset>> keys = 0) { + flatbuffers::Offset>> aggregations = 0, + flatbuffers::Offset>> keys = 0) { AggregateOptionsBuilder builder_(_fbb); builder_.add_keys(keys); - builder_.add_keys_type(keys_type); builder_.add_aggregations(aggregations); - builder_.add_aggregations_type(aggregations_type); return builder_.Finish(); } inline flatbuffers::Offset CreateAggregateOptionsDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *aggregations_type = nullptr, - const std::vector> *aggregations = nullptr, - const std::vector *keys_type = nullptr, - const std::vector> *keys = nullptr) { - auto aggregations_type__ = aggregations_type ? _fbb.CreateVector(*aggregations_type) : 0; - auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; - auto keys_type__ = keys_type ? _fbb.CreateVector(*keys_type) : 0; - auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; + const std::vector> *aggregations = nullptr, + const std::vector> *keys = nullptr) { + auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; + auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; return org::apache::arrow::flatbuf::computeir::CreateAggregateOptions( _fbb, - aggregations_type__, aggregations__, - keys_type__, keys__); } @@ -1453,63 +1442,33 @@ inline flatbuffers::Offset CreateAggregateOptionsDirect( struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef JoinOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ON_EXPRESSION_TYPE = 4, - VT_ON_EXPRESSION = 6, - VT_JOIN_KIND = 8 + VT_ON_EXPRESSION = 4, + VT_JOIN_KIND = 6 }; - org::apache::arrow::flatbuf::computeir::Expression on_expression_type() const { - return static_cast(GetField(VT_ON_EXPRESSION_TYPE, 0)); - } /// The expression which will be evaluated against rows from each /// input to determine whether they should be included in the /// "join" relation's output. - const void *on_expression() const { - return GetPointer(VT_ON_EXPRESSION); - } - template const T *on_expression_as() const; - const org::apache::arrow::flatbuf::computeir::Literal *on_expression_as_Literal() const { - return on_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Literal ? static_cast(on_expression()) : nullptr; - } - const org::apache::arrow::flatbuf::computeir::FieldRef *on_expression_as_FieldRef() const { - return on_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::FieldRef ? static_cast(on_expression()) : nullptr; - } - const org::apache::arrow::flatbuf::computeir::Call *on_expression_as_Call() const { - return on_expression_type() == org::apache::arrow::flatbuf::computeir::Expression::Call ? static_cast(on_expression()) : nullptr; + const org::apache::arrow::flatbuf::computeir::Expression *on_expression() const { + return GetPointer(VT_ON_EXPRESSION); } const flatbuffers::String *join_kind() const { return GetPointer(VT_JOIN_KIND); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ON_EXPRESSION_TYPE) && VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && - VerifyExpression(verifier, on_expression(), on_expression_type()) && + verifier.VerifyTable(on_expression()) && VerifyOffset(verifier, VT_JOIN_KIND) && verifier.VerifyString(join_kind()) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::computeir::Literal *JoinOptions::on_expression_as() const { - return on_expression_as_Literal(); -} - -template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *JoinOptions::on_expression_as() const { - return on_expression_as_FieldRef(); -} - -template<> inline const org::apache::arrow::flatbuf::computeir::Call *JoinOptions::on_expression_as() const { - return on_expression_as_Call(); -} - struct JoinOptionsBuilder { typedef JoinOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_on_expression_type(org::apache::arrow::flatbuf::computeir::Expression on_expression_type) { - fbb_.AddElement(JoinOptions::VT_ON_EXPRESSION_TYPE, static_cast(on_expression_type), 0); - } - void add_on_expression(flatbuffers::Offset on_expression) { + void add_on_expression(flatbuffers::Offset on_expression) { fbb_.AddOffset(JoinOptions::VT_ON_EXPRESSION, on_expression); } void add_join_kind(flatbuffers::Offset join_kind) { @@ -1530,25 +1489,21 @@ struct JoinOptionsBuilder { inline flatbuffers::Offset CreateJoinOptions( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Expression on_expression_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, - flatbuffers::Offset on_expression = 0, + flatbuffers::Offset on_expression = 0, flatbuffers::Offset join_kind = 0) { JoinOptionsBuilder builder_(_fbb); builder_.add_join_kind(join_kind); builder_.add_on_expression(on_expression); - builder_.add_on_expression_type(on_expression_type); return builder_.Finish(); } inline flatbuffers::Offset CreateJoinOptionsDirect( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Expression on_expression_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, - flatbuffers::Offset on_expression = 0, + flatbuffers::Offset on_expression = 0, const char *join_kind = nullptr) { auto join_kind__ = join_kind ? _fbb.CreateString(join_kind) : 0; return org::apache::arrow::flatbuf::computeir::CreateJoinOptions( _fbb, - on_expression_type, on_expression, join_kind__); } @@ -1556,59 +1511,29 @@ inline flatbuffers::Offset CreateJoinOptionsDirect( struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef SortKeyBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE_TYPE = 4, - VT_VALUE = 6, - VT_ORDERING = 8 + VT_VALUE = 4, + VT_ORDERING = 6 }; - org::apache::arrow::flatbuf::computeir::Expression value_type() const { - return static_cast(GetField(VT_VALUE_TYPE, 0)); - } - const void *value() const { - return GetPointer(VT_VALUE); - } - template const T *value_as() const; - const org::apache::arrow::flatbuf::computeir::Literal *value_as_Literal() const { - return value_type() == org::apache::arrow::flatbuf::computeir::Expression::Literal ? static_cast(value()) : nullptr; - } - const org::apache::arrow::flatbuf::computeir::FieldRef *value_as_FieldRef() const { - return value_type() == org::apache::arrow::flatbuf::computeir::Expression::FieldRef ? static_cast(value()) : nullptr; - } - const org::apache::arrow::flatbuf::computeir::Call *value_as_Call() const { - return value_type() == org::apache::arrow::flatbuf::computeir::Expression::Call ? static_cast(value()) : nullptr; + const org::apache::arrow::flatbuf::computeir::Expression *value() const { + return GetPointer(VT_VALUE); } org::apache::arrow::flatbuf::computeir::Ordering ordering() const { return static_cast(GetField(VT_ORDERING, 0)); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE_TYPE) && VerifyOffsetRequired(verifier, VT_VALUE) && - VerifyExpression(verifier, value(), value_type()) && + verifier.VerifyTable(value()) && VerifyField(verifier, VT_ORDERING) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::computeir::Literal *SortKey::value_as() const { - return value_as_Literal(); -} - -template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *SortKey::value_as() const { - return value_as_FieldRef(); -} - -template<> inline const org::apache::arrow::flatbuf::computeir::Call *SortKey::value_as() const { - return value_as_Call(); -} - struct SortKeyBuilder { typedef SortKey Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_value_type(org::apache::arrow::flatbuf::computeir::Expression value_type) { - fbb_.AddElement(SortKey::VT_VALUE_TYPE, static_cast(value_type), 0); - } - void add_value(flatbuffers::Offset value) { + void add_value(flatbuffers::Offset value) { fbb_.AddOffset(SortKey::VT_VALUE, value); } void add_ordering(org::apache::arrow::flatbuf::computeir::Ordering ordering) { @@ -1629,13 +1554,11 @@ struct SortKeyBuilder { inline flatbuffers::Offset CreateSortKey( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Expression value_type = org::apache::arrow::flatbuf::computeir::Expression::NONE, - flatbuffers::Offset value = 0, + flatbuffers::Offset value = 0, org::apache::arrow::flatbuf::computeir::Ordering ordering = org::apache::arrow::flatbuf::computeir::Ordering::ASCENDING_THEN_NULLS) { SortKeyBuilder builder_(_fbb); builder_.add_value(value); builder_.add_ordering(ordering); - builder_.add_value_type(value_type); return builder_.Finish(); } @@ -1757,7 +1680,7 @@ struct CommonOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME) && + VerifyOffsetRequired(verifier, VT_NAME) && verifier.VerifyString(name()) && verifier.EndTable(); } @@ -1778,6 +1701,7 @@ struct CommonOptionsBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); + fbb_.Required(o, CommonOptions::VT_NAME); return o; } }; @@ -1976,20 +1900,20 @@ inline flatbuffers::Offset CreatePlanDirect( derived_from); } -inline bool VerifyExpression(flatbuffers::Verifier &verifier, const void *obj, Expression type) { +inline bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type) { switch (type) { - case Expression::NONE: { + case ExpressionImpl::NONE: { return true; } - case Expression::Literal: { + case ExpressionImpl::Literal: { auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } - case Expression::FieldRef: { + case ExpressionImpl::FieldRef: { auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } - case Expression::Call: { + case ExpressionImpl::Call: { auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } @@ -1997,12 +1921,12 @@ inline bool VerifyExpression(flatbuffers::Verifier &verifier, const void *obj, E } } -inline bool VerifyExpressionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { +inline bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { if (!values || !types) return !values && !types; if (values->size() != types->size()) return false; for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyExpression( - verifier, values->Get(i), types->GetEnum(i))) { + if (!VerifyExpressionImpl( + verifier, values->Get(i), types->GetEnum(i))) { return false; } } @@ -2014,12 +1938,12 @@ inline bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape case Shape::NONE: { return true; } - case Shape::ArrayShape: { - auto ptr = reinterpret_cast(obj); + case Shape::Array: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } - case Shape::ScalarShape: { - auto ptr = reinterpret_cast(obj); + case Shape::Scalar: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index e88545d135db2..4323f71081c6f 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -34,12 +34,12 @@ table Expression { } union Shape { - ArrayShape, ScalarShape + Array, Scalar } -table ScalarShape {} +table Scalar {} -table ArrayShape { +table Array { /// Number of slots. length: long; } From f19326b9a2550fba5fd765263275e59729f18d80 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Tue, 17 Aug 2021 11:14:54 -0400 Subject: [PATCH 19/96] clarify that namespaces end in :: --- cpp/src/generated/ComputeIR_generated.h | 8 ++++++-- format/ComputeIR.fbs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index 77926b337e7fa..e6cbef5bdfc55 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -892,7 +892,10 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_TYPE_TYPE = 10, VT_TYPE = 12 }; - /// The name of the function whose invocation this Call represents. + /// The namespaced name of the function whose invocation this Call represents. + /// For example: "arrow::add" or "gandiva::jit_3432". + /// + /// Names with no namespace are reserved for canonicalization. const flatbuffers::String *function_name() const { return GetPointer(VT_FUNCTION_NAME); } @@ -1152,8 +1155,9 @@ struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_SCHEMA = 10 }; /// The namespaced name of this Relation. + /// For example: "arrow::hash_join" or "gandiva::filter_and_project". /// - /// Names with no namespace are reserved for pure relational + /// Names with no namespace are reserved for canonical, "pure" relational /// algebraic operations, which currently include: /// "filter" /// "project" diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 4323f71081c6f..540c9f095ab75 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -73,7 +73,10 @@ table FieldRef { } table Call { - /// The name of the function whose invocation this Call represents. + /// The namespaced name of the function whose invocation this Call represents. + /// For example: "arrow::add" or "gandiva::jit_3432". + /// + /// Names with no namespace are reserved for canonicalization. function_name: string (required); /// Parameters for `function_name`; content/format may be unique to each @@ -90,8 +93,9 @@ table Call { /// A relation is a set of rows with consistent schema. table Relation { /// The namespaced name of this Relation. + /// For example: "arrow::hash_join" or "gandiva::filter_and_project". /// - /// Names with no namespace are reserved for pure relational + /// Names with no namespace are reserved for canonical, "pure" relational /// algebraic operations, which currently include: /// "filter" /// "project" From 9b80f8afa281f72839de1bce1254152672cef5f9 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Tue, 17 Aug 2021 11:42:45 -0400 Subject: [PATCH 20/96] clarify JoinOptions.join_name --- cpp/src/generated/ComputeIR_generated.h | 31 +++++++++++++++---------- format/ComputeIR.fbs | 9 ++++++- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index e6cbef5bdfc55..557b1a9f6409d 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -1447,7 +1447,7 @@ struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef JoinOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ON_EXPRESSION = 4, - VT_JOIN_KIND = 6 + VT_JOIN_NAME = 6 }; /// The expression which will be evaluated against rows from each /// input to determine whether they should be included in the @@ -1455,15 +1455,22 @@ struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const org::apache::arrow::flatbuf::computeir::Expression *on_expression() const { return GetPointer(VT_ON_EXPRESSION); } - const flatbuffers::String *join_kind() const { - return GetPointer(VT_JOIN_KIND); + /// The namespaced name of the join to use. Non-namespaced names are + /// reserved for canonicalization. Current names include: + /// "inner" + /// "left" + /// "right" + /// "outer" + /// "cross" + const flatbuffers::String *join_name() const { + return GetPointer(VT_JOIN_NAME); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && verifier.VerifyTable(on_expression()) && - VerifyOffset(verifier, VT_JOIN_KIND) && - verifier.VerifyString(join_kind()) && + VerifyOffset(verifier, VT_JOIN_NAME) && + verifier.VerifyString(join_name()) && verifier.EndTable(); } }; @@ -1475,8 +1482,8 @@ struct JoinOptionsBuilder { void add_on_expression(flatbuffers::Offset on_expression) { fbb_.AddOffset(JoinOptions::VT_ON_EXPRESSION, on_expression); } - void add_join_kind(flatbuffers::Offset join_kind) { - fbb_.AddOffset(JoinOptions::VT_JOIN_KIND, join_kind); + void add_join_name(flatbuffers::Offset join_name) { + fbb_.AddOffset(JoinOptions::VT_JOIN_NAME, join_name); } explicit JoinOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { @@ -1494,9 +1501,9 @@ struct JoinOptionsBuilder { inline flatbuffers::Offset CreateJoinOptions( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset on_expression = 0, - flatbuffers::Offset join_kind = 0) { + flatbuffers::Offset join_name = 0) { JoinOptionsBuilder builder_(_fbb); - builder_.add_join_kind(join_kind); + builder_.add_join_name(join_name); builder_.add_on_expression(on_expression); return builder_.Finish(); } @@ -1504,12 +1511,12 @@ inline flatbuffers::Offset CreateJoinOptions( inline flatbuffers::Offset CreateJoinOptionsDirect( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset on_expression = 0, - const char *join_kind = nullptr) { - auto join_kind__ = join_kind ? _fbb.CreateString(join_kind) : 0; + const char *join_name = nullptr) { + auto join_name__ = join_name ? _fbb.CreateString(join_name) : 0; return org::apache::arrow::flatbuf::computeir::CreateJoinOptions( _fbb, on_expression, - join_kind__); + join_name__); } struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 540c9f095ab75..25b17e53116f9 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -154,7 +154,14 @@ table JoinOptions { /// input to determine whether they should be included in the /// "join" relation's output. on_expression: Expression (required); - join_kind: string; + /// The namespaced name of the join to use. Non-namespaced names are + /// reserved for canonicalization. Current names include: + /// "inner" + /// "left" + /// "right" + /// "outer" + /// "cross" + join_name: string; } /// Whether lesser values should precede greater or vice versa, From d8b2f14e3495566da6ca02958823d9d394667602 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Tue, 17 Aug 2021 12:07:01 -0400 Subject: [PATCH 21/96] Make byte blobs inline so we don't need a sidecar buffer --- .../ComputeIR.ExampleExtensions_generated.h | 3 - cpp/src/generated/ComputeIR.grpc.fb.cc | 16 +- cpp/src/generated/ComputeIR.grpc.fb.h | 50 ++--- cpp/src/generated/ComputeIR_generated.h | 180 ++++++++++++------ format/ComputeIR.fbs | 37 ++-- 5 files changed, 177 insertions(+), 109 deletions(-) diff --git a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h index 0f65c034443e9..5e999feb100bb 100644 --- a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h +++ b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h @@ -7,10 +7,7 @@ #include "flatbuffers/flatbuffers.h" #include "ComputeIR_generated.h" -#include "Message_generated.h" #include "Schema_generated.h" -#include "SparseTensor_generated.h" -#include "Tensor_generated.h" namespace org { namespace apache { diff --git a/cpp/src/generated/ComputeIR.grpc.fb.cc b/cpp/src/generated/ComputeIR.grpc.fb.cc index 66789402f2a59..ba2ca10e1f947 100644 --- a/cpp/src/generated/ComputeIR.grpc.fb.cc +++ b/cpp/src/generated/ComputeIR.grpc.fb.cc @@ -46,16 +46,16 @@ ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* Interactiv return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_explain_, context, request, false); } -::grpc::ClientReader< flatbuffers::grpc::Message>* Interactive::Stub::executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { - return ::grpc::internal::ClientReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), rpcmethod_execute_, context, request); +::grpc::ClientReader< flatbuffers::grpc::Message>* Interactive::Stub::executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { + return ::grpc::internal::ClientReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), rpcmethod_execute_, context, request); } -::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { - return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, true, tag); +::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { + return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, true, tag); } -::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, false, nullptr); +::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, false, nullptr); } Interactive::Service::Service() { @@ -67,7 +67,7 @@ Interactive::Service::Service() { AddMethod(new ::grpc::internal::RpcServiceMethod( Interactive_method_names[1], ::grpc::internal::RpcMethod::SERVER_STREAMING, - new ::grpc::internal::ServerStreamingHandler< Interactive::Service, flatbuffers::grpc::Message, flatbuffers::grpc::Message>( + new ::grpc::internal::ServerStreamingHandler< Interactive::Service, flatbuffers::grpc::Message, flatbuffers::grpc::Message>( std::mem_fn(&Interactive::Service::execute), this))); } @@ -81,7 +81,7 @@ ::grpc::Status Interactive::Service::explain(::grpc::ServerContext* context, con return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } -::grpc::Status Interactive::Service::execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) { +::grpc::Status Interactive::Service::execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) { (void) context; (void) request; (void) writer; diff --git a/cpp/src/generated/ComputeIR.grpc.fb.h b/cpp/src/generated/ComputeIR.grpc.fb.h index 85f1fc1f6239b..c25039c212787 100644 --- a/cpp/src/generated/ComputeIR.grpc.fb.h +++ b/cpp/src/generated/ComputeIR.grpc.fb.h @@ -45,21 +45,21 @@ class Interactive final { std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>> PrepareAsyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>>(PrepareAsyncexplainRaw(context, request, cq)); } - std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { - return std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>>(executeRaw(context, request)); + std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { + return std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>>(executeRaw(context, request)); } - std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); } - std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); + std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); } private: virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>* AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>* PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) = 0; - virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) = 0; - virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) = 0; + virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) = 0; + virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; }; class Stub final : public StubInterface { public: @@ -71,23 +71,23 @@ class Interactive final { std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>> PrepareAsyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>>(PrepareAsyncexplainRaw(context, request, cq)); } - std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { - return std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>>(executeRaw(context, request)); + std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { + return std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>>(executeRaw(context, request)); } - std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); + std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); } - std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); + std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); } private: std::shared_ptr< ::grpc::ChannelInterface> channel_; ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientReader< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) override; - ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) override; - ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientReader< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) override; + ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) override; + ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; const ::grpc::internal::RpcMethod rpcmethod_explain_; const ::grpc::internal::RpcMethod rpcmethod_execute_; }; @@ -98,7 +98,7 @@ class Interactive final { Service(); virtual ~Service(); virtual ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response); - virtual ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer); + virtual ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer); }; template class WithAsyncMethod_explain : public BaseClass { @@ -132,11 +132,11 @@ class Interactive final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { + ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - void Requestexecute(::grpc::ServerContext* context, flatbuffers::grpc::Message* request, ::grpc::ServerAsyncWriter< flatbuffers::grpc::Message>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + void Requestexecute(::grpc::ServerContext* context, flatbuffers::grpc::Message* request, ::grpc::ServerAsyncWriter< flatbuffers::grpc::Message>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); } }; @@ -170,7 +170,7 @@ class Interactive final { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { + ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } @@ -203,18 +203,18 @@ class Interactive final { public: WithSplitStreamingMethod_execute() { ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::SplitServerStreamingHandler< flatbuffers::grpc::Message, flatbuffers::grpc::Message>(std::bind(&WithSplitStreamingMethod_execute::Streamedexecute, this, std::placeholders::_1, std::placeholders::_2))); + new ::grpc::internal::SplitServerStreamingHandler< flatbuffers::grpc::Message, flatbuffers::grpc::Message>(std::bind(&WithSplitStreamingMethod_execute::Streamedexecute, this, std::placeholders::_1, std::placeholders::_2))); } ~WithSplitStreamingMethod_execute() override { BaseClassMustBeDerivedFromService(this); } // disable regular version of this method - ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { + ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } // replace default version of method with split streamed - virtual ::grpc::Status Streamedexecute(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< flatbuffers::grpc::Message,flatbuffers::grpc::Message>* server_split_streamer) = 0; + virtual ::grpc::Status Streamedexecute(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< flatbuffers::grpc::Message,flatbuffers::grpc::Message>* server_split_streamer) = 0; }; typedef WithSplitStreamingMethod_execute< Service > SplitStreamedService; typedef WithStreamedUnaryMethod_explain< WithSplitStreamingMethod_execute< Service > > StreamedService; diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index 557b1a9f6409d..b08c03748b071 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -6,10 +6,7 @@ #include "flatbuffers/flatbuffers.h" -#include "Message_generated.h" #include "Schema_generated.h" -#include "SparseTensor_generated.h" -#include "Tensor_generated.h" namespace org { namespace apache { @@ -17,6 +14,9 @@ namespace arrow { namespace flatbuf { namespace computeir { +struct InlineBuffer; +struct InlineBufferBuilder; + struct Expression; struct ExpressionBuilder; @@ -217,6 +217,61 @@ inline const char *EnumNameOrdering(Ordering e) { return EnumNamesOrdering()[index]; } +/// Avoid use of org.apache.arrow.Buffer because it requires a +/// sidecar block of bytes. +struct InlineBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef InlineBufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BYTES = 4 + }; + const flatbuffers::Vector *bytes() const { + return GetPointer *>(VT_BYTES); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BYTES) && + verifier.VerifyVector(bytes()) && + verifier.EndTable(); + } +}; + +struct InlineBufferBuilder { + typedef InlineBuffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_bytes(flatbuffers::Offset> bytes) { + fbb_.AddOffset(InlineBuffer::VT_BYTES, bytes); + } + explicit InlineBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + InlineBufferBuilder &operator=(const InlineBufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, InlineBuffer::VT_BYTES); + return o; + } +}; + +inline flatbuffers::Offset CreateInlineBuffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> bytes = 0) { + InlineBufferBuilder builder_(_fbb); + builder_.add_bytes(bytes); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInlineBufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *bytes = nullptr) { + auto bytes__ = bytes ? _fbb.CreateVector(*bytes) : 0; + return org::apache::arrow::flatbuf::computeir::CreateInlineBuffer( + _fbb, + bytes__); +} + struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ExpressionBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -373,12 +428,17 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_SHAPE = 6, VT_TYPE_TYPE = 8, VT_TYPE = 10, - VT_BUFFERS = 12 + VT_BUFFERS = 12, + VT_DICTIONARY = 14 }; org::apache::arrow::flatbuf::computeir::Shape shape_type() const { return static_cast(GetField(VT_SHAPE_TYPE, 0)); } /// Shape of this literal. + /// + /// Note that this is orthogonal to type and refers to the number + /// of rows spanned by this Literal - a Literal may be Scalar shaped + /// with multiple "columns" if `type` happens to be Struct. const void *shape() const { return GetPointer(VT_SHAPE); } @@ -460,12 +520,16 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const org::apache::arrow::flatbuf::LargeList *type_as_LargeList() const { return type_type() == org::apache::arrow::flatbuf::Type::LargeList ? static_cast(type()) : nullptr; } - /// Buffers containing `length` elements of arrow-formatted data. - /// If `length` is absent (this Literal is scalar), these buffers - /// are sized to accommodate a single element of arrow-formatted data. + /// Buffers containing N elements of arrow-formatted data, where N + /// is Array.length if shape is Array or 1 if shape is Scalar. /// XXX this can be optimized for trivial scalars later - const flatbuffers::Vector *buffers() const { - return GetPointer *>(VT_BUFFERS); + const flatbuffers::Vector> *buffers() const { + return GetPointer> *>(VT_BUFFERS); + } + /// If (and only if) this Literal has dictionary type, this field dictionary + /// into which the literal's indices refer. + const org::apache::arrow::flatbuf::computeir::Literal *dictionary() const { + return GetPointer(VT_DICTIONARY); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -477,6 +541,9 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyType(verifier, type(), type_type()) && VerifyOffset(verifier, VT_BUFFERS) && verifier.VerifyVector(buffers()) && + verifier.VerifyVectorOfTables(buffers()) && + VerifyOffset(verifier, VT_DICTIONARY) && + verifier.VerifyTable(dictionary()) && verifier.EndTable(); } }; @@ -589,9 +656,12 @@ struct LiteralBuilder { void add_type(flatbuffers::Offset type) { fbb_.AddOffset(Literal::VT_TYPE, type); } - void add_buffers(flatbuffers::Offset> buffers) { + void add_buffers(flatbuffers::Offset>> buffers) { fbb_.AddOffset(Literal::VT_BUFFERS, buffers); } + void add_dictionary(flatbuffers::Offset dictionary) { + fbb_.AddOffset(Literal::VT_DICTIONARY, dictionary); + } explicit LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -612,8 +682,10 @@ inline flatbuffers::Offset CreateLiteral( flatbuffers::Offset shape = 0, org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, flatbuffers::Offset type = 0, - flatbuffers::Offset> buffers = 0) { + flatbuffers::Offset>> buffers = 0, + flatbuffers::Offset dictionary = 0) { LiteralBuilder builder_(_fbb); + builder_.add_dictionary(dictionary); builder_.add_buffers(buffers); builder_.add_type(type); builder_.add_shape(shape); @@ -628,15 +700,17 @@ inline flatbuffers::Offset CreateLiteralDirect( flatbuffers::Offset shape = 0, org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, flatbuffers::Offset type = 0, - const std::vector *buffers = nullptr) { - auto buffers__ = buffers ? _fbb.CreateVectorOfStructs(*buffers) : 0; + const std::vector> *buffers = nullptr, + flatbuffers::Offset dictionary = 0) { + auto buffers__ = buffers ? _fbb.CreateVector>(*buffers) : 0; return org::apache::arrow::flatbuf::computeir::CreateLiteral( _fbb, shape_type, shape, type_type, type, - buffers__); + buffers__, + dictionary); } struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { @@ -901,8 +975,8 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } /// Parameters for `function_name`; content/format may be unique to each /// value of `function_name`. - const org::apache::arrow::flatbuf::Buffer *options() const { - return GetStruct(VT_OPTIONS); + const org::apache::arrow::flatbuf::computeir::InlineBuffer *options() const { + return GetPointer(VT_OPTIONS); } /// The arguments passed to `function_name`. const flatbuffers::Vector> *arguments() const { @@ -983,7 +1057,8 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_FUNCTION_NAME) && verifier.VerifyString(function_name()) && - VerifyField(verifier, VT_OPTIONS) && + VerifyOffset(verifier, VT_OPTIONS) && + verifier.VerifyTable(options()) && VerifyOffsetRequired(verifier, VT_ARGUMENTS) && verifier.VerifyVector(arguments()) && verifier.VerifyVectorOfTables(arguments()) && @@ -1085,8 +1160,8 @@ struct CallBuilder { void add_function_name(flatbuffers::Offset function_name) { fbb_.AddOffset(Call::VT_FUNCTION_NAME, function_name); } - void add_options(const org::apache::arrow::flatbuf::Buffer *options) { - fbb_.AddStruct(Call::VT_OPTIONS, options); + void add_options(flatbuffers::Offset options) { + fbb_.AddOffset(Call::VT_OPTIONS, options); } void add_arguments(flatbuffers::Offset>> arguments) { fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); @@ -1114,7 +1189,7 @@ struct CallBuilder { inline flatbuffers::Offset CreateCall( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset function_name = 0, - const org::apache::arrow::flatbuf::Buffer *options = 0, + flatbuffers::Offset options = 0, flatbuffers::Offset>> arguments = 0, org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, flatbuffers::Offset type = 0) { @@ -1130,7 +1205,7 @@ inline flatbuffers::Offset CreateCall( inline flatbuffers::Offset CreateCallDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *function_name = nullptr, - const org::apache::arrow::flatbuf::Buffer *options = 0, + flatbuffers::Offset options = 0, const std::vector> *arguments = nullptr, org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, flatbuffers::Offset type = 0) { @@ -1174,8 +1249,8 @@ struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } /// Parameters for `relation_name`; content/format may be unique to each /// value of `relation_name`. - const org::apache::arrow::flatbuf::Buffer *options() const { - return GetStruct(VT_OPTIONS); + const org::apache::arrow::flatbuf::computeir::InlineBuffer *options() const { + return GetPointer(VT_OPTIONS); } /// The arguments passed to `relation_name`. const flatbuffers::Vector> *arguments() const { @@ -1189,7 +1264,8 @@ struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_RELATION_NAME) && verifier.VerifyString(relation_name()) && - VerifyField(verifier, VT_OPTIONS) && + VerifyOffset(verifier, VT_OPTIONS) && + verifier.VerifyTable(options()) && VerifyOffsetRequired(verifier, VT_ARGUMENTS) && verifier.VerifyVector(arguments()) && verifier.VerifyVectorOfTables(arguments()) && @@ -1206,8 +1282,8 @@ struct RelationBuilder { void add_relation_name(flatbuffers::Offset relation_name) { fbb_.AddOffset(Relation::VT_RELATION_NAME, relation_name); } - void add_options(const org::apache::arrow::flatbuf::Buffer *options) { - fbb_.AddStruct(Relation::VT_OPTIONS, options); + void add_options(flatbuffers::Offset options) { + fbb_.AddOffset(Relation::VT_OPTIONS, options); } void add_arguments(flatbuffers::Offset>> arguments) { fbb_.AddOffset(Relation::VT_ARGUMENTS, arguments); @@ -1232,7 +1308,7 @@ struct RelationBuilder { inline flatbuffers::Offset CreateRelation( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset relation_name = 0, - const org::apache::arrow::flatbuf::Buffer *options = 0, + flatbuffers::Offset options = 0, flatbuffers::Offset>> arguments = 0, flatbuffers::Offset schema = 0) { RelationBuilder builder_(_fbb); @@ -1246,7 +1322,7 @@ inline flatbuffers::Offset CreateRelation( inline flatbuffers::Offset CreateRelationDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *relation_name = nullptr, - const org::apache::arrow::flatbuf::Buffer *options = 0, + flatbuffers::Offset options = 0, const std::vector> *arguments = nullptr, flatbuffers::Offset schema = 0) { auto relation_name__ = relation_name ? _fbb.CreateString(relation_name) : 0; @@ -1771,17 +1847,17 @@ inline flatbuffers::Offset CreateUnionOptions( struct LiteralOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef LiteralOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BATCHES = 4 + VT_COLUMNS = 4 }; - /// Batches of rows in this literal. - const flatbuffers::Vector> *batches() const { - return GetPointer> *>(VT_BATCHES); + /// The columns of this literal relation. + const flatbuffers::Vector> *columns() const { + return GetPointer> *>(VT_COLUMNS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BATCHES) && - verifier.VerifyVector(batches()) && - verifier.VerifyVectorOfTables(batches()) && + VerifyOffsetRequired(verifier, VT_COLUMNS) && + verifier.VerifyVector(columns()) && + verifier.VerifyVectorOfTables(columns()) && verifier.EndTable(); } }; @@ -1790,8 +1866,8 @@ struct LiteralOptionsBuilder { typedef LiteralOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_batches(flatbuffers::Offset>> batches) { - fbb_.AddOffset(LiteralOptions::VT_BATCHES, batches); + void add_columns(flatbuffers::Offset>> columns) { + fbb_.AddOffset(LiteralOptions::VT_COLUMNS, columns); } explicit LiteralOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { @@ -1801,26 +1877,26 @@ struct LiteralOptionsBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, LiteralOptions::VT_BATCHES); + fbb_.Required(o, LiteralOptions::VT_COLUMNS); return o; } }; inline flatbuffers::Offset CreateLiteralOptions( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> batches = 0) { + flatbuffers::Offset>> columns = 0) { LiteralOptionsBuilder builder_(_fbb); - builder_.add_batches(batches); + builder_.add_columns(columns); return builder_.Finish(); } inline flatbuffers::Offset CreateLiteralOptionsDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *batches = nullptr) { - auto batches__ = batches ? _fbb.CreateVector>(*batches) : 0; + const std::vector> *columns = nullptr) { + auto columns__ = columns ? _fbb.CreateVector>(*columns) : 0; return org::apache::arrow::flatbuf::computeir::CreateLiteralOptions( _fbb, - batches__); + columns__); } /// A specification of a query. @@ -1828,17 +1904,12 @@ struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef PlanBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SINKS = 4, - VT_DICTIONARY_BATCH = 6, - VT_DERIVED_FROM = 8 + VT_DERIVED_FROM = 6 }; /// One or more output relations. const flatbuffers::Vector> *sinks() const { return GetPointer> *>(VT_SINKS); } - /// Dictionary batches which may be referenced by Literals. - const flatbuffers::Vector> *dictionary_batch() const { - return GetPointer> *>(VT_DICTIONARY_BATCH); - } /// If this Plan was derived from another (for example by running /// an optimization pass), that plan may be included here to /// provide a backtrace of derivations. @@ -1850,9 +1921,6 @@ struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyOffsetRequired(verifier, VT_SINKS) && verifier.VerifyVector(sinks()) && verifier.VerifyVectorOfTables(sinks()) && - VerifyOffset(verifier, VT_DICTIONARY_BATCH) && - verifier.VerifyVector(dictionary_batch()) && - verifier.VerifyVectorOfTables(dictionary_batch()) && VerifyOffset(verifier, VT_DERIVED_FROM) && verifier.VerifyTable(derived_from()) && verifier.EndTable(); @@ -1866,9 +1934,6 @@ struct PlanBuilder { void add_sinks(flatbuffers::Offset>> sinks) { fbb_.AddOffset(Plan::VT_SINKS, sinks); } - void add_dictionary_batch(flatbuffers::Offset>> dictionary_batch) { - fbb_.AddOffset(Plan::VT_DICTIONARY_BATCH, dictionary_batch); - } void add_derived_from(flatbuffers::Offset derived_from) { fbb_.AddOffset(Plan::VT_DERIVED_FROM, derived_from); } @@ -1888,11 +1953,9 @@ struct PlanBuilder { inline flatbuffers::Offset CreatePlan( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset>> sinks = 0, - flatbuffers::Offset>> dictionary_batch = 0, flatbuffers::Offset derived_from = 0) { PlanBuilder builder_(_fbb); builder_.add_derived_from(derived_from); - builder_.add_dictionary_batch(dictionary_batch); builder_.add_sinks(sinks); return builder_.Finish(); } @@ -1900,14 +1963,11 @@ inline flatbuffers::Offset CreatePlan( inline flatbuffers::Offset CreatePlanDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector> *sinks = nullptr, - const std::vector> *dictionary_batch = nullptr, flatbuffers::Offset derived_from = 0) { auto sinks__ = sinks ? _fbb.CreateVector>(*sinks) : 0; - auto dictionary_batch__ = dictionary_batch ? _fbb.CreateVector>(*dictionary_batch) : 0; return org::apache::arrow::flatbuf::computeir::CreatePlan( _fbb, sinks__, - dictionary_batch__, derived_from); } diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 25b17e53116f9..649400803ea79 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -16,10 +16,17 @@ // under the License. include "Schema.fbs"; -include "Message.fbs"; namespace org.apache.arrow.flatbuf.computeir; +/// Avoid use of org.apache.arrow.Buffer because it requires a +/// sidecar block of bytes. +table InlineBuffer { + // ulong is used to guarantee alignment and padding of `bytes` so that flatbuffers + // and other alignment sensitive blobs can be stored here + bytes: [ulong] (required); +} + /// An expression is one of /// - a Literal datum /// - a reference to a Field from a Relation @@ -46,16 +53,23 @@ table Array { table Literal { /// Shape of this literal. + /// + /// Note that this is orthogonal to type and refers to the number + /// of rows spanned by this Literal - a Literal may be Scalar shaped + /// with multiple "columns" if `type` happens to be Struct. shape: Shape (required); /// The type of this literal. type: Type (required); - /// Buffers containing `length` elements of arrow-formatted data. - /// If `length` is absent (this Literal is scalar), these buffers - /// are sized to accommodate a single element of arrow-formatted data. + /// Buffers containing N elements of arrow-formatted data, where N + /// is Array.length if shape is Array or 1 if shape is Scalar. /// XXX this can be optimized for trivial scalars later - buffers: [Buffer]; + buffers: [InlineBuffer]; + + /// If (and only if) this Literal has dictionary type, this field dictionary + /// into which the literal's indices refer. + dictionary: Literal; } table FieldRef { @@ -81,7 +95,7 @@ table Call { /// Parameters for `function_name`; content/format may be unique to each /// value of `function_name`. - options: Buffer; + options: InlineBuffer; /// The arguments passed to `function_name`. arguments: [Expression] (required); @@ -111,7 +125,7 @@ table Relation { /// Parameters for `relation_name`; content/format may be unique to each /// value of `relation_name`. - options: Buffer; + options: InlineBuffer; /// The arguments passed to `relation_name`. arguments: [Relation] (required); @@ -213,8 +227,8 @@ table UnionOptions { /// The contents of Relation.options will be LiteralOptions /// if Relation.relation_name = "literal" table LiteralOptions { - /// Batches of rows in this literal. - batches: [RecordBatch] (required); + /// The columns of this literal relation. + columns: [Literal] (required); } /// A specification of a query. @@ -222,9 +236,6 @@ table Plan { /// One or more output relations. sinks: [Relation] (required); - /// Dictionary batches which may be referenced by Literals. - dictionary_batch: [DictionaryBatch]; - /// If this Plan was derived from another (for example by running /// an optimization pass), that plan may be included here to /// provide a backtrace of derivations. @@ -246,7 +257,7 @@ rpc_service Interactive { /// The Plan may contain a single Relation with /// relation_name="interactive_output", in which case data which /// is received by that sink will be streamed back to the client. - execute(Plan): Message (streaming: "server"); + execute(Plan): Literal (streaming: "server"); } root_type Plan; From 6de1e8a7878f16fa6f1e25be239bb9661d849776 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Tue, 17 Aug 2021 12:37:26 -0400 Subject: [PATCH 22/96] Use Field instead of Type to accommodate nested types --- cpp/build-support/lint_exclusions.txt | 1 + cpp/src/generated/ComputeIR_generated.h | 562 ++---------------------- format/ComputeIR.fbs | 16 +- 3 files changed, 54 insertions(+), 525 deletions(-) diff --git a/cpp/build-support/lint_exclusions.txt b/cpp/build-support/lint_exclusions.txt index 01642a58008ca..785d07aa9d539 100644 --- a/cpp/build-support/lint_exclusions.txt +++ b/cpp/build-support/lint_exclusions.txt @@ -1,4 +1,5 @@ *_generated* +*.grpc.fb.* *parquet_constants.* *parquet_types.* *windows_compatibility.h diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index b08c03748b071..db92a7cb21454 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -426,10 +426,9 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SHAPE_TYPE = 4, VT_SHAPE = 6, - VT_TYPE_TYPE = 8, - VT_TYPE = 10, - VT_BUFFERS = 12, - VT_DICTIONARY = 14 + VT_FIELD = 8, + VT_BUFFERS = 10, + VT_DICTIONARY = 12 }; org::apache::arrow::flatbuf::computeir::Shape shape_type() const { return static_cast(GetField(VT_SHAPE_TYPE, 0)); @@ -438,7 +437,7 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { /// /// Note that this is orthogonal to type and refers to the number /// of rows spanned by this Literal - a Literal may be Scalar shaped - /// with multiple "columns" if `type` happens to be Struct. + /// with multiple "columns" if the type happens to be Struct. const void *shape() const { return GetPointer(VT_SHAPE); } @@ -449,76 +448,10 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const org::apache::arrow::flatbuf::computeir::Scalar *shape_as_Scalar() const { return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::Scalar ? static_cast(shape()) : nullptr; } - org::apache::arrow::flatbuf::Type type_type() const { - return static_cast(GetField(VT_TYPE_TYPE, 0)); - } - /// The type of this literal. - const void *type() const { - return GetPointer(VT_TYPE); - } - template const T *type_as() const; - const org::apache::arrow::flatbuf::Null *type_as_Null() const { - return type_type() == org::apache::arrow::flatbuf::Type::Null ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Int *type_as_Int() const { - return type_type() == org::apache::arrow::flatbuf::Type::Int ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FloatingPoint *type_as_FloatingPoint() const { - return type_type() == org::apache::arrow::flatbuf::Type::FloatingPoint ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Binary *type_as_Binary() const { - return type_type() == org::apache::arrow::flatbuf::Type::Binary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Utf8 *type_as_Utf8() const { - return type_type() == org::apache::arrow::flatbuf::Type::Utf8 ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Bool *type_as_Bool() const { - return type_type() == org::apache::arrow::flatbuf::Type::Bool ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Decimal *type_as_Decimal() const { - return type_type() == org::apache::arrow::flatbuf::Type::Decimal ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Date *type_as_Date() const { - return type_type() == org::apache::arrow::flatbuf::Type::Date ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Time *type_as_Time() const { - return type_type() == org::apache::arrow::flatbuf::Type::Time ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Timestamp *type_as_Timestamp() const { - return type_type() == org::apache::arrow::flatbuf::Type::Timestamp ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Interval *type_as_Interval() const { - return type_type() == org::apache::arrow::flatbuf::Type::Interval ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::List *type_as_List() const { - return type_type() == org::apache::arrow::flatbuf::Type::List ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Struct_ *type_as_Struct_() const { - return type_type() == org::apache::arrow::flatbuf::Type::Struct_ ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Union *type_as_Union() const { - return type_type() == org::apache::arrow::flatbuf::Type::Union ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FixedSizeBinary *type_as_FixedSizeBinary() const { - return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeBinary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FixedSizeList *type_as_FixedSizeList() const { - return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeList ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Map *type_as_Map() const { - return type_type() == org::apache::arrow::flatbuf::Type::Map ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Duration *type_as_Duration() const { - return type_type() == org::apache::arrow::flatbuf::Type::Duration ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeBinary *type_as_LargeBinary() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeBinary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeUtf8 *type_as_LargeUtf8() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeUtf8 ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeList *type_as_LargeList() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeList ? static_cast(type()) : nullptr; + /// The type of this literal. Field is used instead of Type to pick + /// up child fields, dictionary encoding, etc. + const org::apache::arrow::flatbuf::Field *field() const { + return GetPointer(VT_FIELD); } /// Buffers containing N elements of arrow-formatted data, where N /// is Array.length if shape is Array or 1 if shape is Scalar. @@ -536,9 +469,8 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyField(verifier, VT_SHAPE_TYPE) && VerifyOffsetRequired(verifier, VT_SHAPE) && VerifyShape(verifier, shape(), shape_type()) && - VerifyField(verifier, VT_TYPE_TYPE) && - VerifyOffsetRequired(verifier, VT_TYPE) && - VerifyType(verifier, type(), type_type()) && + VerifyOffsetRequired(verifier, VT_FIELD) && + verifier.VerifyTable(field()) && VerifyOffset(verifier, VT_BUFFERS) && verifier.VerifyVector(buffers()) && verifier.VerifyVectorOfTables(buffers()) && @@ -556,90 +488,6 @@ template<> inline const org::apache::arrow::flatbuf::computeir::Scalar *Literal: return shape_as_Scalar(); } -template<> inline const org::apache::arrow::flatbuf::Null *Literal::type_as() const { - return type_as_Null(); -} - -template<> inline const org::apache::arrow::flatbuf::Int *Literal::type_as() const { - return type_as_Int(); -} - -template<> inline const org::apache::arrow::flatbuf::FloatingPoint *Literal::type_as() const { - return type_as_FloatingPoint(); -} - -template<> inline const org::apache::arrow::flatbuf::Binary *Literal::type_as() const { - return type_as_Binary(); -} - -template<> inline const org::apache::arrow::flatbuf::Utf8 *Literal::type_as() const { - return type_as_Utf8(); -} - -template<> inline const org::apache::arrow::flatbuf::Bool *Literal::type_as() const { - return type_as_Bool(); -} - -template<> inline const org::apache::arrow::flatbuf::Decimal *Literal::type_as() const { - return type_as_Decimal(); -} - -template<> inline const org::apache::arrow::flatbuf::Date *Literal::type_as() const { - return type_as_Date(); -} - -template<> inline const org::apache::arrow::flatbuf::Time *Literal::type_as() const { - return type_as_Time(); -} - -template<> inline const org::apache::arrow::flatbuf::Timestamp *Literal::type_as() const { - return type_as_Timestamp(); -} - -template<> inline const org::apache::arrow::flatbuf::Interval *Literal::type_as() const { - return type_as_Interval(); -} - -template<> inline const org::apache::arrow::flatbuf::List *Literal::type_as() const { - return type_as_List(); -} - -template<> inline const org::apache::arrow::flatbuf::Struct_ *Literal::type_as() const { - return type_as_Struct_(); -} - -template<> inline const org::apache::arrow::flatbuf::Union *Literal::type_as() const { - return type_as_Union(); -} - -template<> inline const org::apache::arrow::flatbuf::FixedSizeBinary *Literal::type_as() const { - return type_as_FixedSizeBinary(); -} - -template<> inline const org::apache::arrow::flatbuf::FixedSizeList *Literal::type_as() const { - return type_as_FixedSizeList(); -} - -template<> inline const org::apache::arrow::flatbuf::Map *Literal::type_as() const { - return type_as_Map(); -} - -template<> inline const org::apache::arrow::flatbuf::Duration *Literal::type_as() const { - return type_as_Duration(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeBinary *Literal::type_as() const { - return type_as_LargeBinary(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeUtf8 *Literal::type_as() const { - return type_as_LargeUtf8(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeList *Literal::type_as() const { - return type_as_LargeList(); -} - struct LiteralBuilder { typedef Literal Table; flatbuffers::FlatBufferBuilder &fbb_; @@ -650,11 +498,8 @@ struct LiteralBuilder { void add_shape(flatbuffers::Offset shape) { fbb_.AddOffset(Literal::VT_SHAPE, shape); } - void add_type_type(org::apache::arrow::flatbuf::Type type_type) { - fbb_.AddElement(Literal::VT_TYPE_TYPE, static_cast(type_type), 0); - } - void add_type(flatbuffers::Offset type) { - fbb_.AddOffset(Literal::VT_TYPE, type); + void add_field(flatbuffers::Offset field) { + fbb_.AddOffset(Literal::VT_FIELD, field); } void add_buffers(flatbuffers::Offset>> buffers) { fbb_.AddOffset(Literal::VT_BUFFERS, buffers); @@ -671,7 +516,7 @@ struct LiteralBuilder { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); fbb_.Required(o, Literal::VT_SHAPE); - fbb_.Required(o, Literal::VT_TYPE); + fbb_.Required(o, Literal::VT_FIELD); return o; } }; @@ -680,16 +525,14 @@ inline flatbuffers::Offset CreateLiteral( flatbuffers::FlatBufferBuilder &_fbb, org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, flatbuffers::Offset shape = 0, - org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, - flatbuffers::Offset type = 0, + flatbuffers::Offset field = 0, flatbuffers::Offset>> buffers = 0, flatbuffers::Offset dictionary = 0) { LiteralBuilder builder_(_fbb); builder_.add_dictionary(dictionary); builder_.add_buffers(buffers); - builder_.add_type(type); + builder_.add_field(field); builder_.add_shape(shape); - builder_.add_type_type(type_type); builder_.add_shape_type(shape_type); return builder_.Finish(); } @@ -698,8 +541,7 @@ inline flatbuffers::Offset CreateLiteralDirect( flatbuffers::FlatBufferBuilder &_fbb, org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, flatbuffers::Offset shape = 0, - org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, - flatbuffers::Offset type = 0, + flatbuffers::Offset field = 0, const std::vector> *buffers = nullptr, flatbuffers::Offset dictionary = 0) { auto buffers__ = buffers ? _fbb.CreateVector>(*buffers) : 0; @@ -707,8 +549,7 @@ inline flatbuffers::Offset CreateLiteralDirect( _fbb, shape_type, shape, - type_type, - type, + field, buffers__, dictionary); } @@ -718,8 +559,7 @@ struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_PATH = 4, VT_RELATION_INDEX = 6, - VT_TYPE_TYPE = 8, - VT_TYPE = 10 + VT_FIELD = 8 }; /// A sequence of field names to allow referencing potentially nested fields const flatbuffers::Vector> *path() const { @@ -732,76 +572,10 @@ struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { int32_t relation_index() const { return GetField(VT_RELATION_INDEX, 0); } - org::apache::arrow::flatbuf::Type type_type() const { - return static_cast(GetField(VT_TYPE_TYPE, 0)); - } - /// The type of data in the referenced Field. - const void *type() const { - return GetPointer(VT_TYPE); - } - template const T *type_as() const; - const org::apache::arrow::flatbuf::Null *type_as_Null() const { - return type_type() == org::apache::arrow::flatbuf::Type::Null ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Int *type_as_Int() const { - return type_type() == org::apache::arrow::flatbuf::Type::Int ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FloatingPoint *type_as_FloatingPoint() const { - return type_type() == org::apache::arrow::flatbuf::Type::FloatingPoint ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Binary *type_as_Binary() const { - return type_type() == org::apache::arrow::flatbuf::Type::Binary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Utf8 *type_as_Utf8() const { - return type_type() == org::apache::arrow::flatbuf::Type::Utf8 ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Bool *type_as_Bool() const { - return type_type() == org::apache::arrow::flatbuf::Type::Bool ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Decimal *type_as_Decimal() const { - return type_type() == org::apache::arrow::flatbuf::Type::Decimal ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Date *type_as_Date() const { - return type_type() == org::apache::arrow::flatbuf::Type::Date ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Time *type_as_Time() const { - return type_type() == org::apache::arrow::flatbuf::Type::Time ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Timestamp *type_as_Timestamp() const { - return type_type() == org::apache::arrow::flatbuf::Type::Timestamp ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Interval *type_as_Interval() const { - return type_type() == org::apache::arrow::flatbuf::Type::Interval ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::List *type_as_List() const { - return type_type() == org::apache::arrow::flatbuf::Type::List ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Struct_ *type_as_Struct_() const { - return type_type() == org::apache::arrow::flatbuf::Type::Struct_ ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Union *type_as_Union() const { - return type_type() == org::apache::arrow::flatbuf::Type::Union ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FixedSizeBinary *type_as_FixedSizeBinary() const { - return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeBinary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FixedSizeList *type_as_FixedSizeList() const { - return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeList ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Map *type_as_Map() const { - return type_type() == org::apache::arrow::flatbuf::Type::Map ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Duration *type_as_Duration() const { - return type_type() == org::apache::arrow::flatbuf::Type::Duration ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeBinary *type_as_LargeBinary() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeBinary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeUtf8 *type_as_LargeUtf8() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeUtf8 ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeList *type_as_LargeList() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeList ? static_cast(type()) : nullptr; + /// The type of the referenced Field. Field is used instead of Type to pick + /// up child fields, dictionary encoding, etc. + const org::apache::arrow::flatbuf::Field *field() const { + return GetPointer(VT_FIELD); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -809,97 +583,12 @@ struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { verifier.VerifyVector(path()) && verifier.VerifyVectorOfStrings(path()) && VerifyField(verifier, VT_RELATION_INDEX) && - VerifyField(verifier, VT_TYPE_TYPE) && - VerifyOffset(verifier, VT_TYPE) && - VerifyType(verifier, type(), type_type()) && + VerifyOffset(verifier, VT_FIELD) && + verifier.VerifyTable(field()) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::Null *FieldRef::type_as() const { - return type_as_Null(); -} - -template<> inline const org::apache::arrow::flatbuf::Int *FieldRef::type_as() const { - return type_as_Int(); -} - -template<> inline const org::apache::arrow::flatbuf::FloatingPoint *FieldRef::type_as() const { - return type_as_FloatingPoint(); -} - -template<> inline const org::apache::arrow::flatbuf::Binary *FieldRef::type_as() const { - return type_as_Binary(); -} - -template<> inline const org::apache::arrow::flatbuf::Utf8 *FieldRef::type_as() const { - return type_as_Utf8(); -} - -template<> inline const org::apache::arrow::flatbuf::Bool *FieldRef::type_as() const { - return type_as_Bool(); -} - -template<> inline const org::apache::arrow::flatbuf::Decimal *FieldRef::type_as() const { - return type_as_Decimal(); -} - -template<> inline const org::apache::arrow::flatbuf::Date *FieldRef::type_as() const { - return type_as_Date(); -} - -template<> inline const org::apache::arrow::flatbuf::Time *FieldRef::type_as() const { - return type_as_Time(); -} - -template<> inline const org::apache::arrow::flatbuf::Timestamp *FieldRef::type_as() const { - return type_as_Timestamp(); -} - -template<> inline const org::apache::arrow::flatbuf::Interval *FieldRef::type_as() const { - return type_as_Interval(); -} - -template<> inline const org::apache::arrow::flatbuf::List *FieldRef::type_as() const { - return type_as_List(); -} - -template<> inline const org::apache::arrow::flatbuf::Struct_ *FieldRef::type_as() const { - return type_as_Struct_(); -} - -template<> inline const org::apache::arrow::flatbuf::Union *FieldRef::type_as() const { - return type_as_Union(); -} - -template<> inline const org::apache::arrow::flatbuf::FixedSizeBinary *FieldRef::type_as() const { - return type_as_FixedSizeBinary(); -} - -template<> inline const org::apache::arrow::flatbuf::FixedSizeList *FieldRef::type_as() const { - return type_as_FixedSizeList(); -} - -template<> inline const org::apache::arrow::flatbuf::Map *FieldRef::type_as() const { - return type_as_Map(); -} - -template<> inline const org::apache::arrow::flatbuf::Duration *FieldRef::type_as() const { - return type_as_Duration(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeBinary *FieldRef::type_as() const { - return type_as_LargeBinary(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeUtf8 *FieldRef::type_as() const { - return type_as_LargeUtf8(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeList *FieldRef::type_as() const { - return type_as_LargeList(); -} - struct FieldRefBuilder { typedef FieldRef Table; flatbuffers::FlatBufferBuilder &fbb_; @@ -910,11 +599,8 @@ struct FieldRefBuilder { void add_relation_index(int32_t relation_index) { fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); } - void add_type_type(org::apache::arrow::flatbuf::Type type_type) { - fbb_.AddElement(FieldRef::VT_TYPE_TYPE, static_cast(type_type), 0); - } - void add_type(flatbuffers::Offset type) { - fbb_.AddOffset(FieldRef::VT_TYPE, type); + void add_field(flatbuffers::Offset field) { + fbb_.AddOffset(FieldRef::VT_FIELD, field); } explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { @@ -932,13 +618,11 @@ inline flatbuffers::Offset CreateFieldRef( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset>> path = 0, int32_t relation_index = 0, - org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, - flatbuffers::Offset type = 0) { + flatbuffers::Offset field = 0) { FieldRefBuilder builder_(_fbb); - builder_.add_type(type); + builder_.add_field(field); builder_.add_relation_index(relation_index); builder_.add_path(path); - builder_.add_type_type(type_type); return builder_.Finish(); } @@ -946,15 +630,13 @@ inline flatbuffers::Offset CreateFieldRefDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector> *path = nullptr, int32_t relation_index = 0, - org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, - flatbuffers::Offset type = 0) { + flatbuffers::Offset field = 0) { auto path__ = path ? _fbb.CreateVector>(*path) : 0; return org::apache::arrow::flatbuf::computeir::CreateFieldRef( _fbb, path__, relation_index, - type_type, - type); + field); } struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { @@ -963,8 +645,7 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_FUNCTION_NAME = 4, VT_OPTIONS = 6, VT_ARGUMENTS = 8, - VT_TYPE_TYPE = 10, - VT_TYPE = 12 + VT_FIELD = 10 }; /// The namespaced name of the function whose invocation this Call represents. /// For example: "arrow::add" or "gandiva::jit_3432". @@ -982,76 +663,11 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const flatbuffers::Vector> *arguments() const { return GetPointer> *>(VT_ARGUMENTS); } - org::apache::arrow::flatbuf::Type type_type() const { - return static_cast(GetField(VT_TYPE_TYPE, 0)); - } /// The type of data which invoking `function_name` will return. - const void *type() const { - return GetPointer(VT_TYPE); - } - template const T *type_as() const; - const org::apache::arrow::flatbuf::Null *type_as_Null() const { - return type_type() == org::apache::arrow::flatbuf::Type::Null ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Int *type_as_Int() const { - return type_type() == org::apache::arrow::flatbuf::Type::Int ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FloatingPoint *type_as_FloatingPoint() const { - return type_type() == org::apache::arrow::flatbuf::Type::FloatingPoint ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Binary *type_as_Binary() const { - return type_type() == org::apache::arrow::flatbuf::Type::Binary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Utf8 *type_as_Utf8() const { - return type_type() == org::apache::arrow::flatbuf::Type::Utf8 ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Bool *type_as_Bool() const { - return type_type() == org::apache::arrow::flatbuf::Type::Bool ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Decimal *type_as_Decimal() const { - return type_type() == org::apache::arrow::flatbuf::Type::Decimal ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Date *type_as_Date() const { - return type_type() == org::apache::arrow::flatbuf::Type::Date ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Time *type_as_Time() const { - return type_type() == org::apache::arrow::flatbuf::Type::Time ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Timestamp *type_as_Timestamp() const { - return type_type() == org::apache::arrow::flatbuf::Type::Timestamp ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Interval *type_as_Interval() const { - return type_type() == org::apache::arrow::flatbuf::Type::Interval ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::List *type_as_List() const { - return type_type() == org::apache::arrow::flatbuf::Type::List ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Struct_ *type_as_Struct_() const { - return type_type() == org::apache::arrow::flatbuf::Type::Struct_ ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Union *type_as_Union() const { - return type_type() == org::apache::arrow::flatbuf::Type::Union ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FixedSizeBinary *type_as_FixedSizeBinary() const { - return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeBinary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::FixedSizeList *type_as_FixedSizeList() const { - return type_type() == org::apache::arrow::flatbuf::Type::FixedSizeList ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Map *type_as_Map() const { - return type_type() == org::apache::arrow::flatbuf::Type::Map ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::Duration *type_as_Duration() const { - return type_type() == org::apache::arrow::flatbuf::Type::Duration ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeBinary *type_as_LargeBinary() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeBinary ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeUtf8 *type_as_LargeUtf8() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeUtf8 ? static_cast(type()) : nullptr; - } - const org::apache::arrow::flatbuf::LargeList *type_as_LargeList() const { - return type_type() == org::apache::arrow::flatbuf::Type::LargeList ? static_cast(type()) : nullptr; + /// Field is used instead of Type to pick up child fields, + /// dictionary encoding, etc. + const org::apache::arrow::flatbuf::Field *field() const { + return GetPointer(VT_FIELD); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -1062,97 +678,12 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyOffsetRequired(verifier, VT_ARGUMENTS) && verifier.VerifyVector(arguments()) && verifier.VerifyVectorOfTables(arguments()) && - VerifyField(verifier, VT_TYPE_TYPE) && - VerifyOffset(verifier, VT_TYPE) && - VerifyType(verifier, type(), type_type()) && + VerifyOffset(verifier, VT_FIELD) && + verifier.VerifyTable(field()) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::Null *Call::type_as() const { - return type_as_Null(); -} - -template<> inline const org::apache::arrow::flatbuf::Int *Call::type_as() const { - return type_as_Int(); -} - -template<> inline const org::apache::arrow::flatbuf::FloatingPoint *Call::type_as() const { - return type_as_FloatingPoint(); -} - -template<> inline const org::apache::arrow::flatbuf::Binary *Call::type_as() const { - return type_as_Binary(); -} - -template<> inline const org::apache::arrow::flatbuf::Utf8 *Call::type_as() const { - return type_as_Utf8(); -} - -template<> inline const org::apache::arrow::flatbuf::Bool *Call::type_as() const { - return type_as_Bool(); -} - -template<> inline const org::apache::arrow::flatbuf::Decimal *Call::type_as() const { - return type_as_Decimal(); -} - -template<> inline const org::apache::arrow::flatbuf::Date *Call::type_as() const { - return type_as_Date(); -} - -template<> inline const org::apache::arrow::flatbuf::Time *Call::type_as() const { - return type_as_Time(); -} - -template<> inline const org::apache::arrow::flatbuf::Timestamp *Call::type_as() const { - return type_as_Timestamp(); -} - -template<> inline const org::apache::arrow::flatbuf::Interval *Call::type_as() const { - return type_as_Interval(); -} - -template<> inline const org::apache::arrow::flatbuf::List *Call::type_as() const { - return type_as_List(); -} - -template<> inline const org::apache::arrow::flatbuf::Struct_ *Call::type_as() const { - return type_as_Struct_(); -} - -template<> inline const org::apache::arrow::flatbuf::Union *Call::type_as() const { - return type_as_Union(); -} - -template<> inline const org::apache::arrow::flatbuf::FixedSizeBinary *Call::type_as() const { - return type_as_FixedSizeBinary(); -} - -template<> inline const org::apache::arrow::flatbuf::FixedSizeList *Call::type_as() const { - return type_as_FixedSizeList(); -} - -template<> inline const org::apache::arrow::flatbuf::Map *Call::type_as() const { - return type_as_Map(); -} - -template<> inline const org::apache::arrow::flatbuf::Duration *Call::type_as() const { - return type_as_Duration(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeBinary *Call::type_as() const { - return type_as_LargeBinary(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeUtf8 *Call::type_as() const { - return type_as_LargeUtf8(); -} - -template<> inline const org::apache::arrow::flatbuf::LargeList *Call::type_as() const { - return type_as_LargeList(); -} - struct CallBuilder { typedef Call Table; flatbuffers::FlatBufferBuilder &fbb_; @@ -1166,11 +697,8 @@ struct CallBuilder { void add_arguments(flatbuffers::Offset>> arguments) { fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); } - void add_type_type(org::apache::arrow::flatbuf::Type type_type) { - fbb_.AddElement(Call::VT_TYPE_TYPE, static_cast(type_type), 0); - } - void add_type(flatbuffers::Offset type) { - fbb_.AddOffset(Call::VT_TYPE, type); + void add_field(flatbuffers::Offset field) { + fbb_.AddOffset(Call::VT_FIELD, field); } explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { @@ -1191,14 +719,12 @@ inline flatbuffers::Offset CreateCall( flatbuffers::Offset function_name = 0, flatbuffers::Offset options = 0, flatbuffers::Offset>> arguments = 0, - org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, - flatbuffers::Offset type = 0) { + flatbuffers::Offset field = 0) { CallBuilder builder_(_fbb); - builder_.add_type(type); + builder_.add_field(field); builder_.add_arguments(arguments); builder_.add_options(options); builder_.add_function_name(function_name); - builder_.add_type_type(type_type); return builder_.Finish(); } @@ -1207,8 +733,7 @@ inline flatbuffers::Offset CreateCallDirect( const char *function_name = nullptr, flatbuffers::Offset options = 0, const std::vector> *arguments = nullptr, - org::apache::arrow::flatbuf::Type type_type = org::apache::arrow::flatbuf::Type::NONE, - flatbuffers::Offset type = 0) { + flatbuffers::Offset field = 0) { auto function_name__ = function_name ? _fbb.CreateString(function_name) : 0; auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; return org::apache::arrow::flatbuf::computeir::CreateCall( @@ -1216,8 +741,7 @@ inline flatbuffers::Offset CreateCallDirect( function_name__, options, arguments__, - type_type, - type); + field); } /// A relation is a set of rows with consistent schema. diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 649400803ea79..249b1b8f5e351 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -56,11 +56,12 @@ table Literal { /// /// Note that this is orthogonal to type and refers to the number /// of rows spanned by this Literal - a Literal may be Scalar shaped - /// with multiple "columns" if `type` happens to be Struct. + /// with multiple "columns" if the type happens to be Struct. shape: Shape (required); - /// The type of this literal. - type: Type (required); + /// The type of this literal. Field is used instead of Type to pick + /// up child fields, dictionary encoding, etc. + field: Field (required); /// Buffers containing N elements of arrow-formatted data, where N /// is Array.length if shape is Array or 1 if shape is Scalar. @@ -82,8 +83,9 @@ table FieldRef { /// 0 refers to the left relation and 1 to the right relation. relation_index: int; - /// The type of data in the referenced Field. - type: Type; + /// The type of the referenced Field. Field is used instead of Type to pick + /// up child fields, dictionary encoding, etc. + field: Field; } table Call { @@ -101,7 +103,9 @@ table Call { arguments: [Expression] (required); /// The type of data which invoking `function_name` will return. - type: Type; + /// Field is used instead of Type to pick up child fields, + /// dictionary encoding, etc. + field: Field; } /// A relation is a set of rows with consistent schema. From 3ed5d5d8911c6504545139b8ba84ff6cc03b650f Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Tue, 17 Aug 2021 14:05:50 -0400 Subject: [PATCH 23/96] provide an explicit enum for canonical functions --- .../ComputeIR.ExampleExtensions_generated.h | 25 +- cpp/src/generated/ComputeIR_generated.h | 1021 +++++++++++++++-- format/ComputeIR.ExampleExtensions.fbs | 25 +- format/ComputeIR.fbs | 174 ++- 4 files changed, 1092 insertions(+), 153 deletions(-) diff --git a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h index 5e999feb100bb..a378f7a931e55 100644 --- a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h +++ b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h @@ -180,7 +180,10 @@ inline flatbuffers::Offset CreateUriDirect( } /// The contents of Relation.options will be Sql_FromOptions -/// if Relation.name = "sql::from" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "sql", +/// .name = "from", +/// } struct Sql_FromOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef Sql_FromOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -371,7 +374,10 @@ inline flatbuffers::Offset CreateFileFormatDirect( } /// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions -/// if Relation.name = "arrow::filesystem_dataset_scan" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "filesystem_dataset_scan", +/// } struct Arrow_FileSystemDatasetScanOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef Arrow_FileSystemDatasetScanOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -446,7 +452,10 @@ inline flatbuffers::Offset CreateArrow_FileS ///////////////////////////////////////////////////////////// /// The contents of Relation.options will be Sql_IntoOptions -/// if Relation.name = "sql::into" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "sql", +/// .name = "into", +/// } struct Sql_IntoOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef Sql_IntoOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -517,7 +526,10 @@ inline flatbuffers::Offset CreateSql_IntoOptionsDirect( } /// The contents of Relation.options will be Arrow_StreamOutOptions -/// if Relation.name = "arrow::stream_out" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "stream_out", +/// } struct Arrow_StreamOutOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef Arrow_StreamOutOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -564,7 +576,10 @@ inline flatbuffers::Offset CreateArrow_StreamOutOptions( } /// The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions -/// if Relation.name = "arrow::filesystem_dataset_write" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "filesystem_dataset_write", +/// } struct Arrow_FileSystemDatasetWriteOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef Arrow_FileSystemDatasetWriteOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index db92a7cb21454..d0977f8b71081 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -32,9 +32,21 @@ struct LiteralBuilder; struct FieldRef; struct FieldRefBuilder; +struct CanonicalFunction; +struct CanonicalFunctionBuilder; + +struct NonCanonicalFunction; +struct NonCanonicalFunctionBuilder; + struct Call; struct CallBuilder; +struct CanonicalOperation; +struct CanonicalOperationBuilder; + +struct NonCanonicalOperation; +struct NonCanonicalOperationBuilder; + struct Relation; struct RelationBuilder; @@ -47,6 +59,12 @@ struct ProjectOptionsBuilder; struct AggregateOptions; struct AggregateOptionsBuilder; +struct CanonicalJoinKind; +struct CanonicalJoinKindBuilder; + +struct NonCanonicalJoinKind; +struct NonCanonicalJoinKindBuilder; + struct JoinOptions; struct JoinOptionsBuilder; @@ -179,6 +197,358 @@ template<> struct ShapeTraits { bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape type); bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); +/// A canonical (probably SQL equivalent) function +enum class CanonicalFunctionId : uint32_t { + And = 0, + Not = 1, + Or = 2, + Add = 3, + Subtract = 4, + Multiply = 5, + Divide = 6, + Power = 7, + AbsoluteValue = 8, + Negate = 9, + Sign = 10, + Equal = 11, + NotEqual = 12, + Greater = 13, + GreaterOrEqual = 14, + Less = 15, + LessOrEqual = 16, + All = 17, + Any = 18, + Count = 19, + Mean = 20, + Min = 21, + Max = 22, + Mode = 23, + Product = 24, + Sum = 25, + Tdigest = 26, + Quantile = 27, + Variance = 28, + StandardDeviation = 29, + MIN = And, + MAX = StandardDeviation +}; + +inline const CanonicalFunctionId (&EnumValuesCanonicalFunctionId())[30] { + static const CanonicalFunctionId values[] = { + CanonicalFunctionId::And, + CanonicalFunctionId::Not, + CanonicalFunctionId::Or, + CanonicalFunctionId::Add, + CanonicalFunctionId::Subtract, + CanonicalFunctionId::Multiply, + CanonicalFunctionId::Divide, + CanonicalFunctionId::Power, + CanonicalFunctionId::AbsoluteValue, + CanonicalFunctionId::Negate, + CanonicalFunctionId::Sign, + CanonicalFunctionId::Equal, + CanonicalFunctionId::NotEqual, + CanonicalFunctionId::Greater, + CanonicalFunctionId::GreaterOrEqual, + CanonicalFunctionId::Less, + CanonicalFunctionId::LessOrEqual, + CanonicalFunctionId::All, + CanonicalFunctionId::Any, + CanonicalFunctionId::Count, + CanonicalFunctionId::Mean, + CanonicalFunctionId::Min, + CanonicalFunctionId::Max, + CanonicalFunctionId::Mode, + CanonicalFunctionId::Product, + CanonicalFunctionId::Sum, + CanonicalFunctionId::Tdigest, + CanonicalFunctionId::Quantile, + CanonicalFunctionId::Variance, + CanonicalFunctionId::StandardDeviation + }; + return values; +} + +inline const char * const *EnumNamesCanonicalFunctionId() { + static const char * const names[31] = { + "And", + "Not", + "Or", + "Add", + "Subtract", + "Multiply", + "Divide", + "Power", + "AbsoluteValue", + "Negate", + "Sign", + "Equal", + "NotEqual", + "Greater", + "GreaterOrEqual", + "Less", + "LessOrEqual", + "All", + "Any", + "Count", + "Mean", + "Min", + "Max", + "Mode", + "Product", + "Sum", + "Tdigest", + "Quantile", + "Variance", + "StandardDeviation", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalFunctionId(CanonicalFunctionId e) { + if (flatbuffers::IsOutRange(e, CanonicalFunctionId::And, CanonicalFunctionId::StandardDeviation)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalFunctionId()[index]; +} + +enum class Function : uint8_t { + NONE = 0, + CanonicalFunction = 1, + NonCanonicalFunction = 2, + MIN = NONE, + MAX = NonCanonicalFunction +}; + +inline const Function (&EnumValuesFunction())[3] { + static const Function values[] = { + Function::NONE, + Function::CanonicalFunction, + Function::NonCanonicalFunction + }; + return values; +} + +inline const char * const *EnumNamesFunction() { + static const char * const names[4] = { + "NONE", + "CanonicalFunction", + "NonCanonicalFunction", + nullptr + }; + return names; +} + +inline const char *EnumNameFunction(Function e) { + if (flatbuffers::IsOutRange(e, Function::NONE, Function::NonCanonicalFunction)) return ""; + const size_t index = static_cast(e); + return EnumNamesFunction()[index]; +} + +template struct FunctionTraits { + static const Function enum_value = Function::NONE; +}; + +template<> struct FunctionTraits { + static const Function enum_value = Function::CanonicalFunction; +}; + +template<> struct FunctionTraits { + static const Function enum_value = Function::NonCanonicalFunction; +}; + +bool VerifyFunction(flatbuffers::Verifier &verifier, const void *obj, Function type); +bool VerifyFunctionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class CanonicalOperationId : uint32_t { + Literal = 0, + Filter = 1, + Project = 2, + Aggregate = 3, + Join = 4, + OrderBy = 5, + Limit = 6, + Common = 7, + Union = 8, + InteractiveOutput = 9, + MIN = Literal, + MAX = InteractiveOutput +}; + +inline const CanonicalOperationId (&EnumValuesCanonicalOperationId())[10] { + static const CanonicalOperationId values[] = { + CanonicalOperationId::Literal, + CanonicalOperationId::Filter, + CanonicalOperationId::Project, + CanonicalOperationId::Aggregate, + CanonicalOperationId::Join, + CanonicalOperationId::OrderBy, + CanonicalOperationId::Limit, + CanonicalOperationId::Common, + CanonicalOperationId::Union, + CanonicalOperationId::InteractiveOutput + }; + return values; +} + +inline const char * const *EnumNamesCanonicalOperationId() { + static const char * const names[11] = { + "Literal", + "Filter", + "Project", + "Aggregate", + "Join", + "OrderBy", + "Limit", + "Common", + "Union", + "InteractiveOutput", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalOperationId(CanonicalOperationId e) { + if (flatbuffers::IsOutRange(e, CanonicalOperationId::Literal, CanonicalOperationId::InteractiveOutput)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalOperationId()[index]; +} + +enum class Operation : uint8_t { + NONE = 0, + CanonicalOperation = 1, + NonCanonicalFunction = 2, + MIN = NONE, + MAX = NonCanonicalFunction +}; + +inline const Operation (&EnumValuesOperation())[3] { + static const Operation values[] = { + Operation::NONE, + Operation::CanonicalOperation, + Operation::NonCanonicalFunction + }; + return values; +} + +inline const char * const *EnumNamesOperation() { + static const char * const names[4] = { + "NONE", + "CanonicalOperation", + "NonCanonicalFunction", + nullptr + }; + return names; +} + +inline const char *EnumNameOperation(Operation e) { + if (flatbuffers::IsOutRange(e, Operation::NONE, Operation::NonCanonicalFunction)) return ""; + const size_t index = static_cast(e); + return EnumNamesOperation()[index]; +} + +template struct OperationTraits { + static const Operation enum_value = Operation::NONE; +}; + +template<> struct OperationTraits { + static const Operation enum_value = Operation::CanonicalOperation; +}; + +template<> struct OperationTraits { + static const Operation enum_value = Operation::NonCanonicalFunction; +}; + +bool VerifyOperation(flatbuffers::Verifier &verifier, const void *obj, Operation type); +bool VerifyOperationVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class CanonicalJoinKindId : uint32_t { + Inner = 0, + LeftOuter = 1, + RightOuter = 2, + FullOuter = 3, + Cross = 4, + MIN = Inner, + MAX = Cross +}; + +inline const CanonicalJoinKindId (&EnumValuesCanonicalJoinKindId())[5] { + static const CanonicalJoinKindId values[] = { + CanonicalJoinKindId::Inner, + CanonicalJoinKindId::LeftOuter, + CanonicalJoinKindId::RightOuter, + CanonicalJoinKindId::FullOuter, + CanonicalJoinKindId::Cross + }; + return values; +} + +inline const char * const *EnumNamesCanonicalJoinKindId() { + static const char * const names[6] = { + "Inner", + "LeftOuter", + "RightOuter", + "FullOuter", + "Cross", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalJoinKindId(CanonicalJoinKindId e) { + if (flatbuffers::IsOutRange(e, CanonicalJoinKindId::Inner, CanonicalJoinKindId::Cross)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalJoinKindId()[index]; +} + +enum class JoinKind : uint8_t { + NONE = 0, + CanonicalJoinKind = 1, + NonCanonicalFunction = 2, + MIN = NONE, + MAX = NonCanonicalFunction +}; + +inline const JoinKind (&EnumValuesJoinKind())[3] { + static const JoinKind values[] = { + JoinKind::NONE, + JoinKind::CanonicalJoinKind, + JoinKind::NonCanonicalFunction + }; + return values; +} + +inline const char * const *EnumNamesJoinKind() { + static const char * const names[4] = { + "NONE", + "CanonicalJoinKind", + "NonCanonicalFunction", + nullptr + }; + return names; +} + +inline const char *EnumNameJoinKind(JoinKind e) { + if (flatbuffers::IsOutRange(e, JoinKind::NONE, JoinKind::NonCanonicalFunction)) return ""; + const size_t index = static_cast(e); + return EnumNamesJoinKind()[index]; +} + +template struct JoinKindTraits { + static const JoinKind enum_value = JoinKind::NONE; +}; + +template<> struct JoinKindTraits { + static const JoinKind enum_value = JoinKind::CanonicalJoinKind; +}; + +template<> struct JoinKindTraits { + static const JoinKind enum_value = JoinKind::NonCanonicalFunction; +}; + +bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type); +bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + /// Whether lesser values should precede greater or vice versa, /// also whether nulls should preced or follow values. enum class Ordering : uint8_t { @@ -639,20 +1009,138 @@ inline flatbuffers::Offset CreateFieldRefDirect( field); } +struct CanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalFunctionBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::flatbuf::computeir::CanonicalFunctionId id() const { + return static_cast(GetField(VT_ID, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && + verifier.EndTable(); + } +}; + +struct CanonicalFunctionBuilder { + typedef CanonicalFunction Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_id(org::apache::arrow::flatbuf::computeir::CanonicalFunctionId id) { + fbb_.AddElement(CanonicalFunction::VT_ID, static_cast(id), 0); + } + explicit CanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CanonicalFunctionBuilder &operator=(const CanonicalFunctionBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCanonicalFunction( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::CanonicalFunctionId id = org::apache::arrow::flatbuf::computeir::CanonicalFunctionId::And) { + CanonicalFunctionBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalFunctionBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalFunctionBuilder { + typedef NonCanonicalFunction Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalFunction::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalFunction::VT_NAME, name); + } + explicit NonCanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalFunctionBuilder &operator=(const NonCanonicalFunctionBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalFunction::VT_NAME_SPACE); + fbb_.Required(o, NonCanonicalFunction::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalFunction( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalFunctionBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateNonCanonicalFunctionDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::flatbuf::computeir::CreateNonCanonicalFunction( + _fbb, + name_space__, + name__); +} + struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CallBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_FUNCTION_NAME = 4, - VT_OPTIONS = 6, - VT_ARGUMENTS = 8, - VT_FIELD = 10 + VT_FUNCTION_TYPE = 4, + VT_FUNCTION = 6, + VT_OPTIONS = 8, + VT_ARGUMENTS = 10, + VT_FIELD = 12 }; - /// The namespaced name of the function whose invocation this Call represents. - /// For example: "arrow::add" or "gandiva::jit_3432". - /// - /// Names with no namespace are reserved for canonicalization. - const flatbuffers::String *function_name() const { - return GetPointer(VT_FUNCTION_NAME); + org::apache::arrow::flatbuf::computeir::Function function_type() const { + return static_cast(GetField(VT_FUNCTION_TYPE, 0)); + } + /// The function whose invocation this Call represents. + const void *function() const { + return GetPointer(VT_FUNCTION); + } + template const T *function_as() const; + const org::apache::arrow::flatbuf::computeir::CanonicalFunction *function_as_CanonicalFunction() const { + return function_type() == org::apache::arrow::flatbuf::computeir::Function::CanonicalFunction ? static_cast(function()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *function_as_NonCanonicalFunction() const { + return function_type() == org::apache::arrow::flatbuf::computeir::Function::NonCanonicalFunction ? static_cast(function()) : nullptr; } /// Parameters for `function_name`; content/format may be unique to each /// value of `function_name`. @@ -671,8 +1159,9 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_FUNCTION_NAME) && - verifier.VerifyString(function_name()) && + VerifyField(verifier, VT_FUNCTION_TYPE) && + VerifyOffsetRequired(verifier, VT_FUNCTION) && + VerifyFunction(verifier, function(), function_type()) && VerifyOffset(verifier, VT_OPTIONS) && verifier.VerifyTable(options()) && VerifyOffsetRequired(verifier, VT_ARGUMENTS) && @@ -684,12 +1173,23 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; +template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalFunction *Call::function_as() const { + return function_as_CanonicalFunction(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *Call::function_as() const { + return function_as_NonCanonicalFunction(); +} + struct CallBuilder { typedef Call Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_function_name(flatbuffers::Offset function_name) { - fbb_.AddOffset(Call::VT_FUNCTION_NAME, function_name); + void add_function_type(org::apache::arrow::flatbuf::computeir::Function function_type) { + fbb_.AddElement(Call::VT_FUNCTION_TYPE, static_cast(function_type), 0); + } + void add_function(flatbuffers::Offset function) { + fbb_.AddOffset(Call::VT_FUNCTION, function); } void add_options(flatbuffers::Offset options) { fbb_.AddOffset(Call::VT_OPTIONS, options); @@ -708,7 +1208,7 @@ struct CallBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, Call::VT_FUNCTION_NAME); + fbb_.Required(o, Call::VT_FUNCTION); fbb_.Required(o, Call::VT_ARGUMENTS); return o; } @@ -716,7 +1216,8 @@ struct CallBuilder { inline flatbuffers::Offset CreateCall( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset function_name = 0, + org::apache::arrow::flatbuf::computeir::Function function_type = org::apache::arrow::flatbuf::computeir::Function::NONE, + flatbuffers::Offset function = 0, flatbuffers::Offset options = 0, flatbuffers::Offset>> arguments = 0, flatbuffers::Offset field = 0) { @@ -724,59 +1225,168 @@ inline flatbuffers::Offset CreateCall( builder_.add_field(field); builder_.add_arguments(arguments); builder_.add_options(options); - builder_.add_function_name(function_name); + builder_.add_function(function); + builder_.add_function_type(function_type); return builder_.Finish(); } inline flatbuffers::Offset CreateCallDirect( flatbuffers::FlatBufferBuilder &_fbb, - const char *function_name = nullptr, + org::apache::arrow::flatbuf::computeir::Function function_type = org::apache::arrow::flatbuf::computeir::Function::NONE, + flatbuffers::Offset function = 0, flatbuffers::Offset options = 0, const std::vector> *arguments = nullptr, flatbuffers::Offset field = 0) { - auto function_name__ = function_name ? _fbb.CreateString(function_name) : 0; auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; return org::apache::arrow::flatbuf::computeir::CreateCall( _fbb, - function_name__, + function_type, + function, options, arguments__, field); } +struct CanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalOperationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::flatbuf::computeir::CanonicalOperationId id() const { + return static_cast(GetField(VT_ID, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && + verifier.EndTable(); + } +}; + +struct CanonicalOperationBuilder { + typedef CanonicalOperation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_id(org::apache::arrow::flatbuf::computeir::CanonicalOperationId id) { + fbb_.AddElement(CanonicalOperation::VT_ID, static_cast(id), 0); + } + explicit CanonicalOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CanonicalOperationBuilder &operator=(const CanonicalOperationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCanonicalOperation( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::CanonicalOperationId id = org::apache::arrow::flatbuf::computeir::CanonicalOperationId::Literal) { + CanonicalOperationBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalOperationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalOperationBuilder { + typedef NonCanonicalOperation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalOperation::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalOperation::VT_NAME, name); + } + explicit NonCanonicalOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalOperationBuilder &operator=(const NonCanonicalOperationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalOperation::VT_NAME_SPACE); + fbb_.Required(o, NonCanonicalOperation::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalOperation( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalOperationBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateNonCanonicalOperationDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::flatbuf::computeir::CreateNonCanonicalOperation( + _fbb, + name_space__, + name__); +} + /// A relation is a set of rows with consistent schema. struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef RelationBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_RELATION_NAME = 4, - VT_OPTIONS = 6, - VT_ARGUMENTS = 8, - VT_SCHEMA = 10 + VT_OPERATION_TYPE = 4, + VT_OPERATION = 6, + VT_OPTIONS = 8, + VT_ARGUMENTS = 10, + VT_SCHEMA = 12 }; - /// The namespaced name of this Relation. - /// For example: "arrow::hash_join" or "gandiva::filter_and_project". - /// - /// Names with no namespace are reserved for canonical, "pure" relational - /// algebraic operations, which currently include: - /// "filter" - /// "project" - /// "aggregate" - /// "join" - /// "order_by" - /// "limit" - /// "common" - /// "union" - /// "literal" - /// "interactive_output" - const flatbuffers::String *relation_name() const { - return GetPointer(VT_RELATION_NAME); - } - /// Parameters for `relation_name`; content/format may be unique to each - /// value of `relation_name`. + org::apache::arrow::flatbuf::computeir::Operation operation_type() const { + return static_cast(GetField(VT_OPERATION_TYPE, 0)); + } + /// The operation which this Relation wraps. + const void *operation() const { + return GetPointer(VT_OPERATION); + } + template const T *operation_as() const; + const org::apache::arrow::flatbuf::computeir::CanonicalOperation *operation_as_CanonicalOperation() const { + return operation_type() == org::apache::arrow::flatbuf::computeir::Operation::CanonicalOperation ? static_cast(operation()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *operation_as_NonCanonicalFunction() const { + return operation_type() == org::apache::arrow::flatbuf::computeir::Operation::NonCanonicalFunction ? static_cast(operation()) : nullptr; + } + /// Parameters for `operation`; content/format may be unique to each + /// value of `operation`. const org::apache::arrow::flatbuf::computeir::InlineBuffer *options() const { return GetPointer(VT_OPTIONS); } - /// The arguments passed to `relation_name`. + /// The arguments passed to `operation`. const flatbuffers::Vector> *arguments() const { return GetPointer> *>(VT_ARGUMENTS); } @@ -786,8 +1396,9 @@ struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_RELATION_NAME) && - verifier.VerifyString(relation_name()) && + VerifyField(verifier, VT_OPERATION_TYPE) && + VerifyOffsetRequired(verifier, VT_OPERATION) && + VerifyOperation(verifier, operation(), operation_type()) && VerifyOffset(verifier, VT_OPTIONS) && verifier.VerifyTable(options()) && VerifyOffsetRequired(verifier, VT_ARGUMENTS) && @@ -799,12 +1410,23 @@ struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; +template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalOperation *Relation::operation_as() const { + return operation_as_CanonicalOperation(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *Relation::operation_as() const { + return operation_as_NonCanonicalFunction(); +} + struct RelationBuilder { typedef Relation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_relation_name(flatbuffers::Offset relation_name) { - fbb_.AddOffset(Relation::VT_RELATION_NAME, relation_name); + void add_operation_type(org::apache::arrow::flatbuf::computeir::Operation operation_type) { + fbb_.AddElement(Relation::VT_OPERATION_TYPE, static_cast(operation_type), 0); + } + void add_operation(flatbuffers::Offset operation) { + fbb_.AddOffset(Relation::VT_OPERATION, operation); } void add_options(flatbuffers::Offset options) { fbb_.AddOffset(Relation::VT_OPTIONS, options); @@ -823,7 +1445,7 @@ struct RelationBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, Relation::VT_RELATION_NAME); + fbb_.Required(o, Relation::VT_OPERATION); fbb_.Required(o, Relation::VT_ARGUMENTS); return o; } @@ -831,7 +1453,8 @@ struct RelationBuilder { inline flatbuffers::Offset CreateRelation( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset relation_name = 0, + org::apache::arrow::flatbuf::computeir::Operation operation_type = org::apache::arrow::flatbuf::computeir::Operation::NONE, + flatbuffers::Offset operation = 0, flatbuffers::Offset options = 0, flatbuffers::Offset>> arguments = 0, flatbuffers::Offset schema = 0) { @@ -839,28 +1462,30 @@ inline flatbuffers::Offset CreateRelation( builder_.add_schema(schema); builder_.add_arguments(arguments); builder_.add_options(options); - builder_.add_relation_name(relation_name); + builder_.add_operation(operation); + builder_.add_operation_type(operation_type); return builder_.Finish(); } inline flatbuffers::Offset CreateRelationDirect( flatbuffers::FlatBufferBuilder &_fbb, - const char *relation_name = nullptr, + org::apache::arrow::flatbuf::computeir::Operation operation_type = org::apache::arrow::flatbuf::computeir::Operation::NONE, + flatbuffers::Offset operation = 0, flatbuffers::Offset options = 0, const std::vector> *arguments = nullptr, flatbuffers::Offset schema = 0) { - auto relation_name__ = relation_name ? _fbb.CreateString(relation_name) : 0; auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; return org::apache::arrow::flatbuf::computeir::CreateRelation( _fbb, - relation_name__, + operation_type, + operation, options, arguments__, schema); } /// The contents of Relation.options will be FilterOptions -/// if Relation.relation_name = "filter" +/// if Relation.operation = CanonicalOperation::Filter struct FilterOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef FilterOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -868,7 +1493,7 @@ struct FilterOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; /// The expression which will be evaluated against input rows /// to determine whether they should be excluded from the - /// "filter" relation's output. + /// filter relation's output. const org::apache::arrow::flatbuf::computeir::Expression *filter_expression() const { return GetPointer(VT_FILTER_EXPRESSION); } @@ -909,14 +1534,14 @@ inline flatbuffers::Offset CreateFilterOptions( } /// The contents of Relation.options will be ProjectOptions -/// if Relation.relation_name = "project" +/// if Relation.operation = CanonicalOperation::Project struct ProjectOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ProjectOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_EXPRESSIONS = 4 }; /// Expressions which will be evaluated to produce to - /// the rows of the "project" relation's output. + /// the rows of the project relation's output. const flatbuffers::Vector> *expressions() const { return GetPointer> *>(VT_EXPRESSIONS); } @@ -967,7 +1592,7 @@ inline flatbuffers::Offset CreateProjectOptionsDirect( } /// The contents of Relation.options will be AggregateOptions -/// if Relation.relation_name = "aggregate" +/// if Relation.operation = CanonicalOperation::Aggregate struct AggregateOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef AggregateOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -975,7 +1600,7 @@ struct AggregateOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_KEYS = 6 }; /// Expressions which will be evaluated to produce to - /// the rows of the "aggregate" relation's output. + /// the rows of the aggregate relation's output. const flatbuffers::Vector> *aggregations() const { return GetPointer> *>(VT_AGGREGATIONS); } @@ -1041,40 +1666,164 @@ inline flatbuffers::Offset CreateAggregateOptionsDirect( keys__); } +struct CanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalJoinKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId id() const { + return static_cast(GetField(VT_ID, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && + verifier.EndTable(); + } +}; + +struct CanonicalJoinKindBuilder { + typedef CanonicalJoinKind Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_id(org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId id) { + fbb_.AddElement(CanonicalJoinKind::VT_ID, static_cast(id), 0); + } + explicit CanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CanonicalJoinKindBuilder &operator=(const CanonicalJoinKindBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCanonicalJoinKind( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId id = org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId::Inner) { + CanonicalJoinKindBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalJoinKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalJoinKindBuilder { + typedef NonCanonicalJoinKind Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME, name); + } + explicit NonCanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalJoinKindBuilder &operator=(const NonCanonicalJoinKindBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalJoinKind::VT_NAME_SPACE); + fbb_.Required(o, NonCanonicalJoinKind::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalJoinKind( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalJoinKindBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateNonCanonicalJoinKindDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::flatbuf::computeir::CreateNonCanonicalJoinKind( + _fbb, + name_space__, + name__); +} + /// The contents of Relation.options will be JoinOptions -/// if Relation.relation_name = "join" +/// if Relation.operation = CanonicalOperation::Join struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef JoinOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ON_EXPRESSION = 4, - VT_JOIN_NAME = 6 + VT_JOIN_KIND_TYPE = 6, + VT_JOIN_KIND = 8 }; /// The expression which will be evaluated against rows from each /// input to determine whether they should be included in the - /// "join" relation's output. + /// join relation's output. const org::apache::arrow::flatbuf::computeir::Expression *on_expression() const { return GetPointer(VT_ON_EXPRESSION); } - /// The namespaced name of the join to use. Non-namespaced names are - /// reserved for canonicalization. Current names include: - /// "inner" - /// "left" - /// "right" - /// "outer" - /// "cross" - const flatbuffers::String *join_name() const { - return GetPointer(VT_JOIN_NAME); + org::apache::arrow::flatbuf::computeir::JoinKind join_kind_type() const { + return static_cast(GetField(VT_JOIN_KIND_TYPE, 0)); + } + /// The kind of join to use. + const void *join_kind() const { + return GetPointer(VT_JOIN_KIND); + } + template const T *join_kind_as() const; + const org::apache::arrow::flatbuf::computeir::CanonicalJoinKind *join_kind_as_CanonicalJoinKind() const { + return join_kind_type() == org::apache::arrow::flatbuf::computeir::JoinKind::CanonicalJoinKind ? static_cast(join_kind()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *join_kind_as_NonCanonicalFunction() const { + return join_kind_type() == org::apache::arrow::flatbuf::computeir::JoinKind::NonCanonicalFunction ? static_cast(join_kind()) : nullptr; } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && verifier.VerifyTable(on_expression()) && - VerifyOffset(verifier, VT_JOIN_NAME) && - verifier.VerifyString(join_name()) && + VerifyField(verifier, VT_JOIN_KIND_TYPE) && + VerifyOffsetRequired(verifier, VT_JOIN_KIND) && + VerifyJoinKind(verifier, join_kind(), join_kind_type()) && verifier.EndTable(); } }; +template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalJoinKind *JoinOptions::join_kind_as() const { + return join_kind_as_CanonicalJoinKind(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *JoinOptions::join_kind_as() const { + return join_kind_as_NonCanonicalFunction(); +} + struct JoinOptionsBuilder { typedef JoinOptions Table; flatbuffers::FlatBufferBuilder &fbb_; @@ -1082,8 +1831,11 @@ struct JoinOptionsBuilder { void add_on_expression(flatbuffers::Offset on_expression) { fbb_.AddOffset(JoinOptions::VT_ON_EXPRESSION, on_expression); } - void add_join_name(flatbuffers::Offset join_name) { - fbb_.AddOffset(JoinOptions::VT_JOIN_NAME, join_name); + void add_join_kind_type(org::apache::arrow::flatbuf::computeir::JoinKind join_kind_type) { + fbb_.AddElement(JoinOptions::VT_JOIN_KIND_TYPE, static_cast(join_kind_type), 0); + } + void add_join_kind(flatbuffers::Offset join_kind) { + fbb_.AddOffset(JoinOptions::VT_JOIN_KIND, join_kind); } explicit JoinOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { @@ -1094,6 +1846,7 @@ struct JoinOptionsBuilder { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); fbb_.Required(o, JoinOptions::VT_ON_EXPRESSION); + fbb_.Required(o, JoinOptions::VT_JOIN_KIND); return o; } }; @@ -1101,24 +1854,15 @@ struct JoinOptionsBuilder { inline flatbuffers::Offset CreateJoinOptions( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset on_expression = 0, - flatbuffers::Offset join_name = 0) { + org::apache::arrow::flatbuf::computeir::JoinKind join_kind_type = org::apache::arrow::flatbuf::computeir::JoinKind::NONE, + flatbuffers::Offset join_kind = 0) { JoinOptionsBuilder builder_(_fbb); - builder_.add_join_name(join_name); + builder_.add_join_kind(join_kind); builder_.add_on_expression(on_expression); + builder_.add_join_kind_type(join_kind_type); return builder_.Finish(); } -inline flatbuffers::Offset CreateJoinOptionsDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset on_expression = 0, - const char *join_name = nullptr) { - auto join_name__ = join_name ? _fbb.CreateString(join_name) : 0; - return org::apache::arrow::flatbuf::computeir::CreateJoinOptions( - _fbb, - on_expression, - join_name__); -} - struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef SortKeyBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -1174,7 +1918,7 @@ inline flatbuffers::Offset CreateSortKey( } /// The contents of Relation.options will be OrderByOptions -/// if Relation.relation_name = "order_by" +/// if Relation.operation = CanonicalOperation::OrderBy struct OrderByOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef OrderByOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -1232,7 +1976,7 @@ inline flatbuffers::Offset CreateOrderByOptionsDirect( } /// The contents of Relation.options will be LimitOptions -/// if Relation.relation_name = "limit" +/// if Relation.operation = CanonicalOperation::Limit struct LimitOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef LimitOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -1277,7 +2021,7 @@ inline flatbuffers::Offset CreateLimitOptions( } /// The contents of Relation.options will be CommonOptions -/// if Relation.relation_name = "common" +/// if Relation.operation = CanonicalOperation::Common struct CommonOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CommonOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -1335,7 +2079,7 @@ inline flatbuffers::Offset CreateCommonOptionsDirect( } /// The contents of Relation.options will be UnionOptions -/// if Relation.relation_name = "union" +/// if Relation.operation = CanonicalOperation::Union struct UnionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef UnionOptionsBuilder Builder; bool Verify(flatbuffers::Verifier &verifier) const { @@ -1367,7 +2111,7 @@ inline flatbuffers::Offset CreateUnionOptions( } /// The contents of Relation.options will be LiteralOptions -/// if Relation.relation_name = "literal" +/// if Relation.operation = CanonicalOperation::Literal struct LiteralOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef LiteralOptionsBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -1557,6 +2301,93 @@ inline bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers return true; } +inline bool VerifyFunction(flatbuffers::Verifier &verifier, const void *obj, Function type) { + switch (type) { + case Function::NONE: { + return true; + } + case Function::CanonicalFunction: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Function::NonCanonicalFunction: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyFunctionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyFunction( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyOperation(flatbuffers::Verifier &verifier, const void *obj, Operation type) { + switch (type) { + case Operation::NONE: { + return true; + } + case Operation::CanonicalOperation: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Operation::NonCanonicalFunction: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyOperationVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyOperation( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type) { + switch (type) { + case JoinKind::NONE: { + return true; + } + case JoinKind::CanonicalJoinKind: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case JoinKind::NonCanonicalFunction: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyJoinKind( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + inline const org::apache::arrow::flatbuf::computeir::Plan *GetPlan(const void *buf) { return flatbuffers::GetRoot(buf); } diff --git a/format/ComputeIR.ExampleExtensions.fbs b/format/ComputeIR.ExampleExtensions.fbs index b545cea97f4df..f288d491a3d72 100644 --- a/format/ComputeIR.ExampleExtensions.fbs +++ b/format/ComputeIR.ExampleExtensions.fbs @@ -35,7 +35,10 @@ table Uri { } /// The contents of Relation.options will be Sql_FromOptions -/// if Relation.name = "sql::from" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "sql", +/// .name = "from", +/// } table Sql_FromOptions { /// The name of a table referenced as a source relation. name: string (required); @@ -56,7 +59,10 @@ table FileFormat { } /// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions -/// if Relation.name = "arrow::filesystem_dataset_scan" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "filesystem_dataset_scan", +/// } table Arrow_FileSystemDatasetScanOptions { /// The base directory of a dataset which should be scanned /// as a source relation. A URI is used to accommodate potentially @@ -74,7 +80,10 @@ table Arrow_FileSystemDatasetScanOptions { // Example output relations: /// The contents of Relation.options will be Sql_IntoOptions -/// if Relation.name = "sql::into" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "sql", +/// .name = "into", +/// } table Sql_IntoOptions { /// The name of a table into which rows will be inserted. name: string (required); @@ -86,14 +95,20 @@ table Sql_IntoOptions { } /// The contents of Relation.options will be Arrow_StreamOutOptions -/// if Relation.name = "arrow::stream_out" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "stream_out", +/// } table Arrow_StreamOutOptions { /// The URI to which RecordBatches of output should be streamed. destination: Uri (required); } /// The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions -/// if Relation.name = "arrow::filesystem_dataset_write" +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "filesystem_dataset_write", +/// } table Arrow_FileSystemDatasetWriteOptions { /// The base directory of a dataset into which output batches should be /// written. A URI is used to accommodate potentially remote file systems. diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 249b1b8f5e351..73ffe5a26a9e0 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -88,12 +88,63 @@ table FieldRef { field: Field; } +/// A canonical (probably SQL equivalent) function +enum CanonicalFunctionId : uint32 { + // logical + And, + Not, + Or, + + // arithmetic + Add, + Subtract, + Multiply, + Divide, + Power, + AbsoluteValue, + Negate, + Sign, + + // comparison + Equal, + NotEqual, + Greater, + GreaterOrEqual, + Less, + LessOrEqual, + + // aggregations + All, + Any, + Count, + Mean, + Min, + Max, + Mode, + Product, + Sum, + Tdigest, + Quantile, + Variance, + StandardDeviation, +} + +table CanonicalFunction { + id: CanonicalFunctionId; +} + +table NonCanonicalFunction { + name_space: string (required); + name: string (required); +} + +union Function { + CanonicalFunction, NonCanonicalFunction +} + table Call { - /// The namespaced name of the function whose invocation this Call represents. - /// For example: "arrow::add" or "gandiva::jit_3432". - /// - /// Names with no namespace are reserved for canonicalization. - function_name: string (required); + /// The function whose invocation this Call represents. + function: Function (required); /// Parameters for `function_name`; content/format may be unique to each /// value of `function_name`. @@ -108,30 +159,42 @@ table Call { field: Field; } +enum CanonicalOperationId : uint32 { + Literal, + Filter, + Project, + Aggregate, + Join, + OrderBy, + Limit, + Common, + Union, + InteractiveOutput, +} + +table CanonicalOperation { + id: CanonicalOperationId; +} + +table NonCanonicalOperation { + name_space: string (required); + name: string (required); +} + +union Operation { + CanonicalOperation, NonCanonicalFunction +} + /// A relation is a set of rows with consistent schema. table Relation { - /// The namespaced name of this Relation. - /// For example: "arrow::hash_join" or "gandiva::filter_and_project". - /// - /// Names with no namespace are reserved for canonical, "pure" relational - /// algebraic operations, which currently include: - /// "filter" - /// "project" - /// "aggregate" - /// "join" - /// "order_by" - /// "limit" - /// "common" - /// "union" - /// "literal" - /// "interactive_output" - relation_name: string (required); - - /// Parameters for `relation_name`; content/format may be unique to each - /// value of `relation_name`. + /// The operation which this Relation wraps. + operation: Operation (required); + + /// Parameters for `operation`; content/format may be unique to each + /// value of `operation`. options: InlineBuffer; - /// The arguments passed to `relation_name`. + /// The arguments passed to `operation`. arguments: [Relation] (required); /// The schema of rows in this Relation @@ -139,47 +202,62 @@ table Relation { } /// The contents of Relation.options will be FilterOptions -/// if Relation.relation_name = "filter" +/// if Relation.operation = CanonicalOperation::Filter table FilterOptions { /// The expression which will be evaluated against input rows /// to determine whether they should be excluded from the - /// "filter" relation's output. + /// filter relation's output. filter_expression: Expression (required); } /// The contents of Relation.options will be ProjectOptions -/// if Relation.relation_name = "project" +/// if Relation.operation = CanonicalOperation::Project table ProjectOptions { /// Expressions which will be evaluated to produce to - /// the rows of the "project" relation's output. + /// the rows of the project relation's output. expressions: [Expression] (required); } /// The contents of Relation.options will be AggregateOptions -/// if Relation.relation_name = "aggregate" +/// if Relation.operation = CanonicalOperation::Aggregate table AggregateOptions { /// Expressions which will be evaluated to produce to - /// the rows of the "aggregate" relation's output. + /// the rows of the aggregate relation's output. aggregations: [Expression] (required); /// Keys by which `aggregations` will be grouped. keys: [Expression] (required); } +enum CanonicalJoinKindId : uint32 { + Inner, + LeftOuter, + RightOuter, + FullOuter, + Cross, +} + +table CanonicalJoinKind { + id: CanonicalJoinKindId; +} + +table NonCanonicalJoinKind { + name_space: string (required); + name: string (required); +} + +union JoinKind { + CanonicalJoinKind, NonCanonicalFunction +} + /// The contents of Relation.options will be JoinOptions -/// if Relation.relation_name = "join" +/// if Relation.operation = CanonicalOperation::Join table JoinOptions { /// The expression which will be evaluated against rows from each /// input to determine whether they should be included in the - /// "join" relation's output. + /// join relation's output. on_expression: Expression (required); - /// The namespaced name of the join to use. Non-namespaced names are - /// reserved for canonicalization. Current names include: - /// "inner" - /// "left" - /// "right" - /// "outer" - /// "cross" - join_name: string; + /// The kind of join to use. + join_kind: JoinKind (required); } /// Whether lesser values should precede greater or vice versa, @@ -197,7 +275,7 @@ table SortKey { } /// The contents of Relation.options will be OrderByOptions -/// if Relation.relation_name = "order_by" +/// if Relation.operation = CanonicalOperation::OrderBy table OrderByOptions { /// Define sort order for rows of output. /// Keys with higher precedence are ordered ahead of other keys. @@ -205,14 +283,14 @@ table OrderByOptions { } /// The contents of Relation.options will be LimitOptions -/// if Relation.relation_name = "limit" +/// if Relation.operation = CanonicalOperation::Limit table LimitOptions { /// Set the maximum number of rows of output. count: long; } /// The contents of Relation.options will be CommonOptions -/// if Relation.relation_name = "common" +/// if Relation.operation = CanonicalOperation::Common table CommonOptions { /// Commons (CTEs in SQL) allow assigning a name to a stream /// of data and reusing it, potentially multiple times and @@ -221,15 +299,15 @@ table CommonOptions { } /// The contents of Relation.options will be UnionOptions -/// if Relation.relation_name = "union" +/// if Relation.operation = CanonicalOperation::Union table UnionOptions { - /// For simplicity, all rows from any input to a "union" relation + /// For simplicity, all rows from any input to a union relation /// will always be concatenated into a single output- establishing /// uniqueness of output rows is deferred to other relations. } /// The contents of Relation.options will be LiteralOptions -/// if Relation.relation_name = "literal" +/// if Relation.operation = CanonicalOperation::Literal table LiteralOptions { /// The columns of this literal relation. columns: [Literal] (required); @@ -259,7 +337,7 @@ rpc_service Interactive { /// Execute a Plan. /// The Plan may contain a single Relation with - /// relation_name="interactive_output", in which case data which + /// operation=InteractiveOutput, in which case data which /// is received by that sink will be streamed back to the client. execute(Plan): Literal (streaming: "server"); } From 8dbcf68f6de25aa9952c95786fbc0e8a9787fe1b Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Tue, 17 Aug 2021 14:09:18 -0400 Subject: [PATCH 24/96] typo, add comment re vector-of-union --- cpp/src/generated/ComputeIR_generated.h | 52 ++++++++++++------------- format/ComputeIR.fbs | 7 +++- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index d0977f8b71081..3e4ef5f805b41 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -417,16 +417,16 @@ inline const char *EnumNameCanonicalOperationId(CanonicalOperationId e) { enum class Operation : uint8_t { NONE = 0, CanonicalOperation = 1, - NonCanonicalFunction = 2, + NonCanonicalOperation = 2, MIN = NONE, - MAX = NonCanonicalFunction + MAX = NonCanonicalOperation }; inline const Operation (&EnumValuesOperation())[3] { static const Operation values[] = { Operation::NONE, Operation::CanonicalOperation, - Operation::NonCanonicalFunction + Operation::NonCanonicalOperation }; return values; } @@ -435,14 +435,14 @@ inline const char * const *EnumNamesOperation() { static const char * const names[4] = { "NONE", "CanonicalOperation", - "NonCanonicalFunction", + "NonCanonicalOperation", nullptr }; return names; } inline const char *EnumNameOperation(Operation e) { - if (flatbuffers::IsOutRange(e, Operation::NONE, Operation::NonCanonicalFunction)) return ""; + if (flatbuffers::IsOutRange(e, Operation::NONE, Operation::NonCanonicalOperation)) return ""; const size_t index = static_cast(e); return EnumNamesOperation()[index]; } @@ -455,8 +455,8 @@ template<> struct OperationTraits struct OperationTraits { - static const Operation enum_value = Operation::NonCanonicalFunction; +template<> struct OperationTraits { + static const Operation enum_value = Operation::NonCanonicalOperation; }; bool VerifyOperation(flatbuffers::Verifier &verifier, const void *obj, Operation type); @@ -504,16 +504,16 @@ inline const char *EnumNameCanonicalJoinKindId(CanonicalJoinKindId e) { enum class JoinKind : uint8_t { NONE = 0, CanonicalJoinKind = 1, - NonCanonicalFunction = 2, + NonCanonicalJoinKind = 2, MIN = NONE, - MAX = NonCanonicalFunction + MAX = NonCanonicalJoinKind }; inline const JoinKind (&EnumValuesJoinKind())[3] { static const JoinKind values[] = { JoinKind::NONE, JoinKind::CanonicalJoinKind, - JoinKind::NonCanonicalFunction + JoinKind::NonCanonicalJoinKind }; return values; } @@ -522,14 +522,14 @@ inline const char * const *EnumNamesJoinKind() { static const char * const names[4] = { "NONE", "CanonicalJoinKind", - "NonCanonicalFunction", + "NonCanonicalJoinKind", nullptr }; return names; } inline const char *EnumNameJoinKind(JoinKind e) { - if (flatbuffers::IsOutRange(e, JoinKind::NONE, JoinKind::NonCanonicalFunction)) return ""; + if (flatbuffers::IsOutRange(e, JoinKind::NONE, JoinKind::NonCanonicalJoinKind)) return ""; const size_t index = static_cast(e); return EnumNamesJoinKind()[index]; } @@ -542,8 +542,8 @@ template<> struct JoinKindTraits struct JoinKindTraits { - static const JoinKind enum_value = JoinKind::NonCanonicalFunction; +template<> struct JoinKindTraits { + static const JoinKind enum_value = JoinKind::NonCanonicalJoinKind; }; bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type); @@ -1378,8 +1378,8 @@ struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const org::apache::arrow::flatbuf::computeir::CanonicalOperation *operation_as_CanonicalOperation() const { return operation_type() == org::apache::arrow::flatbuf::computeir::Operation::CanonicalOperation ? static_cast(operation()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *operation_as_NonCanonicalFunction() const { - return operation_type() == org::apache::arrow::flatbuf::computeir::Operation::NonCanonicalFunction ? static_cast(operation()) : nullptr; + const org::apache::arrow::flatbuf::computeir::NonCanonicalOperation *operation_as_NonCanonicalOperation() const { + return operation_type() == org::apache::arrow::flatbuf::computeir::Operation::NonCanonicalOperation ? static_cast(operation()) : nullptr; } /// Parameters for `operation`; content/format may be unique to each /// value of `operation`. @@ -1414,8 +1414,8 @@ template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalOperati return operation_as_CanonicalOperation(); } -template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *Relation::operation_as() const { - return operation_as_NonCanonicalFunction(); +template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalOperation *Relation::operation_as() const { + return operation_as_NonCanonicalOperation(); } struct RelationBuilder { @@ -1802,8 +1802,8 @@ struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const org::apache::arrow::flatbuf::computeir::CanonicalJoinKind *join_kind_as_CanonicalJoinKind() const { return join_kind_type() == org::apache::arrow::flatbuf::computeir::JoinKind::CanonicalJoinKind ? static_cast(join_kind()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *join_kind_as_NonCanonicalFunction() const { - return join_kind_type() == org::apache::arrow::flatbuf::computeir::JoinKind::NonCanonicalFunction ? static_cast(join_kind()) : nullptr; + const org::apache::arrow::flatbuf::computeir::NonCanonicalJoinKind *join_kind_as_NonCanonicalJoinKind() const { + return join_kind_type() == org::apache::arrow::flatbuf::computeir::JoinKind::NonCanonicalJoinKind ? static_cast(join_kind()) : nullptr; } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -1820,8 +1820,8 @@ template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalJoinKin return join_kind_as_CanonicalJoinKind(); } -template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *JoinOptions::join_kind_as() const { - return join_kind_as_NonCanonicalFunction(); +template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalJoinKind *JoinOptions::join_kind_as() const { + return join_kind_as_NonCanonicalJoinKind(); } struct JoinOptionsBuilder { @@ -2339,8 +2339,8 @@ inline bool VerifyOperation(flatbuffers::Verifier &verifier, const void *obj, Op auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } - case Operation::NonCanonicalFunction: { - auto ptr = reinterpret_cast(obj); + case Operation::NonCanonicalOperation: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; @@ -2368,8 +2368,8 @@ inline bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, Joi auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } - case JoinKind::NonCanonicalFunction: { - auto ptr = reinterpret_cast(obj); + case JoinKind::NonCanonicalJoinKind: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 73ffe5a26a9e0..874b7213996d5 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -37,6 +37,9 @@ union ExpressionImpl { } table Expression { + // Ideally we'd simply have `union Expression { Literal, FieldRef, Call }` + // but not all generators support vectors of unions so we provide minimal + // indirection to support them. impl: ExpressionImpl (required); } @@ -182,7 +185,7 @@ table NonCanonicalOperation { } union Operation { - CanonicalOperation, NonCanonicalFunction + CanonicalOperation, NonCanonicalOperation } /// A relation is a set of rows with consistent schema. @@ -246,7 +249,7 @@ table NonCanonicalJoinKind { } union JoinKind { - CanonicalJoinKind, NonCanonicalFunction + CanonicalJoinKind, NonCanonicalJoinKind } /// The contents of Relation.options will be JoinOptions From f4633c944449a6505eb0a9566290dff174389622 Mon Sep 17 00:00:00 2001 From: Benjamin Kietzman Date: Wed, 18 Aug 2021 11:51:39 -0400 Subject: [PATCH 25/96] refactor InlineBuffer to avoid need for reinterpret_cast --- cpp/src/generated/ComputeIR_generated.h | 1007 +++++++++++++++++++++-- format/ComputeIR.fbs | 62 +- 2 files changed, 968 insertions(+), 101 deletions(-) diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index 3e4ef5f805b41..ac7d329ac1bfb 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -14,6 +14,39 @@ namespace arrow { namespace flatbuf { namespace computeir { +struct Int8Buffer; +struct Int8BufferBuilder; + +struct Int16Buffer; +struct Int16BufferBuilder; + +struct Int32Buffer; +struct Int32BufferBuilder; + +struct Int64Buffer; +struct Int64BufferBuilder; + +struct UInt8Buffer; +struct UInt8BufferBuilder; + +struct UInt16Buffer; +struct UInt16BufferBuilder; + +struct UInt32Buffer; +struct UInt32BufferBuilder; + +struct UInt64Buffer; +struct UInt64BufferBuilder; + +struct Float32Buffer; +struct Float32BufferBuilder; + +struct Float64Buffer; +struct Float64BufferBuilder; + +struct TableBuffer; +struct TableBufferBuilder; + struct InlineBuffer; struct InlineBufferBuilder; @@ -89,6 +122,117 @@ struct LiteralOptionsBuilder; struct Plan; struct PlanBuilder; +enum class InlineBufferImpl : uint8_t { + NONE = 0, + Int8Buffer = 1, + Int16Buffer = 2, + Int32Buffer = 3, + Int64Buffer = 4, + UInt8Buffer = 5, + UInt16Buffer = 6, + UInt32Buffer = 7, + UInt64Buffer = 8, + Float32Buffer = 9, + Float64Buffer = 10, + TableBuffer = 11, + MIN = NONE, + MAX = TableBuffer +}; + +inline const InlineBufferImpl (&EnumValuesInlineBufferImpl())[12] { + static const InlineBufferImpl values[] = { + InlineBufferImpl::NONE, + InlineBufferImpl::Int8Buffer, + InlineBufferImpl::Int16Buffer, + InlineBufferImpl::Int32Buffer, + InlineBufferImpl::Int64Buffer, + InlineBufferImpl::UInt8Buffer, + InlineBufferImpl::UInt16Buffer, + InlineBufferImpl::UInt32Buffer, + InlineBufferImpl::UInt64Buffer, + InlineBufferImpl::Float32Buffer, + InlineBufferImpl::Float64Buffer, + InlineBufferImpl::TableBuffer + }; + return values; +} + +inline const char * const *EnumNamesInlineBufferImpl() { + static const char * const names[13] = { + "NONE", + "Int8Buffer", + "Int16Buffer", + "Int32Buffer", + "Int64Buffer", + "UInt8Buffer", + "UInt16Buffer", + "UInt32Buffer", + "UInt64Buffer", + "Float32Buffer", + "Float64Buffer", + "TableBuffer", + nullptr + }; + return names; +} + +inline const char *EnumNameInlineBufferImpl(InlineBufferImpl e) { + if (flatbuffers::IsOutRange(e, InlineBufferImpl::NONE, InlineBufferImpl::TableBuffer)) return ""; + const size_t index = static_cast(e); + return EnumNamesInlineBufferImpl()[index]; +} + +template struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::NONE; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int8Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int16Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int32Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int64Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt8Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt16Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt32Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt64Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Float32Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Float64Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::TableBuffer; +}; + +bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type); +bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + /// An expression is one of /// - a Literal datum /// - a reference to a Field from a Relation @@ -587,30 +731,706 @@ inline const char *EnumNameOrdering(Ordering e) { return EnumNamesOrdering()[index]; } -/// Avoid use of org.apache.arrow.Buffer because it requires a -/// sidecar block of bytes. +struct Int8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int8BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int8BufferBuilder { + typedef Int8Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int8Buffer::VT_ITEMS, items); + } + explicit Int8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int8BufferBuilder &operator=(const Int8BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int8Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt8Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int8BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt8BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateInt8Buffer( + _fbb, + items__); +} + +struct Int16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int16BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int16BufferBuilder { + typedef Int16Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int16Buffer::VT_ITEMS, items); + } + explicit Int16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int16BufferBuilder &operator=(const Int16BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int16Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt16Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int16BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt16BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateInt16Buffer( + _fbb, + items__); +} + +struct Int32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int32BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int32BufferBuilder { + typedef Int32Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int32Buffer::VT_ITEMS, items); + } + explicit Int32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int32BufferBuilder &operator=(const Int32BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int32Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt32Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int32BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt32BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateInt32Buffer( + _fbb, + items__); +} + +struct Int64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int64BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int64BufferBuilder { + typedef Int64Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int64Buffer::VT_ITEMS, items); + } + explicit Int64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int64BufferBuilder &operator=(const Int64BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int64Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt64Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int64BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt64BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateInt64Buffer( + _fbb, + items__); +} + +struct UInt8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt8BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt8BufferBuilder { + typedef UInt8Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt8Buffer::VT_ITEMS, items); + } + explicit UInt8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt8BufferBuilder &operator=(const UInt8BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt8Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt8Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt8BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt8BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateUInt8Buffer( + _fbb, + items__); +} + +struct UInt16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt16BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt16BufferBuilder { + typedef UInt16Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt16Buffer::VT_ITEMS, items); + } + explicit UInt16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt16BufferBuilder &operator=(const UInt16BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt16Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt16Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt16BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt16BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateUInt16Buffer( + _fbb, + items__); +} + +struct UInt32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt32BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt32BufferBuilder { + typedef UInt32Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt32Buffer::VT_ITEMS, items); + } + explicit UInt32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt32BufferBuilder &operator=(const UInt32BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt32Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt32Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt32BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt32BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateUInt32Buffer( + _fbb, + items__); +} + +struct UInt64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt64BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt64BufferBuilder { + typedef UInt64Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt64Buffer::VT_ITEMS, items); + } + explicit UInt64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt64BufferBuilder &operator=(const UInt64BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt64Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt64Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt64BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt64BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateUInt64Buffer( + _fbb, + items__); +} + +struct Float32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Float32BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Float32BufferBuilder { + typedef Float32Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Float32Buffer::VT_ITEMS, items); + } + explicit Float32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Float32BufferBuilder &operator=(const Float32BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Float32Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateFloat32Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Float32BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateFloat32BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateFloat32Buffer( + _fbb, + items__); +} + +struct Float64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Float64BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Float64BufferBuilder { + typedef Float64Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Float64Buffer::VT_ITEMS, items); + } + explicit Float64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Float64BufferBuilder &operator=(const Float64BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Float64Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateFloat64Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Float64BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateFloat64BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateFloat64Buffer( + _fbb, + items__); +} + +struct TableBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef TableBufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + const org::apache::arrow::flatbuf::computeir::InlineBuffer *items_nested_root() const { + return flatbuffers::GetRoot(items()->Data()); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct TableBufferBuilder { + typedef TableBuffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(TableBuffer::VT_ITEMS, items); + } + explicit TableBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + TableBufferBuilder &operator=(const TableBufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, TableBuffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateTableBuffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + TableBufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateTableBufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::flatbuf::computeir::CreateTableBuffer( + _fbb, + items__); +} + +/// An inline replacement for org.apache.arrow.Buffer because that +/// requires a sidecar block of bytes into which offsets can point. +/// A union of buffers of each primitive type is provided to avoid +/// the need for reinterpret_cast, std::mem::transmute, ... +/// The final member of the union is a bytes buffer aligned suitably +/// to hold any flatbuffer Table. struct InlineBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef InlineBufferBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BYTES = 4 + VT_IMPL_TYPE = 4, + VT_IMPL = 6 }; - const flatbuffers::Vector *bytes() const { - return GetPointer *>(VT_BYTES); + org::apache::arrow::flatbuf::computeir::InlineBufferImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::flatbuf::computeir::Int8Buffer *impl_as_Int8Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int8Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Int16Buffer *impl_as_Int16Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int16Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Int32Buffer *impl_as_Int32Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int32Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Int64Buffer *impl_as_Int64Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int64Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::UInt8Buffer *impl_as_UInt8Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt8Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::UInt16Buffer *impl_as_UInt16Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt16Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::UInt32Buffer *impl_as_UInt32Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt32Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::UInt64Buffer *impl_as_UInt64Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt64Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Float32Buffer *impl_as_Float32Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Float32Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::Float64Buffer *impl_as_Float64Buffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Float64Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::flatbuf::computeir::TableBuffer *impl_as_TableBuffer() const { + return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::TableBuffer ? static_cast(impl()) : nullptr; } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BYTES) && - verifier.VerifyVector(bytes()) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyInlineBufferImpl(verifier, impl(), impl_type()) && verifier.EndTable(); } }; +template<> inline const org::apache::arrow::flatbuf::computeir::Int8Buffer *InlineBuffer::impl_as() const { + return impl_as_Int8Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Int16Buffer *InlineBuffer::impl_as() const { + return impl_as_Int16Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Int32Buffer *InlineBuffer::impl_as() const { + return impl_as_Int32Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Int64Buffer *InlineBuffer::impl_as() const { + return impl_as_Int64Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::UInt8Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt8Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::UInt16Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt16Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::UInt32Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt32Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::UInt64Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt64Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Float32Buffer *InlineBuffer::impl_as() const { + return impl_as_Float32Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::Float64Buffer *InlineBuffer::impl_as() const { + return impl_as_Float64Buffer(); +} + +template<> inline const org::apache::arrow::flatbuf::computeir::TableBuffer *InlineBuffer::impl_as() const { + return impl_as_TableBuffer(); +} + struct InlineBufferBuilder { typedef InlineBuffer Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_bytes(flatbuffers::Offset> bytes) { - fbb_.AddOffset(InlineBuffer::VT_BYTES, bytes); + void add_impl_type(org::apache::arrow::flatbuf::computeir::InlineBufferImpl impl_type) { + fbb_.AddElement(InlineBuffer::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(InlineBuffer::VT_IMPL, impl); } explicit InlineBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { @@ -620,34 +1440,35 @@ struct InlineBufferBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, InlineBuffer::VT_BYTES); + fbb_.Required(o, InlineBuffer::VT_IMPL); return o; } }; inline flatbuffers::Offset CreateInlineBuffer( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> bytes = 0) { + org::apache::arrow::flatbuf::computeir::InlineBufferImpl impl_type = org::apache::arrow::flatbuf::computeir::InlineBufferImpl::NONE, + flatbuffers::Offset impl = 0) { InlineBufferBuilder builder_(_fbb); - builder_.add_bytes(bytes); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); return builder_.Finish(); } -inline flatbuffers::Offset CreateInlineBufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *bytes = nullptr) { - auto bytes__ = bytes ? _fbb.CreateVector(*bytes) : 0; - return org::apache::arrow::flatbuf::computeir::CreateInlineBuffer( - _fbb, - bytes__); -} - struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ExpressionBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 + VT_FIELD = 4, + VT_IMPL_TYPE = 6, + VT_IMPL = 8 }; + /// The type of this literal. Field is used instead of Type to pick + /// up child fields, dictionary encoding, etc. + /// Field.name should always be absent since it is not meaningful + /// for Expressions. + const org::apache::arrow::flatbuf::Field *field() const { + return GetPointer(VT_FIELD); + } org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type() const { return static_cast(GetField(VT_IMPL_TYPE, 0)); } @@ -666,6 +1487,8 @@ struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_FIELD) && + verifier.VerifyTable(field()) && VerifyField(verifier, VT_IMPL_TYPE) && VerifyOffsetRequired(verifier, VT_IMPL) && VerifyExpressionImpl(verifier, impl(), impl_type()) && @@ -689,6 +1512,9 @@ struct ExpressionBuilder { typedef Expression Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; + void add_field(flatbuffers::Offset field) { + fbb_.AddOffset(Expression::VT_FIELD, field); + } void add_impl_type(org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type) { fbb_.AddElement(Expression::VT_IMPL_TYPE, static_cast(impl_type), 0); } @@ -703,6 +1529,7 @@ struct ExpressionBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); + fbb_.Required(o, Expression::VT_FIELD); fbb_.Required(o, Expression::VT_IMPL); return o; } @@ -710,10 +1537,12 @@ struct ExpressionBuilder { inline flatbuffers::Offset CreateExpression( flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset field = 0, org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type = org::apache::arrow::flatbuf::computeir::ExpressionImpl::NONE, flatbuffers::Offset impl = 0) { ExpressionBuilder builder_(_fbb); builder_.add_impl(impl); + builder_.add_field(field); builder_.add_impl_type(impl_type); return builder_.Finish(); } @@ -796,9 +1625,8 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SHAPE_TYPE = 4, VT_SHAPE = 6, - VT_FIELD = 8, - VT_BUFFERS = 10, - VT_DICTIONARY = 12 + VT_BUFFERS = 8, + VT_DICTIONARY = 10 }; org::apache::arrow::flatbuf::computeir::Shape shape_type() const { return static_cast(GetField(VT_SHAPE_TYPE, 0)); @@ -818,11 +1646,6 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const org::apache::arrow::flatbuf::computeir::Scalar *shape_as_Scalar() const { return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::Scalar ? static_cast(shape()) : nullptr; } - /// The type of this literal. Field is used instead of Type to pick - /// up child fields, dictionary encoding, etc. - const org::apache::arrow::flatbuf::Field *field() const { - return GetPointer(VT_FIELD); - } /// Buffers containing N elements of arrow-formatted data, where N /// is Array.length if shape is Array or 1 if shape is Scalar. /// XXX this can be optimized for trivial scalars later @@ -839,8 +1662,6 @@ struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyField(verifier, VT_SHAPE_TYPE) && VerifyOffsetRequired(verifier, VT_SHAPE) && VerifyShape(verifier, shape(), shape_type()) && - VerifyOffsetRequired(verifier, VT_FIELD) && - verifier.VerifyTable(field()) && VerifyOffset(verifier, VT_BUFFERS) && verifier.VerifyVector(buffers()) && verifier.VerifyVectorOfTables(buffers()) && @@ -868,9 +1689,6 @@ struct LiteralBuilder { void add_shape(flatbuffers::Offset shape) { fbb_.AddOffset(Literal::VT_SHAPE, shape); } - void add_field(flatbuffers::Offset field) { - fbb_.AddOffset(Literal::VT_FIELD, field); - } void add_buffers(flatbuffers::Offset>> buffers) { fbb_.AddOffset(Literal::VT_BUFFERS, buffers); } @@ -886,7 +1704,6 @@ struct LiteralBuilder { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); fbb_.Required(o, Literal::VT_SHAPE); - fbb_.Required(o, Literal::VT_FIELD); return o; } }; @@ -895,13 +1712,11 @@ inline flatbuffers::Offset CreateLiteral( flatbuffers::FlatBufferBuilder &_fbb, org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, flatbuffers::Offset shape = 0, - flatbuffers::Offset field = 0, flatbuffers::Offset>> buffers = 0, flatbuffers::Offset dictionary = 0) { LiteralBuilder builder_(_fbb); builder_.add_dictionary(dictionary); builder_.add_buffers(buffers); - builder_.add_field(field); builder_.add_shape(shape); builder_.add_shape_type(shape_type); return builder_.Finish(); @@ -911,7 +1726,6 @@ inline flatbuffers::Offset CreateLiteralDirect( flatbuffers::FlatBufferBuilder &_fbb, org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, flatbuffers::Offset shape = 0, - flatbuffers::Offset field = 0, const std::vector> *buffers = nullptr, flatbuffers::Offset dictionary = 0) { auto buffers__ = buffers ? _fbb.CreateVector>(*buffers) : 0; @@ -919,7 +1733,6 @@ inline flatbuffers::Offset CreateLiteralDirect( _fbb, shape_type, shape, - field, buffers__, dictionary); } @@ -928,8 +1741,7 @@ struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef FieldRefBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_PATH = 4, - VT_RELATION_INDEX = 6, - VT_FIELD = 8 + VT_RELATION_INDEX = 6 }; /// A sequence of field names to allow referencing potentially nested fields const flatbuffers::Vector> *path() const { @@ -942,19 +1754,12 @@ struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { int32_t relation_index() const { return GetField(VT_RELATION_INDEX, 0); } - /// The type of the referenced Field. Field is used instead of Type to pick - /// up child fields, dictionary encoding, etc. - const org::apache::arrow::flatbuf::Field *field() const { - return GetPointer(VT_FIELD); - } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_PATH) && verifier.VerifyVector(path()) && verifier.VerifyVectorOfStrings(path()) && VerifyField(verifier, VT_RELATION_INDEX) && - VerifyOffset(verifier, VT_FIELD) && - verifier.VerifyTable(field()) && verifier.EndTable(); } }; @@ -969,9 +1774,6 @@ struct FieldRefBuilder { void add_relation_index(int32_t relation_index) { fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); } - void add_field(flatbuffers::Offset field) { - fbb_.AddOffset(FieldRef::VT_FIELD, field); - } explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -987,10 +1789,8 @@ struct FieldRefBuilder { inline flatbuffers::Offset CreateFieldRef( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset>> path = 0, - int32_t relation_index = 0, - flatbuffers::Offset field = 0) { + int32_t relation_index = 0) { FieldRefBuilder builder_(_fbb); - builder_.add_field(field); builder_.add_relation_index(relation_index); builder_.add_path(path); return builder_.Finish(); @@ -999,14 +1799,12 @@ inline flatbuffers::Offset CreateFieldRef( inline flatbuffers::Offset CreateFieldRefDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector> *path = nullptr, - int32_t relation_index = 0, - flatbuffers::Offset field = 0) { + int32_t relation_index = 0) { auto path__ = path ? _fbb.CreateVector>(*path) : 0; return org::apache::arrow::flatbuf::computeir::CreateFieldRef( _fbb, path__, - relation_index, - field); + relation_index); } struct CanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { @@ -1125,8 +1923,7 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_FUNCTION_TYPE = 4, VT_FUNCTION = 6, VT_OPTIONS = 8, - VT_ARGUMENTS = 10, - VT_FIELD = 12 + VT_ARGUMENTS = 10 }; org::apache::arrow::flatbuf::computeir::Function function_type() const { return static_cast(GetField(VT_FUNCTION_TYPE, 0)); @@ -1151,12 +1948,6 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const flatbuffers::Vector> *arguments() const { return GetPointer> *>(VT_ARGUMENTS); } - /// The type of data which invoking `function_name` will return. - /// Field is used instead of Type to pick up child fields, - /// dictionary encoding, etc. - const org::apache::arrow::flatbuf::Field *field() const { - return GetPointer(VT_FIELD); - } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_FUNCTION_TYPE) && @@ -1167,8 +1958,6 @@ struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyOffsetRequired(verifier, VT_ARGUMENTS) && verifier.VerifyVector(arguments()) && verifier.VerifyVectorOfTables(arguments()) && - VerifyOffset(verifier, VT_FIELD) && - verifier.VerifyTable(field()) && verifier.EndTable(); } }; @@ -1197,9 +1986,6 @@ struct CallBuilder { void add_arguments(flatbuffers::Offset>> arguments) { fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); } - void add_field(flatbuffers::Offset field) { - fbb_.AddOffset(Call::VT_FIELD, field); - } explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -1219,10 +2005,8 @@ inline flatbuffers::Offset CreateCall( org::apache::arrow::flatbuf::computeir::Function function_type = org::apache::arrow::flatbuf::computeir::Function::NONE, flatbuffers::Offset function = 0, flatbuffers::Offset options = 0, - flatbuffers::Offset>> arguments = 0, - flatbuffers::Offset field = 0) { + flatbuffers::Offset>> arguments = 0) { CallBuilder builder_(_fbb); - builder_.add_field(field); builder_.add_arguments(arguments); builder_.add_options(options); builder_.add_function(function); @@ -1235,16 +2019,14 @@ inline flatbuffers::Offset CreateCallDirect( org::apache::arrow::flatbuf::computeir::Function function_type = org::apache::arrow::flatbuf::computeir::Function::NONE, flatbuffers::Offset function = 0, flatbuffers::Offset options = 0, - const std::vector> *arguments = nullptr, - flatbuffers::Offset field = 0) { + const std::vector> *arguments = nullptr) { auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; return org::apache::arrow::flatbuf::computeir::CreateCall( _fbb, function_type, function, options, - arguments__, - field); + arguments__); } struct CanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { @@ -2239,6 +3021,71 @@ inline flatbuffers::Offset CreatePlanDirect( derived_from); } +inline bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type) { + switch (type) { + case InlineBufferImpl::NONE: { + return true; + } + case InlineBufferImpl::Int8Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Int16Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Int32Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Int64Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt8Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt16Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt32Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt64Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Float32Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Float64Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::TableBuffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyInlineBufferImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + inline bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type) { switch (type) { case ExpressionImpl::NONE: { diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs index 874b7213996d5..d710618debb24 100644 --- a/format/ComputeIR.fbs +++ b/format/ComputeIR.fbs @@ -19,12 +19,42 @@ include "Schema.fbs"; namespace org.apache.arrow.flatbuf.computeir; -/// Avoid use of org.apache.arrow.Buffer because it requires a -/// sidecar block of bytes. +table Int8Buffer { items: [uint8] (required); } +table Int16Buffer { items: [uint16] (required); } +table Int32Buffer { items: [uint32] (required); } +table Int64Buffer { items: [uint64] (required); } +table UInt8Buffer { items: [uint8] (required); } +table UInt16Buffer { items: [uint16] (required); } +table UInt32Buffer { items: [uint32] (required); } +table UInt64Buffer { items: [uint64] (required); } +table Float32Buffer { items: [float32] (required); } +table Float64Buffer { items: [float64] (required); } +table TableBuffer { items: [ubyte] (required, nested_flatbuffer: "InlineBuffer"); } +union InlineBufferImpl { + Int8Buffer, + Int16Buffer, + Int32Buffer, + Int64Buffer, + UInt8Buffer, + UInt16Buffer, + UInt32Buffer, + UInt64Buffer, + Float32Buffer, + Float64Buffer, + TableBuffer, +} + +/// An inline replacement for org.apache.arrow.Buffer because that +/// requires a sidecar block of bytes into which offsets can point. +/// A union of buffers of each primitive type is provided to avoid +/// the need for reinterpret_cast, std::mem::transmute, ... +/// The final member of the union is a bytes buffer aligned suitably +/// to hold any flatbuffer Table. table InlineBuffer { - // ulong is used to guarantee alignment and padding of `bytes` so that flatbuffers - // and other alignment sensitive blobs can be stored here - bytes: [ulong] (required); + // Ideally we'd simply have `union InlineBuffer { ... }` + // but not all generators support vectors of unions so we provide minimal + // indirection to support them. + impl: InlineBufferImpl (required); } /// An expression is one of @@ -37,9 +67,12 @@ union ExpressionImpl { } table Expression { - // Ideally we'd simply have `union Expression { Literal, FieldRef, Call }` - // but not all generators support vectors of unions so we provide minimal - // indirection to support them. + /// The type of this literal. Field is used instead of Type to pick + /// up child fields, dictionary encoding, etc. + /// Field.name should always be absent since it is not meaningful + /// for Expressions. + field: Field (required); + impl: ExpressionImpl (required); } @@ -62,10 +95,6 @@ table Literal { /// with multiple "columns" if the type happens to be Struct. shape: Shape (required); - /// The type of this literal. Field is used instead of Type to pick - /// up child fields, dictionary encoding, etc. - field: Field (required); - /// Buffers containing N elements of arrow-formatted data, where N /// is Array.length if shape is Array or 1 if shape is Scalar. /// XXX this can be optimized for trivial scalars later @@ -85,10 +114,6 @@ table FieldRef { /// `path` points into. For example in the case of a join, /// 0 refers to the left relation and 1 to the right relation. relation_index: int; - - /// The type of the referenced Field. Field is used instead of Type to pick - /// up child fields, dictionary encoding, etc. - field: Field; } /// A canonical (probably SQL equivalent) function @@ -155,11 +180,6 @@ table Call { /// The arguments passed to `function_name`. arguments: [Expression] (required); - - /// The type of data which invoking `function_name` will return. - /// Field is used instead of Type to pick up child fields, - /// dictionary encoding, etc. - field: Field; } enum CanonicalOperationId : uint32 { From 333b58e38df866cba14eea8e258061f386c5608c Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:45:35 -0400 Subject: [PATCH 26/96] Move compute to experimental directory --- format/ComputeIR.fbs | 368 ------------------ .../computeir/ExampleExtensions.fbs} | 11 +- format/experimental/computeir/Expression.fbs | 351 +++++++++++++++++ .../experimental/computeir/InlineBuffer.fbs | 56 +++ format/experimental/computeir/Literal.fbs | 177 +++++++++ format/experimental/computeir/Plan.fbs | 33 ++ format/experimental/computeir/Relation.fbs | 224 +++++++++++ 7 files changed, 846 insertions(+), 374 deletions(-) delete mode 100644 format/ComputeIR.fbs rename format/{ComputeIR.ExampleExtensions.fbs => experimental/computeir/ExampleExtensions.fbs} (94%) create mode 100644 format/experimental/computeir/Expression.fbs create mode 100644 format/experimental/computeir/InlineBuffer.fbs create mode 100644 format/experimental/computeir/Literal.fbs create mode 100644 format/experimental/computeir/Plan.fbs create mode 100644 format/experimental/computeir/Relation.fbs diff --git a/format/ComputeIR.fbs b/format/ComputeIR.fbs deleted file mode 100644 index d710618debb24..0000000000000 --- a/format/ComputeIR.fbs +++ /dev/null @@ -1,368 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -include "Schema.fbs"; - -namespace org.apache.arrow.flatbuf.computeir; - -table Int8Buffer { items: [uint8] (required); } -table Int16Buffer { items: [uint16] (required); } -table Int32Buffer { items: [uint32] (required); } -table Int64Buffer { items: [uint64] (required); } -table UInt8Buffer { items: [uint8] (required); } -table UInt16Buffer { items: [uint16] (required); } -table UInt32Buffer { items: [uint32] (required); } -table UInt64Buffer { items: [uint64] (required); } -table Float32Buffer { items: [float32] (required); } -table Float64Buffer { items: [float64] (required); } -table TableBuffer { items: [ubyte] (required, nested_flatbuffer: "InlineBuffer"); } -union InlineBufferImpl { - Int8Buffer, - Int16Buffer, - Int32Buffer, - Int64Buffer, - UInt8Buffer, - UInt16Buffer, - UInt32Buffer, - UInt64Buffer, - Float32Buffer, - Float64Buffer, - TableBuffer, -} - -/// An inline replacement for org.apache.arrow.Buffer because that -/// requires a sidecar block of bytes into which offsets can point. -/// A union of buffers of each primitive type is provided to avoid -/// the need for reinterpret_cast, std::mem::transmute, ... -/// The final member of the union is a bytes buffer aligned suitably -/// to hold any flatbuffer Table. -table InlineBuffer { - // Ideally we'd simply have `union InlineBuffer { ... }` - // but not all generators support vectors of unions so we provide minimal - // indirection to support them. - impl: InlineBufferImpl (required); -} - -/// An expression is one of -/// - a Literal datum -/// - a reference to a Field from a Relation -/// - a call to a named function -/// On evaluation, an Expression will have either array or scalar shape. -union ExpressionImpl { - Literal, FieldRef, Call -} - -table Expression { - /// The type of this literal. Field is used instead of Type to pick - /// up child fields, dictionary encoding, etc. - /// Field.name should always be absent since it is not meaningful - /// for Expressions. - field: Field (required); - - impl: ExpressionImpl (required); -} - -union Shape { - Array, Scalar -} - -table Scalar {} - -table Array { - /// Number of slots. - length: long; -} - -table Literal { - /// Shape of this literal. - /// - /// Note that this is orthogonal to type and refers to the number - /// of rows spanned by this Literal - a Literal may be Scalar shaped - /// with multiple "columns" if the type happens to be Struct. - shape: Shape (required); - - /// Buffers containing N elements of arrow-formatted data, where N - /// is Array.length if shape is Array or 1 if shape is Scalar. - /// XXX this can be optimized for trivial scalars later - buffers: [InlineBuffer]; - - /// If (and only if) this Literal has dictionary type, this field dictionary - /// into which the literal's indices refer. - dictionary: Literal; -} - -table FieldRef { - /// A sequence of field names to allow referencing potentially nested fields - path: [string]; - - /// For Expressions which might reference fields in multiple Relations, - /// this index may be provided to indicate which Relation's fields - /// `path` points into. For example in the case of a join, - /// 0 refers to the left relation and 1 to the right relation. - relation_index: int; -} - -/// A canonical (probably SQL equivalent) function -enum CanonicalFunctionId : uint32 { - // logical - And, - Not, - Or, - - // arithmetic - Add, - Subtract, - Multiply, - Divide, - Power, - AbsoluteValue, - Negate, - Sign, - - // comparison - Equal, - NotEqual, - Greater, - GreaterOrEqual, - Less, - LessOrEqual, - - // aggregations - All, - Any, - Count, - Mean, - Min, - Max, - Mode, - Product, - Sum, - Tdigest, - Quantile, - Variance, - StandardDeviation, -} - -table CanonicalFunction { - id: CanonicalFunctionId; -} - -table NonCanonicalFunction { - name_space: string (required); - name: string (required); -} - -union Function { - CanonicalFunction, NonCanonicalFunction -} - -table Call { - /// The function whose invocation this Call represents. - function: Function (required); - - /// Parameters for `function_name`; content/format may be unique to each - /// value of `function_name`. - options: InlineBuffer; - - /// The arguments passed to `function_name`. - arguments: [Expression] (required); -} - -enum CanonicalOperationId : uint32 { - Literal, - Filter, - Project, - Aggregate, - Join, - OrderBy, - Limit, - Common, - Union, - InteractiveOutput, -} - -table CanonicalOperation { - id: CanonicalOperationId; -} - -table NonCanonicalOperation { - name_space: string (required); - name: string (required); -} - -union Operation { - CanonicalOperation, NonCanonicalOperation -} - -/// A relation is a set of rows with consistent schema. -table Relation { - /// The operation which this Relation wraps. - operation: Operation (required); - - /// Parameters for `operation`; content/format may be unique to each - /// value of `operation`. - options: InlineBuffer; - - /// The arguments passed to `operation`. - arguments: [Relation] (required); - - /// The schema of rows in this Relation - schema: Schema; -} - -/// The contents of Relation.options will be FilterOptions -/// if Relation.operation = CanonicalOperation::Filter -table FilterOptions { - /// The expression which will be evaluated against input rows - /// to determine whether they should be excluded from the - /// filter relation's output. - filter_expression: Expression (required); -} - -/// The contents of Relation.options will be ProjectOptions -/// if Relation.operation = CanonicalOperation::Project -table ProjectOptions { - /// Expressions which will be evaluated to produce to - /// the rows of the project relation's output. - expressions: [Expression] (required); -} - -/// The contents of Relation.options will be AggregateOptions -/// if Relation.operation = CanonicalOperation::Aggregate -table AggregateOptions { - /// Expressions which will be evaluated to produce to - /// the rows of the aggregate relation's output. - aggregations: [Expression] (required); - /// Keys by which `aggregations` will be grouped. - keys: [Expression] (required); -} - -enum CanonicalJoinKindId : uint32 { - Inner, - LeftOuter, - RightOuter, - FullOuter, - Cross, -} - -table CanonicalJoinKind { - id: CanonicalJoinKindId; -} - -table NonCanonicalJoinKind { - name_space: string (required); - name: string (required); -} - -union JoinKind { - CanonicalJoinKind, NonCanonicalJoinKind -} - -/// The contents of Relation.options will be JoinOptions -/// if Relation.operation = CanonicalOperation::Join -table JoinOptions { - /// The expression which will be evaluated against rows from each - /// input to determine whether they should be included in the - /// join relation's output. - on_expression: Expression (required); - /// The kind of join to use. - join_kind: JoinKind (required); -} - -/// Whether lesser values should precede greater or vice versa, -/// also whether nulls should preced or follow values. -enum Ordering : uint8 { - ASCENDING_THEN_NULLS, - DESCENDING_THEN_NULLS, - NULLS_THEN_ASCENDING, - NULLS_THEN_DESCENDING -} - -table SortKey { - value: Expression (required); - ordering: Ordering = ASCENDING_THEN_NULLS; -} - -/// The contents of Relation.options will be OrderByOptions -/// if Relation.operation = CanonicalOperation::OrderBy -table OrderByOptions { - /// Define sort order for rows of output. - /// Keys with higher precedence are ordered ahead of other keys. - keys: [SortKey] (required); -} - -/// The contents of Relation.options will be LimitOptions -/// if Relation.operation = CanonicalOperation::Limit -table LimitOptions { - /// Set the maximum number of rows of output. - count: long; -} - -/// The contents of Relation.options will be CommonOptions -/// if Relation.operation = CanonicalOperation::Common -table CommonOptions { - /// Commons (CTEs in SQL) allow assigning a name to a stream - /// of data and reusing it, potentially multiple times and - /// potentially recursively. - name: string (required); -} - -/// The contents of Relation.options will be UnionOptions -/// if Relation.operation = CanonicalOperation::Union -table UnionOptions { - /// For simplicity, all rows from any input to a union relation - /// will always be concatenated into a single output- establishing - /// uniqueness of output rows is deferred to other relations. -} - -/// The contents of Relation.options will be LiteralOptions -/// if Relation.operation = CanonicalOperation::Literal -table LiteralOptions { - /// The columns of this literal relation. - columns: [Literal] (required); -} - -/// A specification of a query. -table Plan { - /// One or more output relations. - sinks: [Relation] (required); - - /// If this Plan was derived from another (for example by running - /// an optimization pass), that plan may be included here to - /// provide a backtrace of derivations. - derived_from: Plan; -} - -/// Frequently there is an open direct channel between producers -/// of queries (client) and their consumers (server). -/// `Interactive` is provided to reify this case: -rpc_service Interactive { - /// Restructure the provided Plan into one which contains only - /// Relations that are directly executable by the server. - /// These relations will usually be opaque to the client, but should - /// be descriptively named and validly structured to provide a client - /// with information on how the query will be executed. - explain(Plan): Plan (streaming: "none"); - - /// Execute a Plan. - /// The Plan may contain a single Relation with - /// operation=InteractiveOutput, in which case data which - /// is received by that sink will be streamed back to the client. - execute(Plan): Literal (streaming: "server"); -} - -root_type Plan; diff --git a/format/ComputeIR.ExampleExtensions.fbs b/format/experimental/computeir/ExampleExtensions.fbs similarity index 94% rename from format/ComputeIR.ExampleExtensions.fbs rename to format/experimental/computeir/ExampleExtensions.fbs index f288d491a3d72..7ff676546671d 100644 --- a/format/ComputeIR.ExampleExtensions.fbs +++ b/format/experimental/computeir/ExampleExtensions.fbs @@ -15,10 +15,9 @@ // specific language governing permissions and limitations // under the License. -include "Schema.fbs"; -include "ComputeIR.fbs"; +include "../../Schema.fbs"; -namespace org.apache.arrow.flatbuf.computeir.ext; +namespace org.apache.arrow.computeir.flatbuf.ext; ///////////////////////////////////////////////////////////// // Example source relations: @@ -30,7 +29,7 @@ table Uri { host: string (required); port: ushort; path: string (required); - query: [KeyValue]; + query: [org.apache.arrow.flatbuf.KeyValue]; fragment: string; } @@ -49,13 +48,13 @@ table Partitioning { flavor: string (required); /// Fields on which data is partitioned - schema: Schema (required); + schema: org.apache.arrow.flatbuf.Schema (required); } table FileFormat { /// E.g. "parquet", "csv", ... name: string (required); - options: Buffer; + options: org.apache.arrow.flatbuf.Buffer; } /// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions diff --git a/format/experimental/computeir/Expression.fbs b/format/experimental/computeir/Expression.fbs new file mode 100644 index 0000000000000..f882051894a19 --- /dev/null +++ b/format/experimental/computeir/Expression.fbs @@ -0,0 +1,351 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +include "../../Schema.fbs"; +include "Literal.fbs"; +include "InlineBuffer.fbs"; + +namespace org.apache.arrow.computeir.flatbuf; + +/// Access a value for a given map key +table MapKey { + key: string (required); +} + +/// Struct field access +table StructField { + /// The position of the field in the struct schema + position: uint32; +} + +/// Zero-based array index +table ArraySubscript { + position: uint32; +} + +/// Zero-based range of elements in an array +table ArraySlice { + /// The start of an array slice, inclusive + start_inclusive: uint32; + /// The end of an array slice, exclusive + end_exclusive: uint32; +} + +/// Field name in a relation +table FieldName { + position: uint32; +} + +/// A union of possible dereference operations +union Deref { + /// Access a value for a given map key + MapKey, + /// Access the value at a struct field + StructField, + /// Access the element at a given index in an array + ArraySubscript, + /// Access a range of elements in an array + ArraySlice, + /// Access a field of a relation + FieldName, +} + +/// Access the data of a field +table FieldRef { + /// A sequence of field names to allow referencing potentially nested fields + ref: Deref (required); + /// For Expressions which might reference fields in multiple Relations, + /// this index may be provided to indicate which Relation's fields + /// `path` points into. For example in the case of a join, + /// 0 refers to the left relation and 1 to the right relation. + relation_index: int; +} + +/// A canonical (probably SQL equivalent) function +// +// TODO: variadics +enum CanonicalFunctionId : uint32 { + // logical + And, + Not, + Or, + + // arithmetic + Add, + Subtract, + Multiply, + Divide, + Power, + AbsoluteValue, + Negate, + Sign, + + // date/time/timestamp operations + DateSub, + DateAdd, + DateDiff, + TimeAdd, + TimeSub, + TimeDiff, + TimestampAdd, + TimestampSub, + TimestampDiff, + + // comparison + Equals, + NotEquals, + Greater, + GreaterEqual, + Less, + LessEqual, +} + +table CanonicalFunction { + id: CanonicalFunctionId; +} + +table NonCanonicalFunction { + name_space: string; + name: string (required); +} + +union FunctionImpl { + CanonicalFunction, + NonCanonicalFunction, +} + +/// A function call expression +table Call { + /// The kind of function call this is. + kind: FunctionImpl (required); + + /// The arguments passed to `function_name`. + arguments: [Expression] (required); + + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + metadata: InlineBuffer; +} + +/// A single WHEN x THEN y fragment. +table CaseFragment { + when: Expression (required); + then: Expression (required); +} + +/// Case statement-style expression. +table Case { + cases: [CaseFragment] (required); + /// The default value if no cases match. This is typically NULL in SQL + //implementations. + /// + /// Defaulting to NULL is a frontend choice, so producers must specify NULL + /// if that's their desired behavior. + default: Expression (required); + + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + metadata: InlineBuffer; +} + +table Cast { + /// The expression to cast + expression: Expression (required); + + /// The type to cast `argument` to. + type: org.apache.arrow.flatbuf.Field (required); + + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + metadata: InlineBuffer; +} + +table Extract { + /// Expression from which to extract components. + expression: Expression (required); + + /// Field to extract from `expression`. + field: string (required); + + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + metadata: InlineBuffer; +} + +/// Whether lesser values should precede greater or vice versa, +/// also whether nulls should preced or follow values. +enum Ordering : uint8 { + ASCENDING_THEN_NULLS, + DESCENDING_THEN_NULLS, + NULLS_THEN_ASCENDING, + NULLS_THEN_DESCENDING +} + +/// An expression with an order +table SortKey { + expression: Expression (required); + ordering: Ordering = ASCENDING_THEN_NULLS; +} + +/// Boundary is unbounded +table Unbounded {} + +union ConcreteBoundImpl { + Expression, + Unbounded, +} + +/// Boundary is preceding rows, determined by the contained expression +table Preceding { + ipml: ConcreteBoundImpl (required); +} + +/// Boundary is following rows, determined by the contained expression +table Following { + impl: ConcreteBoundImpl (required); +} + +/// Boundary is the current row +table CurrentRow {} + +union BoundImpl { + Preceding, + Following, + CurrentRow, +} + +/// Boundary of a window +table Bound { + impl: BoundImpl (required); +} + +/// The kind of window function to be executed. +enum Frame : uint8 { + Rows, + Range, +} + +/// An expression representing a window function call. +table WindowCall { + /// The kind of window frame + kind: Frame; + /// The expression to operate over + expression: Expression (required); + /// Partition keys + partitions: [Expression] (required); + /// Sort keys + orderings: [SortKey] (required); + /// Lower window bound + lower_bound: Bound (required); + /// Upper window bound + upper_bound: Bound (required); +} + +/// A canonical (probably SQL equivalent) function +enum CanonicalAggregateId : uint32 { + All, + Any, + Count, + CountTable, + Mean, + Min, + Max, + Product, + Sum, + Variance, + StandardDev, +} + + +table CanonicalAggregate { + id: CanonicalAggregateId; +} + +table NonCanonicalAggregate { + name_space: string; + name: string (required); +} + +union AggregateImpl { + CanonicalAggregate, + NonCanonicalAggregate, +} + +table AggregateCall { + /// The kind of aggregate function being executed + kind: AggregateImpl (required); + + /// Aggregate expression arguments + arguments: [Expression] (required); + + /// Possible ordering. + orderings: [SortKey]; + + /// optional per-aggregate filtering + predicate: Expression; +} + +/// An expression is one of +/// - a Literal datum +/// - a reference to a field from a Relation +/// - a call to a named function +/// - a case expression +/// - a cast expression +/// - an extract operation +/// - a window function call +/// - an aggregate function call +/// +/// The expressions here that look like function calls such as +/// Cast,Case and Extract are special in that while they might +/// fit into a Call, they don't cleanly do so without having +/// to pass around non-expression arguments as metadata. +/// +/// AggregateCall and WindowCall are also separate variants +/// due to special options for each that don't apply to generic +/// function calls. Again this is done to make it easier +/// for consumers to deal with the structure of the operation +union ExpressionImpl { + Literal, + FieldRef, + Call, + Case, + Cast, + Extract, + WindowCall, + AggregateCall, +} + +/// Expression types +/// +/// Expressions have a concrete `impl` value, which is a specific operation +/// They also have a `type` field, which is the output type of the expression, +/// regardless of operation type. +/// +/// The only exception so far is Cast, which has a type as input argument, which +/// is equal to output type. +table Expression { + impl: ExpressionImpl (required); + + /// The type of the expression. + /// + /// This is a field, because the Type union in Schema.fbs + /// isn't self-contained: Fields are necessary to describe complex types + /// and there's currently no reason to optimize the storage of this. + type: org.apache.arrow.flatbuf.Field; +} + +root_type Expression; diff --git a/format/experimental/computeir/InlineBuffer.fbs b/format/experimental/computeir/InlineBuffer.fbs new file mode 100644 index 0000000000000..a27968a779e41 --- /dev/null +++ b/format/experimental/computeir/InlineBuffer.fbs @@ -0,0 +1,56 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +namespace org.apache.arrow.computeir.flatbuf; + +table Int8Buffer { items: [uint8] (required); } +table Int16Buffer { items: [uint16] (required); } +table Int32Buffer { items: [uint32] (required); } +table Int64Buffer { items: [uint64] (required); } +table UInt8Buffer { items: [uint8] (required); } +table UInt16Buffer { items: [uint16] (required); } +table UInt32Buffer { items: [uint32] (required); } +table UInt64Buffer { items: [uint64] (required); } +table Float32Buffer { items: [float32] (required); } +table Float64Buffer { items: [float64] (required); } +table TableBuffer { items: [ubyte] (required, nested_flatbuffer: "InlineBuffer"); } +union InlineBufferImpl { + Int8Buffer, + Int16Buffer, + Int32Buffer, + Int64Buffer, + UInt8Buffer, + UInt16Buffer, + UInt32Buffer, + UInt64Buffer, + Float32Buffer, + Float64Buffer, + TableBuffer, +} + +/// An inline replacement for org.apache.arrow.Buffer because that +/// requires a sidecar block of bytes into which offsets can point. +/// A union of buffers of each primitive type is provided to avoid +/// the need for reinterpret_cast, std::mem::transmute, ... +/// The final member of the union is a bytes buffer aligned suitably +/// to hold any flatbuffer Table. +table InlineBuffer { + // Ideally we'd simply have `union InlineBuffer { ... }` + // but not all generators support vectors of unions so we provide minimal + // indirection to support them. + impl: InlineBufferImpl (required); +} diff --git a/format/experimental/computeir/Literal.fbs b/format/experimental/computeir/Literal.fbs new file mode 100644 index 0000000000000..79c475788d304 --- /dev/null +++ b/format/experimental/computeir/Literal.fbs @@ -0,0 +1,177 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +namespace org.apache.arrow.computeir.flatbuf; + +table ArrayLiteral { + values: [Literal]; +} + +table StructLiteral { + values: [KeyValue]; +} + +table KeyValue { + key: string; + value: Literal; +} + +table MapLiteral { + values: [KeyValue]; +} + +table Int8Literal { + value: int8; +} + +table Int16Literal { + value: int16; +} + +table Int32Literal { + value: int32; +} + +table Int64Literal { + value: int64; +} + +table UInt8Literal { + value: uint8; +} + +table UInt16Literal { + value: uint16; +} + +table UInt32Literal { + value: uint32; +} + +table UInt64Literal { + value: uint64; +} + +table Float16Literal { + value: uint16; +} + +table Float32Literal { + value: float32; +} + +table Float64Literal { + value: float64; +} + +table DecimalLiteral { + value: [uint8]; // 128 bit value. + scale: uint8; + precision: uint8; +} + +table BooleanLiteral { + value: bool; +} + +table NullLiteral {} + +table DateLiteral { + // milliseconds since epoch + value: int64; +} + +table TimeLiteral { + // nanosecond time value. + value: int64; +} + +table TimestampLiteral { + // microsecond timestamp. + value: int64; + + // timezone value, same definition as used in Schema.fbs. + timezone: string; +} + +table IntervalLiteralMonths { + months: int32; +} + +table IntervalLiteralDaysMilliseconds { + days: int32; + milliseconds: int32; +} + +union IntervalLiteralImpl { + IntervalLiteralMonths, + IntervalLiteralDaysMilliseconds, +} + +table IntervalLiteral { + value: IntervalLiteralImpl; +} + +table BinaryLiteral { + value: [byte]; +} + +table StringLiteral { + value: string; +} + +// no union literal is defined as only one branch of a union can be resolved. +// no literals for large string/binary types as flatbuffer is limited to 2gb. + +union LiteralImpl { + NullLiteral, + BooleanLiteral, + + Int8Literal, + Int16Literal, + Int32Literal, + Int64Literal, + + UInt8Literal, + UInt16Literal, + UInt32Literal, + UInt64Literal, + + DateLiteral, + TimeLiteral, + TimestampLiteral, + IntervalLiteral, + + DecimalLiteral, + + Float16Literal, + Float32Literal, + Float64Literal, + + ArrayLiteral, + StructLiteral, + MapLiteral, + + StringLiteral, + BinaryLiteral, +} + +table Literal { + impl: LiteralImpl (required); +} + +root_type Literal; diff --git a/format/experimental/computeir/Plan.fbs b/format/experimental/computeir/Plan.fbs new file mode 100644 index 0000000000000..52f8823d32d91 --- /dev/null +++ b/format/experimental/computeir/Plan.fbs @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +include "Relation.fbs"; + +namespace org.apache.arrow.computeir.flatbuf; + +/// A specification of a query. +table Plan { + /// One or more output relations. + sinks: [Relation] (required); + + /// If this Plan was derived from another (for example by running + /// an optimization pass), that plan may be included here to + /// provide a backtrace of derivations. + derived_from: Plan; +} + +root_type Plan; diff --git a/format/experimental/computeir/Relation.fbs b/format/experimental/computeir/Relation.fbs new file mode 100644 index 0000000000000..541fd702d64f3 --- /dev/null +++ b/format/experimental/computeir/Relation.fbs @@ -0,0 +1,224 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +include "../../Schema.fbs"; +include "Literal.fbs"; +include "Expression.fbs"; +include "InlineBuffer.fbs"; + +namespace org.apache.arrow.computeir.flatbuf; + +/// A data type indicating a different mapping of columns +/// should occur in the output. +/// +/// For example: +/// +/// Given a query `SELECT a, b FROM t` where `t` has columns a, b, c +/// the mapping value for the projection would equal [0, 1]. +table Remap { + mapping: [uint32] (required); +} + +// Pass through indicates that no output remapping should occur. +table PassThrough {} + +/// A union for the different colum remapping variants +union Emit { + Remap, + PassThrough, +} + +/// Fields common to every relational operator +table RelBase { + /// The arguments passed to `operation`. + arguments: [Relation] (required); + + /// Output remapping of ordinals for a given operation + output_mapping: Emit (required); + + /// Arguments for custom operations + options: InlineBuffer; +} + +/// Filter operation +table Filter { + base: RelBase (required); + /// The expression which will be evaluated against input rows + /// to determine whether they should be excluded from the + /// filter relation's output. + predicate: Expression (required); +} + +/// Projection +table Project { + base: RelBase (required); + /// Expressions which will be evaluated to produce to + /// the rows of the project relation's output. + expressions: [Expression] (required); +} + +/// Aggregate operation +table Aggregate { + base: RelBase (required); + /// Expressions which will be evaluated to produce to + /// the rows of the aggregate relation's output. + aggregations: [Expression] (required); + /// Keys by which `aggregations` will be grouped. + keys: [Expression] (required); +} + +enum CanonicalJoinKindId : uint8 { + Anti, + Cross, + FullOuter, + Inner, + LeftOuter, + LeftSemi, + RightOuter, + // TODO: Window + // TODO: AsOf +} + +table CanonicalJoinKind { + id: CanonicalJoinKindId; +} + +table NonCanonicalJoinKind { + name_space: string; + name: string (required); +} + +union JoinKind { + CanonicalJoinKind, + NonCanonicalJoinKind, +} + +/// The contents of Relation.options will be JoinOptions +/// if Relation.operation = CanonicalOperation::Join +table Join { + base: RelBase (required); + /// The expression which will be evaluated against rows from each + /// input to determine whether they should be included in the + /// join relation's output. + on_expression: Expression (required); + /// The kind of join to use. + join_kind: JoinKind (required); +} + +/// Order by relation +table OrderBy { + base: RelBase (required); + /// Define sort order for rows of output. + /// Keys with higher precedence are ordered ahead of other keys. + keys: [SortKey] (required); +} + +/// Limit operation +table Limit { + base: RelBase (required); + /// The maximum number of rows of output. + count: long; +} + +/// Common table expresssion +table Common { + base: RelBase (required); + /// Commons (CTEs in SQL) allow assigning a name to a stream + /// of data and reusing it, potentially multiple times and + /// potentially recursively. + name: string (required); +} + +/// The kind of set operation being performed. +enum CanonicalSetOpKindId : uint8 { + Union, + Intersection, + Difference, +} + +table CanonicalSetOpKind { + id: CanonicalSetOpKindId; +} + +table NonCanonicalSetOpKind { + name_space: string; + name: string (required); +} + +/// The kind of set operation +union SetOpKind { + CanonicalSetOpKind, + NonCanonicalSetOpKind, +} + +/// A set operation on two or more relations +table SetOperation { + base: RelBase (required); + /// The kind of set operation + set_op: SetOpKind (required); +} + +/// Literal relation +table LiteralRelation { + base: RelBase (required); + /// The columns of this literal relation. + columns: [Literal] (required); +} + +/// A user-defined relation. +table Custom { + base: RelBase (required); + /// NB: the schema is optional here, since a custom relation + /// may or may not need it. + schema: org.apache.arrow.flatbuf.Schema; +} + +/// A table read +table Read { + base: RelBase (required); + resource: string (required); + schema: org.apache.arrow.flatbuf.Schema (required); +} + +/// A table write +table Write { + base: RelBase (required); + resource: string (required); + schema: org.apache.arrow.flatbuf.Schema (required); +} + +/// The varieties of relations +union RelationImpl { + Aggregate, + Common, + Custom, + SetOperation, + Filter, + Limit, + LiteralRelation, + OrderBy, + Project, + Read, + Write, +} + +/// A table holding an instance of the possible relation types. +table Relation { + impl: RelationImpl (required); +} + +root_type Relation; From 8d2af019fb31297eae4e49b45e138226d9320017 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:46:00 -0400 Subject: [PATCH 27/96] Add generated compute IR Python code --- python/generated/org/__init__.py | 0 python/generated/org/apache/__init__.py | 0 python/generated/org/apache/arrow/__init__.py | 0 .../org/apache/arrow/computeir/__init__.py | 0 .../arrow/computeir/flatbuf/Aggregate.py | 94 ++++++++++++ .../arrow/computeir/flatbuf/AggregateCall.py | 113 +++++++++++++++ .../arrow/computeir/flatbuf/AggregateImpl.py | 9 ++ .../arrow/computeir/flatbuf/ArrayLiteral.py | 51 +++++++ .../arrow/computeir/flatbuf/ArraySlice.py | 43 ++++++ .../arrow/computeir/flatbuf/ArraySubscript.py | 33 +++++ .../arrow/computeir/flatbuf/BinaryLiteral.py | 53 +++++++ .../arrow/computeir/flatbuf/BooleanLiteral.py | 32 +++++ .../apache/arrow/computeir/flatbuf/Bound.py | 44 ++++++ .../arrow/computeir/flatbuf/BoundImpl.py | 10 ++ .../apache/arrow/computeir/flatbuf/Call.py | 87 +++++++++++ .../computeir/flatbuf/CanonicalAggregate.py | 32 +++++ .../computeir/flatbuf/CanonicalAggregateId.py | 18 +++ .../computeir/flatbuf/CanonicalFunction.py | 32 +++++ .../computeir/flatbuf/CanonicalFunctionId.py | 33 +++++ .../computeir/flatbuf/CanonicalJoinKind.py | 32 +++++ .../computeir/flatbuf/CanonicalJoinKindId.py | 13 ++ .../computeir/flatbuf/CanonicalSetOpKind.py | 32 +++++ .../computeir/flatbuf/CanonicalSetOpKindId.py | 10 ++ .../apache/arrow/computeir/flatbuf/Case.py | 82 +++++++++++ .../arrow/computeir/flatbuf/CaseFragment.py | 49 +++++++ .../apache/arrow/computeir/flatbuf/Cast.py | 64 +++++++++ .../apache/arrow/computeir/flatbuf/Common.py | 48 +++++++ .../computeir/flatbuf/ConcreteBoundImpl.py | 9 ++ .../arrow/computeir/flatbuf/CurrentRow.py | 25 ++++ .../apache/arrow/computeir/flatbuf/Custom.py | 51 +++++++ .../arrow/computeir/flatbuf/DateLiteral.py | 32 +++++ .../arrow/computeir/flatbuf/DecimalLiteral.py | 69 +++++++++ .../apache/arrow/computeir/flatbuf/Deref.py | 18 +++ .../apache/arrow/computeir/flatbuf/Emit.py | 10 ++ .../arrow/computeir/flatbuf/Expression.py | 68 +++++++++ .../arrow/computeir/flatbuf/ExpressionImpl.py | 34 +++++ .../apache/arrow/computeir/flatbuf/Extract.py | 60 ++++++++ .../arrow/computeir/flatbuf/FieldName.py | 33 +++++ .../arrow/computeir/flatbuf/FieldRef.py | 57 ++++++++ .../apache/arrow/computeir/flatbuf/Filter.py | 52 +++++++ .../arrow/computeir/flatbuf/Float16Literal.py | 32 +++++ .../arrow/computeir/flatbuf/Float32Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/Float32Literal.py | 32 +++++ .../arrow/computeir/flatbuf/Float64Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/Float64Literal.py | 32 +++++ .../arrow/computeir/flatbuf/Following.py | 44 ++++++ .../apache/arrow/computeir/flatbuf/Frame.py | 9 ++ .../arrow/computeir/flatbuf/FunctionImpl.py | 9 ++ .../arrow/computeir/flatbuf/InlineBuffer.py | 49 +++++++ .../computeir/flatbuf/InlineBufferImpl.py | 18 +++ .../arrow/computeir/flatbuf/Int16Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/Int16Literal.py | 32 +++++ .../arrow/computeir/flatbuf/Int32Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/Int32Literal.py | 32 +++++ .../arrow/computeir/flatbuf/Int64Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/Int64Literal.py | 32 +++++ .../arrow/computeir/flatbuf/Int8Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/Int8Literal.py | 32 +++++ .../computeir/flatbuf/IntervalLiteral.py | 43 ++++++ .../IntervalLiteralDaysMilliseconds.py | 40 ++++++ .../computeir/flatbuf/IntervalLiteralImpl.py | 9 ++ .../flatbuf/IntervalLiteralMonths.py | 32 +++++ .../apache/arrow/computeir/flatbuf/Join.py | 73 ++++++++++ .../arrow/computeir/flatbuf/JoinKind.py | 9 ++ .../arrow/computeir/flatbuf/KeyValue.py | 44 ++++++ .../apache/arrow/computeir/flatbuf/Limit.py | 46 ++++++ .../apache/arrow/computeir/flatbuf/Literal.py | 43 ++++++ .../arrow/computeir/flatbuf/LiteralImpl.py | 30 ++++ .../computeir/flatbuf/LiteralRelation.py | 65 +++++++++ .../apache/arrow/computeir/flatbuf/MapKey.py | 33 +++++ .../arrow/computeir/flatbuf/MapLiteral.py | 51 +++++++ .../flatbuf/NonCanonicalAggregate.py | 40 ++++++ .../computeir/flatbuf/NonCanonicalFunction.py | 40 ++++++ .../computeir/flatbuf/NonCanonicalJoinKind.py | 40 ++++++ .../flatbuf/NonCanonicalSetOpKind.py | 40 ++++++ .../arrow/computeir/flatbuf/NullLiteral.py | 24 ++++ .../apache/arrow/computeir/flatbuf/OrderBy.py | 66 +++++++++ .../arrow/computeir/flatbuf/Ordering.py | 12 ++ .../arrow/computeir/flatbuf/PassThrough.py | 24 ++++ .../apache/arrow/computeir/flatbuf/Plan.py | 68 +++++++++ .../arrow/computeir/flatbuf/Preceding.py | 44 ++++++ .../apache/arrow/computeir/flatbuf/Project.py | 66 +++++++++ .../apache/arrow/computeir/flatbuf/Read.py | 57 ++++++++ .../apache/arrow/computeir/flatbuf/RelBase.py | 86 +++++++++++ .../arrow/computeir/flatbuf/Relation.py | 44 ++++++ .../arrow/computeir/flatbuf/RelationImpl.py | 19 +++ .../apache/arrow/computeir/flatbuf/Remap.py | 60 ++++++++ .../arrow/computeir/flatbuf/SetOpKind.py | 10 ++ .../arrow/computeir/flatbuf/SetOperation.py | 57 ++++++++ .../apache/arrow/computeir/flatbuf/SortKey.py | 45 ++++++ .../arrow/computeir/flatbuf/StringLiteral.py | 32 +++++ .../arrow/computeir/flatbuf/StructField.py | 34 +++++ .../arrow/computeir/flatbuf/StructLiteral.py | 51 +++++++ .../arrow/computeir/flatbuf/TableBuffer.py | 53 +++++++ .../arrow/computeir/flatbuf/TimeLiteral.py | 32 +++++ .../computeir/flatbuf/TimestampLiteral.py | 40 ++++++ .../arrow/computeir/flatbuf/UInt16Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/UInt16Literal.py | 32 +++++ .../arrow/computeir/flatbuf/UInt32Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/UInt32Literal.py | 32 +++++ .../arrow/computeir/flatbuf/UInt64Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/UInt64Literal.py | 32 +++++ .../arrow/computeir/flatbuf/UInt8Buffer.py | 53 +++++++ .../arrow/computeir/flatbuf/UInt8Literal.py | 32 +++++ .../arrow/computeir/flatbuf/Unbounded.py | 25 ++++ .../arrow/computeir/flatbuf/WindowCall.py | 129 +++++++++++++++++ .../apache/arrow/computeir/flatbuf/Write.py | 57 ++++++++ .../arrow/computeir/flatbuf/__init__.py | 0 .../ext/Arrow_FileSystemDatasetScanOptions.py | 70 +++++++++ .../Arrow_FileSystemDatasetWriteOptions.py | 81 +++++++++++ .../flatbuf/ext/Arrow_StreamOutOptions.py | 42 ++++++ .../arrow/computeir/flatbuf/ext/FileFormat.py | 45 ++++++ .../computeir/flatbuf/ext/Partitioning.py | 46 ++++++ .../computeir/flatbuf/ext/Sql_FromOptions.py | 38 +++++ .../computeir/flatbuf/ext/Sql_IntoOptions.py | 50 +++++++ .../apache/arrow/computeir/flatbuf/ext/Uri.py | 100 +++++++++++++ .../arrow/computeir/flatbuf/ext/__init__.py | 0 .../org/apache/arrow/flatbuf/Binary.py | 25 ++++ .../org/apache/arrow/flatbuf/Bool.py | 24 ++++ .../org/apache/arrow/flatbuf/Buffer.py | 34 +++++ .../org/apache/arrow/flatbuf/Date.py | 38 +++++ .../org/apache/arrow/flatbuf/DateUnit.py | 8 ++ .../org/apache/arrow/flatbuf/Decimal.py | 56 ++++++++ .../arrow/flatbuf/DictionaryEncoding.py | 72 ++++++++++ .../apache/arrow/flatbuf/DictionaryKind.py | 12 ++ .../org/apache/arrow/flatbuf/Duration.py | 32 +++++ .../org/apache/arrow/flatbuf/Endianness.py | 10 ++ .../org/apache/arrow/flatbuf/Feature.py | 32 +++++ .../org/apache/arrow/flatbuf/Field.py | 135 ++++++++++++++++++ .../apache/arrow/flatbuf/FixedSizeBinary.py | 33 +++++ .../org/apache/arrow/flatbuf/FixedSizeList.py | 33 +++++ .../org/apache/arrow/flatbuf/FloatingPoint.py | 32 +++++ .../generated/org/apache/arrow/flatbuf/Int.py | 40 ++++++ .../org/apache/arrow/flatbuf/Interval.py | 32 +++++ .../org/apache/arrow/flatbuf/IntervalUnit.py | 8 ++ .../org/apache/arrow/flatbuf/KeyValue.py | 43 ++++++ .../org/apache/arrow/flatbuf/LargeBinary.py | 26 ++++ .../org/apache/arrow/flatbuf/LargeList.py | 26 ++++ .../org/apache/arrow/flatbuf/LargeUtf8.py | 26 ++++ .../org/apache/arrow/flatbuf/List.py | 24 ++++ .../generated/org/apache/arrow/flatbuf/Map.py | 58 ++++++++ .../apache/arrow/flatbuf/MetadataVersion.py | 22 +++ .../org/apache/arrow/flatbuf/Null.py | 25 ++++ .../org/apache/arrow/flatbuf/Precision.py | 9 ++ .../org/apache/arrow/flatbuf/Schema.py | 121 ++++++++++++++++ .../org/apache/arrow/flatbuf/Struct_.py | 27 ++++ .../org/apache/arrow/flatbuf/Time.py | 43 ++++++ .../org/apache/arrow/flatbuf/TimeUnit.py | 10 ++ .../org/apache/arrow/flatbuf/Timestamp.py | 89 ++++++++++++ .../org/apache/arrow/flatbuf/Type.py | 31 ++++ .../org/apache/arrow/flatbuf/Union.py | 65 +++++++++ .../org/apache/arrow/flatbuf/UnionMode.py | 8 ++ .../org/apache/arrow/flatbuf/Utf8.py | 25 ++++ .../org/apache/arrow/flatbuf/__init__.py | 0 154 files changed, 6162 insertions(+) create mode 100644 python/generated/org/__init__.py create mode 100644 python/generated/org/apache/__init__.py create mode 100644 python/generated/org/apache/arrow/__init__.py create mode 100644 python/generated/org/apache/arrow/computeir/__init__.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Bound.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Call.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Case.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Cast.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Common.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Custom.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Deref.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Emit.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Expression.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Extract.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Filter.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Following.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Frame.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Join.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Limit.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Plan.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Project.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Read.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Relation.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Remap.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/StructField.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Write.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/__init__.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py create mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/__init__.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Binary.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Bool.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Buffer.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Date.py create mode 100644 python/generated/org/apache/arrow/flatbuf/DateUnit.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Decimal.py create mode 100644 python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py create mode 100644 python/generated/org/apache/arrow/flatbuf/DictionaryKind.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Duration.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Endianness.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Feature.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Field.py create mode 100644 python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py create mode 100644 python/generated/org/apache/arrow/flatbuf/FixedSizeList.py create mode 100644 python/generated/org/apache/arrow/flatbuf/FloatingPoint.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Int.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Interval.py create mode 100644 python/generated/org/apache/arrow/flatbuf/IntervalUnit.py create mode 100644 python/generated/org/apache/arrow/flatbuf/KeyValue.py create mode 100644 python/generated/org/apache/arrow/flatbuf/LargeBinary.py create mode 100644 python/generated/org/apache/arrow/flatbuf/LargeList.py create mode 100644 python/generated/org/apache/arrow/flatbuf/LargeUtf8.py create mode 100644 python/generated/org/apache/arrow/flatbuf/List.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Map.py create mode 100644 python/generated/org/apache/arrow/flatbuf/MetadataVersion.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Null.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Precision.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Schema.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Struct_.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Time.py create mode 100644 python/generated/org/apache/arrow/flatbuf/TimeUnit.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Timestamp.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Type.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Union.py create mode 100644 python/generated/org/apache/arrow/flatbuf/UnionMode.py create mode 100644 python/generated/org/apache/arrow/flatbuf/Utf8.py create mode 100644 python/generated/org/apache/arrow/flatbuf/__init__.py diff --git a/python/generated/org/__init__.py b/python/generated/org/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/python/generated/org/apache/__init__.py b/python/generated/org/apache/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/python/generated/org/apache/arrow/__init__.py b/python/generated/org/apache/arrow/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/python/generated/org/apache/arrow/computeir/__init__.py b/python/generated/org/apache/arrow/computeir/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py b/python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py new file mode 100644 index 0000000000000..5f77ab6789c02 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py @@ -0,0 +1,94 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Aggregate operation +class Aggregate(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsAggregate(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Aggregate() + x.Init(buf, n + offset) + return x + + # Aggregate + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Aggregate + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Expressions which will be evaluated to produce to + # the rows of the aggregate relation's output. + # Aggregate + def Aggregations(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Aggregate + def AggregationsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Aggregate + def AggregationsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + return o == 0 + + # Keys by which `aggregations` will be grouped. + # Aggregate + def Keys(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Aggregate + def KeysLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Aggregate + def KeysIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + return o == 0 + +def AggregateStart(builder): builder.StartObject(3) +def AggregateAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def AggregateAddAggregations(builder, aggregations): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(aggregations), 0) +def AggregateStartAggregationsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def AggregateAddKeys(builder, keys): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(keys), 0) +def AggregateStartKeysVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def AggregateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py b/python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py new file mode 100644 index 0000000000000..7f47765bce4a5 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py @@ -0,0 +1,113 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class AggregateCall(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsAggregateCall(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = AggregateCall() + x.Init(buf, n + offset) + return x + + # AggregateCall + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # AggregateCall + def KindType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # The kind of aggregate function being executed + # AggregateCall + def Kind(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + + # Aggregate expression arguments + # AggregateCall + def Arguments(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # AggregateCall + def ArgumentsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # AggregateCall + def ArgumentsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + return o == 0 + + # Possible ordering. + # AggregateCall + def Orderings(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.SortKey import SortKey + obj = SortKey() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # AggregateCall + def OrderingsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # AggregateCall + def OrderingsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + return o == 0 + + # optional per-aggregate filtering + # AggregateCall + def Predicate(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def AggregateCallStart(builder): builder.StartObject(5) +def AggregateCallAddKindType(builder, kindType): builder.PrependUint8Slot(0, kindType, 0) +def AggregateCallAddKind(builder, kind): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(kind), 0) +def AggregateCallAddArguments(builder, arguments): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(arguments), 0) +def AggregateCallStartArgumentsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def AggregateCallAddOrderings(builder, orderings): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(orderings), 0) +def AggregateCallStartOrderingsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def AggregateCallAddPredicate(builder, predicate): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(predicate), 0) +def AggregateCallEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py new file mode 100644 index 0000000000000..87220fa083080 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py @@ -0,0 +1,9 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class AggregateImpl(object): + NONE = 0 + CanonicalAggregate = 1 + NonCanonicalAggregate = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py new file mode 100644 index 0000000000000..d7a25e949b04a --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py @@ -0,0 +1,51 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class ArrayLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArrayLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ArrayLiteral() + x.Init(buf, n + offset) + return x + + # ArrayLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # ArrayLiteral + def Values(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Literal import Literal + obj = Literal() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # ArrayLiteral + def ValuesLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # ArrayLiteral + def ValuesIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def ArrayLiteralStart(builder): builder.StartObject(1) +def ArrayLiteralAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0) +def ArrayLiteralStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def ArrayLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py b/python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py new file mode 100644 index 0000000000000..95a0a03fdeec5 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py @@ -0,0 +1,43 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Zero-based range of elements in an array +class ArraySlice(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArraySlice(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ArraySlice() + x.Init(buf, n + offset) + return x + + # ArraySlice + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The start of an array slice, inclusive + # ArraySlice + def StartInclusive(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + + # The end of an array slice, exclusive + # ArraySlice + def EndExclusive(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + +def ArraySliceStart(builder): builder.StartObject(2) +def ArraySliceAddStartInclusive(builder, startInclusive): builder.PrependUint32Slot(0, startInclusive, 0) +def ArraySliceAddEndExclusive(builder, endExclusive): builder.PrependUint32Slot(1, endExclusive, 0) +def ArraySliceEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py b/python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py new file mode 100644 index 0000000000000..7fff316fbdb77 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py @@ -0,0 +1,33 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Zero-based array index +class ArraySubscript(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArraySubscript(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ArraySubscript() + x.Init(buf, n + offset) + return x + + # ArraySubscript + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # ArraySubscript + def Position(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + +def ArraySubscriptStart(builder): builder.StartObject(1) +def ArraySubscriptAddPosition(builder, position): builder.PrependUint32Slot(0, position, 0) +def ArraySubscriptEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py new file mode 100644 index 0000000000000..223892d3931fc --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class BinaryLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsBinaryLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = BinaryLiteral() + x.Init(buf, n + offset) + return x + + # BinaryLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # BinaryLiteral + def Value(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Int8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) + return 0 + + # BinaryLiteral + def ValueAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int8Flags, o) + return 0 + + # BinaryLiteral + def ValueLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # BinaryLiteral + def ValueIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def BinaryLiteralStart(builder): builder.StartObject(1) +def BinaryLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) +def BinaryLiteralStartValueVector(builder, numElems): return builder.StartVector(1, numElems, 1) +def BinaryLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py new file mode 100644 index 0000000000000..4c71170ece1e7 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class BooleanLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsBooleanLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = BooleanLiteral() + x.Init(buf, n + offset) + return x + + # BooleanLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # BooleanLiteral + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) + return False + +def BooleanLiteralStart(builder): builder.StartObject(1) +def BooleanLiteralAddValue(builder, value): builder.PrependBoolSlot(0, value, 0) +def BooleanLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Bound.py b/python/generated/org/apache/arrow/computeir/flatbuf/Bound.py new file mode 100644 index 0000000000000..98998a3035161 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Bound.py @@ -0,0 +1,44 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Boundary of a window +class Bound(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsBound(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Bound() + x.Init(buf, n + offset) + return x + + # Bound + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Bound + def ImplType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # Bound + def Impl(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def BoundStart(builder): builder.StartObject(2) +def BoundAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) +def BoundAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) +def BoundEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py new file mode 100644 index 0000000000000..c21209961c551 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py @@ -0,0 +1,10 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class BoundImpl(object): + NONE = 0 + Preceding = 1 + Following = 2 + CurrentRow = 3 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Call.py b/python/generated/org/apache/arrow/computeir/flatbuf/Call.py new file mode 100644 index 0000000000000..00bbff28c9912 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Call.py @@ -0,0 +1,87 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A function call expression +class Call(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCall(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Call() + x.Init(buf, n + offset) + return x + + # Call + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Call + def KindType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # The kind of function call this is. + # Call + def Kind(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + + # The arguments passed to `function_name`. + # Call + def Arguments(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Call + def ArgumentsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Call + def ArgumentsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + return o == 0 + + # Parameters for `function_name`; content/format may be unique to each + # value of `function_name`. + # Call + def Metadata(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer + obj = InlineBuffer() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def CallStart(builder): builder.StartObject(4) +def CallAddKindType(builder, kindType): builder.PrependUint8Slot(0, kindType, 0) +def CallAddKind(builder, kind): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(kind), 0) +def CallAddArguments(builder, arguments): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(arguments), 0) +def CallStartArgumentsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def CallAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) +def CallEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py new file mode 100644 index 0000000000000..b1470a6e569bc --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class CanonicalAggregate(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCanonicalAggregate(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = CanonicalAggregate() + x.Init(buf, n + offset) + return x + + # CanonicalAggregate + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # CanonicalAggregate + def Id(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + +def CanonicalAggregateStart(builder): builder.StartObject(1) +def CanonicalAggregateAddId(builder, id): builder.PrependUint32Slot(0, id, 0) +def CanonicalAggregateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py new file mode 100644 index 0000000000000..c0ff31c5db288 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py @@ -0,0 +1,18 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# A canonical (probably SQL equivalent) function +class CanonicalAggregateId(object): + All = 0 + Any = 1 + Count = 2 + CountTable = 3 + Mean = 4 + Min = 5 + Max = 6 + Product = 7 + Sum = 8 + Variance = 9 + StandardDev = 10 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py new file mode 100644 index 0000000000000..8f6b4ccae8609 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class CanonicalFunction(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCanonicalFunction(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = CanonicalFunction() + x.Init(buf, n + offset) + return x + + # CanonicalFunction + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # CanonicalFunction + def Id(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + +def CanonicalFunctionStart(builder): builder.StartObject(1) +def CanonicalFunctionAddId(builder, id): builder.PrependUint32Slot(0, id, 0) +def CanonicalFunctionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py new file mode 100644 index 0000000000000..6c630f37980cd --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py @@ -0,0 +1,33 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# A canonical (probably SQL equivalent) function +class CanonicalFunctionId(object): + And = 0 + Not = 1 + Or = 2 + Add = 3 + Subtract = 4 + Multiply = 5 + Divide = 6 + Power = 7 + AbsoluteValue = 8 + Negate = 9 + Sign = 10 + DateSub = 11 + DateAdd = 12 + DateDiff = 13 + TimeAdd = 14 + TimeSub = 15 + TimeDiff = 16 + TimestampAdd = 17 + TimestampSub = 18 + TimestampDiff = 19 + Equals = 20 + NotEquals = 21 + Greater = 22 + GreaterEqual = 23 + Less = 24 + LessEqual = 25 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py new file mode 100644 index 0000000000000..fa44dbe9c2a60 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class CanonicalJoinKind(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCanonicalJoinKind(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = CanonicalJoinKind() + x.Init(buf, n + offset) + return x + + # CanonicalJoinKind + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # CanonicalJoinKind + def Id(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + +def CanonicalJoinKindStart(builder): builder.StartObject(1) +def CanonicalJoinKindAddId(builder, id): builder.PrependUint8Slot(0, id, 0) +def CanonicalJoinKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py new file mode 100644 index 0000000000000..7bf1d2b180d48 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py @@ -0,0 +1,13 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class CanonicalJoinKindId(object): + Anti = 0 + Cross = 1 + FullOuter = 2 + Inner = 3 + LeftOuter = 4 + LeftSemi = 5 + RightOuter = 6 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py new file mode 100644 index 0000000000000..da99170a8e9b1 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class CanonicalSetOpKind(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCanonicalSetOpKind(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = CanonicalSetOpKind() + x.Init(buf, n + offset) + return x + + # CanonicalSetOpKind + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # CanonicalSetOpKind + def Id(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + +def CanonicalSetOpKindStart(builder): builder.StartObject(1) +def CanonicalSetOpKindAddId(builder, id): builder.PrependUint8Slot(0, id, 0) +def CanonicalSetOpKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py new file mode 100644 index 0000000000000..ebd3cba562492 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py @@ -0,0 +1,10 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# The kind of set operation being performed. +class CanonicalSetOpKindId(object): + Union = 0 + Intersection = 1 + Difference = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Case.py b/python/generated/org/apache/arrow/computeir/flatbuf/Case.py new file mode 100644 index 0000000000000..bcf258c2115bf --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Case.py @@ -0,0 +1,82 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Case statement-style expression. +class Case(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCase(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Case() + x.Init(buf, n + offset) + return x + + # Case + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Case + def Cases(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.CaseFragment import CaseFragment + obj = CaseFragment() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Case + def CasesLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Case + def CasesIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + + # The default value if no cases match. This is typically NULL in SQL + # + # Defaulting to NULL is a frontend choice, so producers must specify NULL + # if that's their desired behavior. + # Case + def Default(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Parameters for `function_name`; content/format may be unique to each + # value of `function_name`. + # Case + def Metadata(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer + obj = InlineBuffer() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def CaseStart(builder): builder.StartObject(3) +def CaseAddCases(builder, cases): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(cases), 0) +def CaseStartCasesVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def CaseAddDefault(builder, default): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(default), 0) +def CaseAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) +def CaseEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py b/python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py new file mode 100644 index 0000000000000..346e6ac08cdde --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py @@ -0,0 +1,49 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A single WHEN x THEN y fragment. +class CaseFragment(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCaseFragment(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = CaseFragment() + x.Init(buf, n + offset) + return x + + # CaseFragment + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # CaseFragment + def When(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # CaseFragment + def Then(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def CaseFragmentStart(builder): builder.StartObject(2) +def CaseFragmentAddWhen(builder, when): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(when), 0) +def CaseFragmentAddThen(builder, then): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(then), 0) +def CaseFragmentEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Cast.py b/python/generated/org/apache/arrow/computeir/flatbuf/Cast.py new file mode 100644 index 0000000000000..2d744878ce096 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Cast.py @@ -0,0 +1,64 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Cast(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCast(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Cast() + x.Init(buf, n + offset) + return x + + # Cast + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The expression to cast + # Cast + def Expression(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # The type to cast `argument` to. + # Cast + def Type(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.Field import Field + obj = Field() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Parameters for `function_name`; content/format may be unique to each + # value of `function_name`. + # Cast + def Metadata(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer + obj = InlineBuffer() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def CastStart(builder): builder.StartObject(3) +def CastAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) +def CastAddType(builder, type): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(type), 0) +def CastAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) +def CastEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Common.py b/python/generated/org/apache/arrow/computeir/flatbuf/Common.py new file mode 100644 index 0000000000000..3ece357762008 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Common.py @@ -0,0 +1,48 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Common table expresssion +class Common(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCommon(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Common() + x.Init(buf, n + offset) + return x + + # Common + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Common + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Commons (CTEs in SQL) allow assigning a name to a stream + # of data and reusing it, potentially multiple times and + # potentially recursively. + # Common + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def CommonStart(builder): builder.StartObject(2) +def CommonAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def CommonAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def CommonEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py new file mode 100644 index 0000000000000..f551b0e070787 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py @@ -0,0 +1,9 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class ConcreteBoundImpl(object): + NONE = 0 + Expression = 1 + Unbounded = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py b/python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py new file mode 100644 index 0000000000000..999c88c1f0e46 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py @@ -0,0 +1,25 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Boundary is the current row +class CurrentRow(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCurrentRow(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = CurrentRow() + x.Init(buf, n + offset) + return x + + # CurrentRow + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def CurrentRowStart(builder): builder.StartObject(0) +def CurrentRowEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Custom.py b/python/generated/org/apache/arrow/computeir/flatbuf/Custom.py new file mode 100644 index 0000000000000..377dd6e3d5224 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Custom.py @@ -0,0 +1,51 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A user-defined relation. +class Custom(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsCustom(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Custom() + x.Init(buf, n + offset) + return x + + # Custom + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Custom + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # NB: the schema is optional here, since a custom relation + # may or may not need it. + # Custom + def Schema(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.Schema import Schema + obj = Schema() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def CustomStart(builder): builder.StartObject(2) +def CustomAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def CustomAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) +def CustomEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py new file mode 100644 index 0000000000000..c82060aaadddf --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class DateLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsDateLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = DateLiteral() + x.Init(buf, n + offset) + return x + + # DateLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # DateLiteral + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) + return 0 + +def DateLiteralStart(builder): builder.StartObject(1) +def DateLiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) +def DateLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py new file mode 100644 index 0000000000000..1cfda7e418751 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py @@ -0,0 +1,69 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class DecimalLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsDecimalLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = DecimalLiteral() + x.Init(buf, n + offset) + return x + + # DecimalLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # DecimalLiteral + def Value(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) + return 0 + + # DecimalLiteral + def ValueAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) + return 0 + + # DecimalLiteral + def ValueLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # DecimalLiteral + def ValueIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + + # DecimalLiteral + def Scale(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # DecimalLiteral + def Precision(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + +def DecimalLiteralStart(builder): builder.StartObject(3) +def DecimalLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) +def DecimalLiteralStartValueVector(builder, numElems): return builder.StartVector(1, numElems, 1) +def DecimalLiteralAddScale(builder, scale): builder.PrependUint8Slot(1, scale, 0) +def DecimalLiteralAddPrecision(builder, precision): builder.PrependUint8Slot(2, precision, 0) +def DecimalLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Deref.py b/python/generated/org/apache/arrow/computeir/flatbuf/Deref.py new file mode 100644 index 0000000000000..45cabb1f2e5b8 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Deref.py @@ -0,0 +1,18 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# A union of possible dereference operations +class Deref(object): + NONE = 0 + # Access a value for a given map key + MapKey = 1 + # Access the value at a struct field + StructField = 2 + # Access the element at a given index in an array + ArraySubscript = 3 + # Access a range of elements in an array + ArraySlice = 4 + # Access a field of a relation + FieldName = 5 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Emit.py b/python/generated/org/apache/arrow/computeir/flatbuf/Emit.py new file mode 100644 index 0000000000000..99a317d26f1a1 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Emit.py @@ -0,0 +1,10 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# A union for the different colum remapping variants +class Emit(object): + NONE = 0 + Remap = 1 + PassThrough = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Expression.py b/python/generated/org/apache/arrow/computeir/flatbuf/Expression.py new file mode 100644 index 0000000000000..b1e494b3ef571 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Expression.py @@ -0,0 +1,68 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Expression types +# +# Expressions have a concrete `impl` value, which is a specific operation +# They also have a `type` field, which is the output type of the expression, +# regardless of operation type. +# +# The only exception so far is Cast, which has a type as input argument, which +# is equal to output type. +class Expression(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsExpression(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Expression() + x.Init(buf, n + offset) + return x + + # Expression + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Expression + def ImplType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # Expression + def Impl(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + + # The type of the expression. + # + # This is a field, because the Type union in Schema.fbs + # isn't self-contained: Fields are necessary to describe complex types + # and there's currently no reason to optimize the storage of this. + # Expression + def Type(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.Field import Field + obj = Field() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def ExpressionStart(builder): builder.StartObject(3) +def ExpressionAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) +def ExpressionAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) +def ExpressionAddType(builder, type): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(type), 0) +def ExpressionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py new file mode 100644 index 0000000000000..c5e0cfaabe1b3 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py @@ -0,0 +1,34 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# An expression is one of +# - a Literal datum +# - a reference to a field from a Relation +# - a call to a named function +# - a case expression +# - a cast expression +# - an extract operation +# - a window function call +# - an aggregate function call +# +# The expressions here that look like function calls such as +# Cast,Case and Extract are special in that while they might +# fit into a Call, they don't cleanly do so without having +# to pass around non-expression arguments as metadata. +# +# AggregateCall and WindowCall are also separate variants +# due to special options for each that don't apply to generic +# function calls. Again this is done to make it easier +# for consumers to deal with the structure of the operation +class ExpressionImpl(object): + NONE = 0 + Literal = 1 + FieldRef = 2 + Call = 3 + Case = 4 + Cast = 5 + Extract = 6 + WindowCall = 7 + AggregateCall = 8 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Extract.py b/python/generated/org/apache/arrow/computeir/flatbuf/Extract.py new file mode 100644 index 0000000000000..e69d7799c9b55 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Extract.py @@ -0,0 +1,60 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Extract(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsExtract(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Extract() + x.Init(buf, n + offset) + return x + + # Extract + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Expression from which to extract components. + # Extract + def Expression(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Field to extract from `expression`. + # Extract + def Field(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Parameters for `function_name`; content/format may be unique to each + # value of `function_name`. + # Extract + def Metadata(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer + obj = InlineBuffer() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def ExtractStart(builder): builder.StartObject(3) +def ExtractAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) +def ExtractAddField(builder, field): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(field), 0) +def ExtractAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) +def ExtractEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py b/python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py new file mode 100644 index 0000000000000..e84fa725753cf --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py @@ -0,0 +1,33 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Field name in a relation +class FieldName(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFieldName(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = FieldName() + x.Init(buf, n + offset) + return x + + # FieldName + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # FieldName + def Position(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + +def FieldNameStart(builder): builder.StartObject(1) +def FieldNameAddPosition(builder, position): builder.PrependUint32Slot(0, position, 0) +def FieldNameEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py b/python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py new file mode 100644 index 0000000000000..8fed63c7fc2c8 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py @@ -0,0 +1,57 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Access the data of a field +class FieldRef(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFieldRef(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = FieldRef() + x.Init(buf, n + offset) + return x + + # FieldRef + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # FieldRef + def RefType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # A sequence of field names to allow referencing potentially nested fields + # FieldRef + def Ref(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + + # For Expressions which might reference fields in multiple Relations, + # this index may be provided to indicate which Relation's fields + # `path` points into. For example in the case of a join, + # 0 refers to the left relation and 1 to the right relation. + # FieldRef + def RelationIndex(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + +def FieldRefStart(builder): builder.StartObject(3) +def FieldRefAddRefType(builder, refType): builder.PrependUint8Slot(0, refType, 0) +def FieldRefAddRef(builder, ref): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(ref), 0) +def FieldRefAddRelationIndex(builder, relationIndex): builder.PrependInt32Slot(2, relationIndex, 0) +def FieldRefEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Filter.py b/python/generated/org/apache/arrow/computeir/flatbuf/Filter.py new file mode 100644 index 0000000000000..684c7410a841f --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Filter.py @@ -0,0 +1,52 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Filter operation +class Filter(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFilter(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Filter() + x.Init(buf, n + offset) + return x + + # Filter + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Filter + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # The expression which will be evaluated against input rows + # to determine whether they should be excluded from the + # filter relation's output. + # Filter + def Predicate(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def FilterStart(builder): builder.StartObject(2) +def FilterAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def FilterAddPredicate(builder, predicate): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(predicate), 0) +def FilterEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py new file mode 100644 index 0000000000000..322ea32384446 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Float16Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFloat16Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Float16Literal() + x.Init(buf, n + offset) + return x + + # Float16Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Float16Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) + return 0 + +def Float16LiteralStart(builder): builder.StartObject(1) +def Float16LiteralAddValue(builder, value): builder.PrependUint16Slot(0, value, 0) +def Float16LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py new file mode 100644 index 0000000000000..c92037b153f2e --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Float32Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFloat32Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Float32Buffer() + x.Init(buf, n + offset) + return x + + # Float32Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Float32Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) + return 0 + + # Float32Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o) + return 0 + + # Float32Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Float32Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def Float32BufferStart(builder): builder.StartObject(1) +def Float32BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def Float32BufferStartItemsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def Float32BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py new file mode 100644 index 0000000000000..1a4034bc80aa6 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Float32Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFloat32Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Float32Literal() + x.Init(buf, n + offset) + return x + + # Float32Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Float32Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) + return 0.0 + +def Float32LiteralStart(builder): builder.StartObject(1) +def Float32LiteralAddValue(builder, value): builder.PrependFloat32Slot(0, value, 0.0) +def Float32LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py new file mode 100644 index 0000000000000..68499e6ab2bbe --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Float64Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFloat64Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Float64Buffer() + x.Init(buf, n + offset) + return x + + # Float64Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Float64Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) + return 0 + + # Float64Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o) + return 0 + + # Float64Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Float64Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def Float64BufferStart(builder): builder.StartObject(1) +def Float64BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def Float64BufferStartItemsVector(builder, numElems): return builder.StartVector(8, numElems, 8) +def Float64BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py new file mode 100644 index 0000000000000..ccf161492dd53 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Float64Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFloat64Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Float64Literal() + x.Init(buf, n + offset) + return x + + # Float64Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Float64Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos) + return 0.0 + +def Float64LiteralStart(builder): builder.StartObject(1) +def Float64LiteralAddValue(builder, value): builder.PrependFloat64Slot(0, value, 0.0) +def Float64LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Following.py b/python/generated/org/apache/arrow/computeir/flatbuf/Following.py new file mode 100644 index 0000000000000..ae92ab2ce8818 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Following.py @@ -0,0 +1,44 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Boundary is following rows, determined by the contained expression +class Following(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFollowing(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Following() + x.Init(buf, n + offset) + return x + + # Following + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Following + def ImplType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # Following + def Impl(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def FollowingStart(builder): builder.StartObject(2) +def FollowingAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) +def FollowingAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) +def FollowingEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Frame.py b/python/generated/org/apache/arrow/computeir/flatbuf/Frame.py new file mode 100644 index 0000000000000..63de4cd8a672c --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Frame.py @@ -0,0 +1,9 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# The kind of window function to be executed. +class Frame(object): + Rows = 0 + Range = 1 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py new file mode 100644 index 0000000000000..a467694bab388 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py @@ -0,0 +1,9 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class FunctionImpl(object): + NONE = 0 + CanonicalFunction = 1 + NonCanonicalFunction = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py new file mode 100644 index 0000000000000..da4561e9d7458 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py @@ -0,0 +1,49 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# An inline replacement for org.apache.arrow.Buffer because that +# requires a sidecar block of bytes into which offsets can point. +# A union of buffers of each primitive type is provided to avoid +# the need for reinterpret_cast, std::mem::transmute, ... +# The final member of the union is a bytes buffer aligned suitably +# to hold any flatbuffer Table. +class InlineBuffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInlineBuffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = InlineBuffer() + x.Init(buf, n + offset) + return x + + # InlineBuffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # InlineBuffer + def ImplType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # InlineBuffer + def Impl(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def InlineBufferStart(builder): builder.StartObject(2) +def InlineBufferAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) +def InlineBufferAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) +def InlineBufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py new file mode 100644 index 0000000000000..b420fb5fa82cf --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py @@ -0,0 +1,18 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class InlineBufferImpl(object): + NONE = 0 + Int8Buffer = 1 + Int16Buffer = 2 + Int32Buffer = 3 + Int64Buffer = 4 + UInt8Buffer = 5 + UInt16Buffer = 6 + UInt32Buffer = 7 + UInt64Buffer = 8 + Float32Buffer = 9 + Float64Buffer = 10 + TableBuffer = 11 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py new file mode 100644 index 0000000000000..04e97cd2a0cbf --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int16Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt16Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int16Buffer() + x.Init(buf, n + offset) + return x + + # Int16Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int16Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2)) + return 0 + + # Int16Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint16Flags, o) + return 0 + + # Int16Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Int16Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def Int16BufferStart(builder): builder.StartObject(1) +def Int16BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def Int16BufferStartItemsVector(builder, numElems): return builder.StartVector(2, numElems, 2) +def Int16BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py new file mode 100644 index 0000000000000..a03cf7594dcff --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int16Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt16Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int16Literal() + x.Init(buf, n + offset) + return x + + # Int16Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int16Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 0 + +def Int16LiteralStart(builder): builder.StartObject(1) +def Int16LiteralAddValue(builder, value): builder.PrependInt16Slot(0, value, 0) +def Int16LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py new file mode 100644 index 0000000000000..6a640ca1f2d5a --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int32Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt32Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int32Buffer() + x.Init(buf, n + offset) + return x + + # Int32Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int32Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) + return 0 + + # Int32Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o) + return 0 + + # Int32Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Int32Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def Int32BufferStart(builder): builder.StartObject(1) +def Int32BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def Int32BufferStartItemsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def Int32BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py new file mode 100644 index 0000000000000..1a1b64702d91f --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int32Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt32Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int32Literal() + x.Init(buf, n + offset) + return x + + # Int32Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int32Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + +def Int32LiteralStart(builder): builder.StartObject(1) +def Int32LiteralAddValue(builder, value): builder.PrependInt32Slot(0, value, 0) +def Int32LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py new file mode 100644 index 0000000000000..921473509b86b --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int64Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt64Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int64Buffer() + x.Init(buf, n + offset) + return x + + # Int64Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int64Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) + return 0 + + # Int64Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o) + return 0 + + # Int64Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Int64Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def Int64BufferStart(builder): builder.StartObject(1) +def Int64BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def Int64BufferStartItemsVector(builder, numElems): return builder.StartVector(8, numElems, 8) +def Int64BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py new file mode 100644 index 0000000000000..1688b8c0223b7 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int64Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt64Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int64Literal() + x.Init(buf, n + offset) + return x + + # Int64Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int64Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) + return 0 + +def Int64LiteralStart(builder): builder.StartObject(1) +def Int64LiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) +def Int64LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py new file mode 100644 index 0000000000000..e27ef5b0cbf88 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int8Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt8Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int8Buffer() + x.Init(buf, n + offset) + return x + + # Int8Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int8Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) + return 0 + + # Int8Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) + return 0 + + # Int8Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Int8Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def Int8BufferStart(builder): builder.StartObject(1) +def Int8BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def Int8BufferStartItemsVector(builder, numElems): return builder.StartVector(1, numElems, 1) +def Int8BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py new file mode 100644 index 0000000000000..bc891ecc414b3 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int8Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt8Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int8Literal() + x.Init(buf, n + offset) + return x + + # Int8Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int8Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) + return 0 + +def Int8LiteralStart(builder): builder.StartObject(1) +def Int8LiteralAddValue(builder, value): builder.PrependInt8Slot(0, value, 0) +def Int8LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py new file mode 100644 index 0000000000000..71878783aea6b --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py @@ -0,0 +1,43 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class IntervalLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsIntervalLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = IntervalLiteral() + x.Init(buf, n + offset) + return x + + # IntervalLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # IntervalLiteral + def ValueType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # IntervalLiteral + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def IntervalLiteralStart(builder): builder.StartObject(2) +def IntervalLiteralAddValueType(builder, valueType): builder.PrependUint8Slot(0, valueType, 0) +def IntervalLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) +def IntervalLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py new file mode 100644 index 0000000000000..a1b71a789e0f5 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py @@ -0,0 +1,40 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class IntervalLiteralDaysMilliseconds(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsIntervalLiteralDaysMilliseconds(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = IntervalLiteralDaysMilliseconds() + x.Init(buf, n + offset) + return x + + # IntervalLiteralDaysMilliseconds + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # IntervalLiteralDaysMilliseconds + def Days(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + + # IntervalLiteralDaysMilliseconds + def Milliseconds(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + +def IntervalLiteralDaysMillisecondsStart(builder): builder.StartObject(2) +def IntervalLiteralDaysMillisecondsAddDays(builder, days): builder.PrependInt32Slot(0, days, 0) +def IntervalLiteralDaysMillisecondsAddMilliseconds(builder, milliseconds): builder.PrependInt32Slot(1, milliseconds, 0) +def IntervalLiteralDaysMillisecondsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py new file mode 100644 index 0000000000000..1fd11205ea304 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py @@ -0,0 +1,9 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class IntervalLiteralImpl(object): + NONE = 0 + IntervalLiteralMonths = 1 + IntervalLiteralDaysMilliseconds = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py new file mode 100644 index 0000000000000..cc5aa6da68c29 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class IntervalLiteralMonths(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsIntervalLiteralMonths(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = IntervalLiteralMonths() + x.Init(buf, n + offset) + return x + + # IntervalLiteralMonths + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # IntervalLiteralMonths + def Months(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + +def IntervalLiteralMonthsStart(builder): builder.StartObject(1) +def IntervalLiteralMonthsAddMonths(builder, months): builder.PrependInt32Slot(0, months, 0) +def IntervalLiteralMonthsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Join.py b/python/generated/org/apache/arrow/computeir/flatbuf/Join.py new file mode 100644 index 0000000000000..89a93cafd2be6 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Join.py @@ -0,0 +1,73 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# The contents of Relation.options will be JoinOptions +# if Relation.operation = CanonicalOperation::Join +class Join(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsJoin(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Join() + x.Init(buf, n + offset) + return x + + # Join + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Join + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # The expression which will be evaluated against rows from each + # input to determine whether they should be included in the + # join relation's output. + # Join + def OnExpression(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Join + def JoinKindType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # The kind of join to use. + # Join + def JoinKind(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def JoinStart(builder): builder.StartObject(4) +def JoinAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def JoinAddOnExpression(builder, onExpression): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(onExpression), 0) +def JoinAddJoinKindType(builder, joinKindType): builder.PrependUint8Slot(2, joinKindType, 0) +def JoinAddJoinKind(builder, joinKind): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(joinKind), 0) +def JoinEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py new file mode 100644 index 0000000000000..707e8249675ac --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py @@ -0,0 +1,9 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class JoinKind(object): + NONE = 0 + CanonicalJoinKind = 1 + NonCanonicalJoinKind = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py b/python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py new file mode 100644 index 0000000000000..9168e6545c5b1 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py @@ -0,0 +1,44 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class KeyValue(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsKeyValue(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = KeyValue() + x.Init(buf, n + offset) + return x + + # KeyValue + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # KeyValue + def Key(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # KeyValue + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Literal import Literal + obj = Literal() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def KeyValueStart(builder): builder.StartObject(2) +def KeyValueAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0) +def KeyValueAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) +def KeyValueEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Limit.py b/python/generated/org/apache/arrow/computeir/flatbuf/Limit.py new file mode 100644 index 0000000000000..3e46154e9500a --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Limit.py @@ -0,0 +1,46 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Limit operation +class Limit(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLimit(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Limit() + x.Init(buf, n + offset) + return x + + # Limit + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Limit + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # The maximum number of rows of output. + # Limit + def Count(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) + return 0 + +def LimitStart(builder): builder.StartObject(2) +def LimitAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def LimitAddCount(builder, count): builder.PrependInt64Slot(1, count, 0) +def LimitEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Literal.py new file mode 100644 index 0000000000000..2750449fff497 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Literal.py @@ -0,0 +1,43 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Literal() + x.Init(buf, n + offset) + return x + + # Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Literal + def ImplType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # Literal + def Impl(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def LiteralStart(builder): builder.StartObject(2) +def LiteralAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) +def LiteralAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) +def LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py new file mode 100644 index 0000000000000..c634d80791401 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py @@ -0,0 +1,30 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class LiteralImpl(object): + NONE = 0 + NullLiteral = 1 + BooleanLiteral = 2 + Int8Literal = 3 + Int16Literal = 4 + Int32Literal = 5 + Int64Literal = 6 + UInt8Literal = 7 + UInt16Literal = 8 + UInt32Literal = 9 + UInt64Literal = 10 + DateLiteral = 11 + TimeLiteral = 12 + TimestampLiteral = 13 + IntervalLiteral = 14 + DecimalLiteral = 15 + Float16Literal = 16 + Float32Literal = 17 + Float64Literal = 18 + ArrayLiteral = 19 + StructLiteral = 20 + MapLiteral = 21 + StringLiteral = 22 + BinaryLiteral = 23 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py b/python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py new file mode 100644 index 0000000000000..df7e9cc9087d8 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py @@ -0,0 +1,65 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Literal relation +class LiteralRelation(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLiteralRelation(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = LiteralRelation() + x.Init(buf, n + offset) + return x + + # LiteralRelation + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # LiteralRelation + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # The columns of this literal relation. + # LiteralRelation + def Columns(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Literal import Literal + obj = Literal() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # LiteralRelation + def ColumnsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # LiteralRelation + def ColumnsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + return o == 0 + +def LiteralRelationStart(builder): builder.StartObject(2) +def LiteralRelationAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def LiteralRelationAddColumns(builder, columns): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(columns), 0) +def LiteralRelationStartColumnsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def LiteralRelationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py b/python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py new file mode 100644 index 0000000000000..92805c73fbf47 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py @@ -0,0 +1,33 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Access a value for a given map key +class MapKey(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsMapKey(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = MapKey() + x.Init(buf, n + offset) + return x + + # MapKey + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # MapKey + def Key(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def MapKeyStart(builder): builder.StartObject(1) +def MapKeyAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0) +def MapKeyEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py new file mode 100644 index 0000000000000..29072657b49ba --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py @@ -0,0 +1,51 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class MapLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsMapLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = MapLiteral() + x.Init(buf, n + offset) + return x + + # MapLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # MapLiteral + def Values(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.KeyValue import KeyValue + obj = KeyValue() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # MapLiteral + def ValuesLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # MapLiteral + def ValuesIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def MapLiteralStart(builder): builder.StartObject(1) +def MapLiteralAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0) +def MapLiteralStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def MapLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py new file mode 100644 index 0000000000000..36e2348111900 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py @@ -0,0 +1,40 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class NonCanonicalAggregate(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNonCanonicalAggregate(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = NonCanonicalAggregate() + x.Init(buf, n + offset) + return x + + # NonCanonicalAggregate + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # NonCanonicalAggregate + def NameSpace(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # NonCanonicalAggregate + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def NonCanonicalAggregateStart(builder): builder.StartObject(2) +def NonCanonicalAggregateAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) +def NonCanonicalAggregateAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def NonCanonicalAggregateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py new file mode 100644 index 0000000000000..b913579b111f3 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py @@ -0,0 +1,40 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class NonCanonicalFunction(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNonCanonicalFunction(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = NonCanonicalFunction() + x.Init(buf, n + offset) + return x + + # NonCanonicalFunction + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # NonCanonicalFunction + def NameSpace(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # NonCanonicalFunction + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def NonCanonicalFunctionStart(builder): builder.StartObject(2) +def NonCanonicalFunctionAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) +def NonCanonicalFunctionAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def NonCanonicalFunctionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py new file mode 100644 index 0000000000000..5fc46d685b920 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py @@ -0,0 +1,40 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class NonCanonicalJoinKind(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNonCanonicalJoinKind(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = NonCanonicalJoinKind() + x.Init(buf, n + offset) + return x + + # NonCanonicalJoinKind + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # NonCanonicalJoinKind + def NameSpace(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # NonCanonicalJoinKind + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def NonCanonicalJoinKindStart(builder): builder.StartObject(2) +def NonCanonicalJoinKindAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) +def NonCanonicalJoinKindAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def NonCanonicalJoinKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py new file mode 100644 index 0000000000000..08258c543dadb --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py @@ -0,0 +1,40 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class NonCanonicalSetOpKind(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNonCanonicalSetOpKind(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = NonCanonicalSetOpKind() + x.Init(buf, n + offset) + return x + + # NonCanonicalSetOpKind + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # NonCanonicalSetOpKind + def NameSpace(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # NonCanonicalSetOpKind + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def NonCanonicalSetOpKindStart(builder): builder.StartObject(2) +def NonCanonicalSetOpKindAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) +def NonCanonicalSetOpKindAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def NonCanonicalSetOpKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py new file mode 100644 index 0000000000000..c0c834ea00a5e --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py @@ -0,0 +1,24 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class NullLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNullLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = NullLiteral() + x.Init(buf, n + offset) + return x + + # NullLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def NullLiteralStart(builder): builder.StartObject(0) +def NullLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py b/python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py new file mode 100644 index 0000000000000..31e38e3bd6d2b --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py @@ -0,0 +1,66 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Order by relation +class OrderBy(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsOrderBy(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = OrderBy() + x.Init(buf, n + offset) + return x + + # OrderBy + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # OrderBy + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Define sort order for rows of output. + # Keys with higher precedence are ordered ahead of other keys. + # OrderBy + def Keys(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.SortKey import SortKey + obj = SortKey() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # OrderBy + def KeysLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # OrderBy + def KeysIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + return o == 0 + +def OrderByStart(builder): builder.StartObject(2) +def OrderByAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def OrderByAddKeys(builder, keys): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(keys), 0) +def OrderByStartKeysVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def OrderByEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py b/python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py new file mode 100644 index 0000000000000..23ee831f8095c --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py @@ -0,0 +1,12 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# Whether lesser values should precede greater or vice versa, +# also whether nulls should preced or follow values. +class Ordering(object): + ASCENDING_THEN_NULLS = 0 + DESCENDING_THEN_NULLS = 1 + NULLS_THEN_ASCENDING = 2 + NULLS_THEN_DESCENDING = 3 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py b/python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py new file mode 100644 index 0000000000000..ed73f216148a7 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py @@ -0,0 +1,24 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class PassThrough(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsPassThrough(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = PassThrough() + x.Init(buf, n + offset) + return x + + # PassThrough + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def PassThroughStart(builder): builder.StartObject(0) +def PassThroughEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Plan.py b/python/generated/org/apache/arrow/computeir/flatbuf/Plan.py new file mode 100644 index 0000000000000..4d751fd63ec80 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Plan.py @@ -0,0 +1,68 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A specification of a query. +class Plan(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsPlan(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Plan() + x.Init(buf, n + offset) + return x + + # Plan + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # One or more output relations. + # Plan + def Sinks(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Relation import Relation + obj = Relation() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Plan + def SinksLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Plan + def SinksIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + + # If this Plan was derived from another (for example by running + # an optimization pass), that plan may be included here to + # provide a backtrace of derivations. + # Plan + def DerivedFrom(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Plan import Plan + obj = Plan() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def PlanStart(builder): builder.StartObject(2) +def PlanAddSinks(builder, sinks): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(sinks), 0) +def PlanStartSinksVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def PlanAddDerivedFrom(builder, derivedFrom): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(derivedFrom), 0) +def PlanEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py b/python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py new file mode 100644 index 0000000000000..c6e1c243d7555 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py @@ -0,0 +1,44 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Boundary is preceding rows, determined by the contained expression +class Preceding(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsPreceding(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Preceding() + x.Init(buf, n + offset) + return x + + # Preceding + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Preceding + def IpmlType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # Preceding + def Ipml(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def PrecedingStart(builder): builder.StartObject(2) +def PrecedingAddIpmlType(builder, ipmlType): builder.PrependUint8Slot(0, ipmlType, 0) +def PrecedingAddIpml(builder, ipml): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(ipml), 0) +def PrecedingEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Project.py b/python/generated/org/apache/arrow/computeir/flatbuf/Project.py new file mode 100644 index 0000000000000..5dab18d0ee1e7 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Project.py @@ -0,0 +1,66 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Projection +class Project(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsProject(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Project() + x.Init(buf, n + offset) + return x + + # Project + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Project + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Expressions which will be evaluated to produce to + # the rows of the project relation's output. + # Project + def Expressions(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Project + def ExpressionsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Project + def ExpressionsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + return o == 0 + +def ProjectStart(builder): builder.StartObject(2) +def ProjectAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def ProjectAddExpressions(builder, expressions): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(expressions), 0) +def ProjectStartExpressionsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def ProjectEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Read.py b/python/generated/org/apache/arrow/computeir/flatbuf/Read.py new file mode 100644 index 0000000000000..fa068f5a05dc0 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Read.py @@ -0,0 +1,57 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A table read +class Read(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsRead(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Read() + x.Init(buf, n + offset) + return x + + # Read + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Read + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Read + def Resource(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Read + def Schema(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.Schema import Schema + obj = Schema() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def ReadStart(builder): builder.StartObject(3) +def ReadAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def ReadAddResource(builder, resource): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(resource), 0) +def ReadAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) +def ReadEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py b/python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py new file mode 100644 index 0000000000000..3c4c34a664800 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py @@ -0,0 +1,86 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Fields common to every relational operator +class RelBase(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsRelBase(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = RelBase() + x.Init(buf, n + offset) + return x + + # RelBase + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The arguments passed to `operation`. + # RelBase + def Arguments(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Relation import Relation + obj = Relation() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # RelBase + def ArgumentsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # RelBase + def ArgumentsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + + # RelBase + def OutputMappingType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # Output remapping of ordinals for a given operation + # RelBase + def OutputMapping(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + + # Arguments for custom operations + # RelBase + def Options(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer + obj = InlineBuffer() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def RelBaseStart(builder): builder.StartObject(4) +def RelBaseAddArguments(builder, arguments): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(arguments), 0) +def RelBaseStartArgumentsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def RelBaseAddOutputMappingType(builder, outputMappingType): builder.PrependUint8Slot(1, outputMappingType, 0) +def RelBaseAddOutputMapping(builder, outputMapping): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(outputMapping), 0) +def RelBaseAddOptions(builder, options): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(options), 0) +def RelBaseEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Relation.py b/python/generated/org/apache/arrow/computeir/flatbuf/Relation.py new file mode 100644 index 0000000000000..22188fb82bfa7 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Relation.py @@ -0,0 +1,44 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A table holding an instance of the possible relation types. +class Relation(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsRelation(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Relation() + x.Init(buf, n + offset) + return x + + # Relation + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Relation + def ImplType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # Relation + def Impl(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def RelationStart(builder): builder.StartObject(2) +def RelationAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) +def RelationAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) +def RelationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py new file mode 100644 index 0000000000000..e7fd090c0a025 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py @@ -0,0 +1,19 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# The varieties of relations +class RelationImpl(object): + NONE = 0 + Aggregate = 1 + Common = 2 + Custom = 3 + SetOperation = 4 + Filter = 5 + Limit = 6 + LiteralRelation = 7 + OrderBy = 8 + Project = 9 + Read = 10 + Write = 11 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Remap.py b/python/generated/org/apache/arrow/computeir/flatbuf/Remap.py new file mode 100644 index 0000000000000..d30060d0a33d4 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Remap.py @@ -0,0 +1,60 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A data type indicating a different mapping of columns +# should occur in the output. +# +# For example: +# +# Given a query `SELECT a, b FROM t` where `t` has columns a, b, c +# the mapping value for the projection would equal [0, 1]. +class Remap(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsRemap(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Remap() + x.Init(buf, n + offset) + return x + + # Remap + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Remap + def Mapping(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) + return 0 + + # Remap + def MappingAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o) + return 0 + + # Remap + def MappingLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Remap + def MappingIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def RemapStart(builder): builder.StartObject(1) +def RemapAddMapping(builder, mapping): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(mapping), 0) +def RemapStartMappingVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def RemapEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py new file mode 100644 index 0000000000000..464d53c36a371 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py @@ -0,0 +1,10 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# The kind of set operation +class SetOpKind(object): + NONE = 0 + CanonicalSetOpKind = 1 + NonCanonicalSetOpKind = 2 + diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py b/python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py new file mode 100644 index 0000000000000..0f5dd4a464379 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py @@ -0,0 +1,57 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A set operation on two or more relations +class SetOperation(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSetOperation(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = SetOperation() + x.Init(buf, n + offset) + return x + + # SetOperation + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # SetOperation + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # SetOperation + def SetOpType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # The kind of set operation + # SetOperation + def SetOp(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + +def SetOperationStart(builder): builder.StartObject(3) +def SetOperationAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def SetOperationAddSetOpType(builder, setOpType): builder.PrependUint8Slot(1, setOpType, 0) +def SetOperationAddSetOp(builder, setOp): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(setOp), 0) +def SetOperationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py b/python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py new file mode 100644 index 0000000000000..e4d2bc89355a8 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py @@ -0,0 +1,45 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# An expression with an order +class SortKey(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSortKey(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = SortKey() + x.Init(buf, n + offset) + return x + + # SortKey + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # SortKey + def Expression(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # SortKey + def Ordering(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + +def SortKeyStart(builder): builder.StartObject(2) +def SortKeyAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) +def SortKeyAddOrdering(builder, ordering): builder.PrependUint8Slot(1, ordering, 0) +def SortKeyEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py new file mode 100644 index 0000000000000..42b79086e3cda --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class StringLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsStringLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = StringLiteral() + x.Init(buf, n + offset) + return x + + # StringLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # StringLiteral + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def StringLiteralStart(builder): builder.StartObject(1) +def StringLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) +def StringLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/StructField.py b/python/generated/org/apache/arrow/computeir/flatbuf/StructField.py new file mode 100644 index 0000000000000..bde4f0443c263 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/StructField.py @@ -0,0 +1,34 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Struct field access +class StructField(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsStructField(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = StructField() + x.Init(buf, n + offset) + return x + + # StructField + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The position of the field in the struct schema + # StructField + def Position(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + +def StructFieldStart(builder): builder.StartObject(1) +def StructFieldAddPosition(builder, position): builder.PrependUint32Slot(0, position, 0) +def StructFieldEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py new file mode 100644 index 0000000000000..89fbbcbf98866 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py @@ -0,0 +1,51 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class StructLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsStructLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = StructLiteral() + x.Init(buf, n + offset) + return x + + # StructLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # StructLiteral + def Values(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.KeyValue import KeyValue + obj = KeyValue() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # StructLiteral + def ValuesLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # StructLiteral + def ValuesIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def StructLiteralStart(builder): builder.StartObject(1) +def StructLiteralAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0) +def StructLiteralStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def StructLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py new file mode 100644 index 0000000000000..c2718b6e52f05 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class TableBuffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsTableBuffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = TableBuffer() + x.Init(buf, n + offset) + return x + + # TableBuffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # TableBuffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) + return 0 + + # TableBuffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) + return 0 + + # TableBuffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # TableBuffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def TableBufferStart(builder): builder.StartObject(1) +def TableBufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def TableBufferStartItemsVector(builder, numElems): return builder.StartVector(1, numElems, 1) +def TableBufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py new file mode 100644 index 0000000000000..73f6eb8afd31b --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class TimeLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsTimeLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = TimeLiteral() + x.Init(buf, n + offset) + return x + + # TimeLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # TimeLiteral + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) + return 0 + +def TimeLiteralStart(builder): builder.StartObject(1) +def TimeLiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) +def TimeLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py new file mode 100644 index 0000000000000..284bab1f58d3b --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py @@ -0,0 +1,40 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class TimestampLiteral(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsTimestampLiteral(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = TimestampLiteral() + x.Init(buf, n + offset) + return x + + # TimestampLiteral + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # TimestampLiteral + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) + return 0 + + # TimestampLiteral + def Timezone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def TimestampLiteralStart(builder): builder.StartObject(2) +def TimestampLiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) +def TimestampLiteralAddTimezone(builder, timezone): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(timezone), 0) +def TimestampLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py new file mode 100644 index 0000000000000..8acf00b0ccfa5 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt16Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt16Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt16Buffer() + x.Init(buf, n + offset) + return x + + # UInt16Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt16Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2)) + return 0 + + # UInt16Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint16Flags, o) + return 0 + + # UInt16Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # UInt16Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def UInt16BufferStart(builder): builder.StartObject(1) +def UInt16BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def UInt16BufferStartItemsVector(builder, numElems): return builder.StartVector(2, numElems, 2) +def UInt16BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py new file mode 100644 index 0000000000000..291b249920a46 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt16Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt16Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt16Literal() + x.Init(buf, n + offset) + return x + + # UInt16Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt16Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) + return 0 + +def UInt16LiteralStart(builder): builder.StartObject(1) +def UInt16LiteralAddValue(builder, value): builder.PrependUint16Slot(0, value, 0) +def UInt16LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py new file mode 100644 index 0000000000000..2249c0c0c196c --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt32Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt32Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt32Buffer() + x.Init(buf, n + offset) + return x + + # UInt32Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt32Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) + return 0 + + # UInt32Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o) + return 0 + + # UInt32Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # UInt32Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def UInt32BufferStart(builder): builder.StartObject(1) +def UInt32BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def UInt32BufferStartItemsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def UInt32BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py new file mode 100644 index 0000000000000..deaba6cf7eb8d --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt32Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt32Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt32Literal() + x.Init(buf, n + offset) + return x + + # UInt32Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt32Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) + return 0 + +def UInt32LiteralStart(builder): builder.StartObject(1) +def UInt32LiteralAddValue(builder, value): builder.PrependUint32Slot(0, value, 0) +def UInt32LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py new file mode 100644 index 0000000000000..dc7342e825660 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt64Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt64Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt64Buffer() + x.Init(buf, n + offset) + return x + + # UInt64Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt64Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) + return 0 + + # UInt64Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o) + return 0 + + # UInt64Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # UInt64Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def UInt64BufferStart(builder): builder.StartObject(1) +def UInt64BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def UInt64BufferStartItemsVector(builder, numElems): return builder.StartVector(8, numElems, 8) +def UInt64BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py new file mode 100644 index 0000000000000..75aa49ae98ead --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt64Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt64Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt64Literal() + x.Init(buf, n + offset) + return x + + # UInt64Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt64Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos) + return 0 + +def UInt64LiteralStart(builder): builder.StartObject(1) +def UInt64LiteralAddValue(builder, value): builder.PrependUint64Slot(0, value, 0) +def UInt64LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py new file mode 100644 index 0000000000000..2e2b59e82e372 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py @@ -0,0 +1,53 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt8Buffer(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt8Buffer(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt8Buffer() + x.Init(buf, n + offset) + return x + + # UInt8Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt8Buffer + def Items(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) + return 0 + + # UInt8Buffer + def ItemsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) + return 0 + + # UInt8Buffer + def ItemsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # UInt8Buffer + def ItemsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + +def UInt8BufferStart(builder): builder.StartObject(1) +def UInt8BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) +def UInt8BufferStartItemsVector(builder, numElems): return builder.StartVector(1, numElems, 1) +def UInt8BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py new file mode 100644 index 0000000000000..a380230434d0e --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class UInt8Literal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUInt8Literal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = UInt8Literal() + x.Init(buf, n + offset) + return x + + # UInt8Literal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # UInt8Literal + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + +def UInt8LiteralStart(builder): builder.StartObject(1) +def UInt8LiteralAddValue(builder, value): builder.PrependUint8Slot(0, value, 0) +def UInt8LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py b/python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py new file mode 100644 index 0000000000000..4eac29bc3d855 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py @@ -0,0 +1,25 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Boundary is unbounded +class Unbounded(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUnbounded(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Unbounded() + x.Init(buf, n + offset) + return x + + # Unbounded + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def UnboundedStart(builder): builder.StartObject(0) +def UnboundedEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py b/python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py new file mode 100644 index 0000000000000..b753f08b20cf6 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py @@ -0,0 +1,129 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# An expression representing a window function call. +class WindowCall(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsWindowCall(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = WindowCall() + x.Init(buf, n + offset) + return x + + # WindowCall + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The kind of window frame + # WindowCall + def Kind(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # The expression to operate over + # WindowCall + def Expression(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Partition keys + # WindowCall + def Partitions(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.Expression import Expression + obj = Expression() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # WindowCall + def PartitionsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # WindowCall + def PartitionsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + return o == 0 + + # Sort keys + # WindowCall + def Orderings(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.computeir.flatbuf.SortKey import SortKey + obj = SortKey() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # WindowCall + def OrderingsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # WindowCall + def OrderingsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + return o == 0 + + # Lower window bound + # WindowCall + def LowerBound(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Bound import Bound + obj = Bound() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Upper window bound + # WindowCall + def UpperBound(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.Bound import Bound + obj = Bound() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def WindowCallStart(builder): builder.StartObject(6) +def WindowCallAddKind(builder, kind): builder.PrependUint8Slot(0, kind, 0) +def WindowCallAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) +def WindowCallAddPartitions(builder, partitions): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(partitions), 0) +def WindowCallStartPartitionsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def WindowCallAddOrderings(builder, orderings): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(orderings), 0) +def WindowCallStartOrderingsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def WindowCallAddLowerBound(builder, lowerBound): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(lowerBound), 0) +def WindowCallAddUpperBound(builder, upperBound): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(upperBound), 0) +def WindowCallEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Write.py b/python/generated/org/apache/arrow/computeir/flatbuf/Write.py new file mode 100644 index 0000000000000..6245493cf8cd1 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/Write.py @@ -0,0 +1,57 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A table write +class Write(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsWrite(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Write() + x.Init(buf, n + offset) + return x + + # Write + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Write + def Base(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.RelBase import RelBase + obj = RelBase() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Write + def Resource(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Write + def Schema(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.Schema import Schema + obj = Schema() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def WriteStart(builder): builder.StartObject(3) +def WriteAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) +def WriteAddResource(builder, resource): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(resource), 0) +def WriteAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) +def WriteEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/__init__.py b/python/generated/org/apache/arrow/computeir/flatbuf/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py new file mode 100644 index 0000000000000..8d3736e608e15 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py @@ -0,0 +1,70 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions +# if Relation.operation = NonCanonicalOperation{ +# .name_space = "arrow", +# .name = "filesystem_dataset_scan", +# } +class Arrow_FileSystemDatasetScanOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArrow_FileSystemDatasetScanOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Arrow_FileSystemDatasetScanOptions() + x.Init(buf, n + offset) + return x + + # Arrow_FileSystemDatasetScanOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The base directory of a dataset which should be scanned + # as a source relation. A URI is used to accommodate potentially + # remote file systems. + # Arrow_FileSystemDatasetScanOptions + def BaseDir(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.ext.Uri import Uri + obj = Uri() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # The format of files in this dataset. + # Arrow_FileSystemDatasetScanOptions + def Format(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.ext.FileFormat import FileFormat + obj = FileFormat() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # A partitioning scheme in use in this dataset. + # Arrow_FileSystemDatasetScanOptions + def Partitioning(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.ext.Partitioning import Partitioning + obj = Partitioning() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def Arrow_FileSystemDatasetScanOptionsStart(builder): builder.StartObject(3) +def Arrow_FileSystemDatasetScanOptionsAddBaseDir(builder, baseDir): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(baseDir), 0) +def Arrow_FileSystemDatasetScanOptionsAddFormat(builder, format): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(format), 0) +def Arrow_FileSystemDatasetScanOptionsAddPartitioning(builder, partitioning): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(partitioning), 0) +def Arrow_FileSystemDatasetScanOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py new file mode 100644 index 0000000000000..da5f1f9972a4d --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py @@ -0,0 +1,81 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions +# if Relation.operation = NonCanonicalOperation{ +# .name_space = "arrow", +# .name = "filesystem_dataset_write", +# } +class Arrow_FileSystemDatasetWriteOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArrow_FileSystemDatasetWriteOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Arrow_FileSystemDatasetWriteOptions() + x.Init(buf, n + offset) + return x + + # Arrow_FileSystemDatasetWriteOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The base directory of a dataset into which output batches should be + # written. A URI is used to accommodate potentially remote file systems. + # Files present in this directory will not be explicitly deleted, though + # they may be overwritten. + # Arrow_FileSystemDatasetWriteOptions + def BaseDir(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.ext.Uri import Uri + obj = Uri() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # The format in which to write files. + # Arrow_FileSystemDatasetWriteOptions + def Format(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.ext.FileFormat import FileFormat + obj = FileFormat() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # A partitioning scheme which should be used when writing this dataset. + # Arrow_FileSystemDatasetWriteOptions + def Partitioning(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.ext.Partitioning import Partitioning + obj = Partitioning() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Template string used to generate written files' basenames. + # {i} will be replaced by an auto incremented integer. + # Arrow_FileSystemDatasetWriteOptions + def BasenameTemplate(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def Arrow_FileSystemDatasetWriteOptionsStart(builder): builder.StartObject(4) +def Arrow_FileSystemDatasetWriteOptionsAddBaseDir(builder, baseDir): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(baseDir), 0) +def Arrow_FileSystemDatasetWriteOptionsAddFormat(builder, format): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(format), 0) +def Arrow_FileSystemDatasetWriteOptionsAddPartitioning(builder, partitioning): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(partitioning), 0) +def Arrow_FileSystemDatasetWriteOptionsAddBasenameTemplate(builder, basenameTemplate): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(basenameTemplate), 0) +def Arrow_FileSystemDatasetWriteOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py new file mode 100644 index 0000000000000..e795d3a292e16 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py @@ -0,0 +1,42 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# The contents of Relation.options will be Arrow_StreamOutOptions +# if Relation.operation = NonCanonicalOperation{ +# .name_space = "arrow", +# .name = "stream_out", +# } +class Arrow_StreamOutOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArrow_StreamOutOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Arrow_StreamOutOptions() + x.Init(buf, n + offset) + return x + + # Arrow_StreamOutOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The URI to which RecordBatches of output should be streamed. + # Arrow_StreamOutOptions + def Destination(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.computeir.flatbuf.ext.Uri import Uri + obj = Uri() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def Arrow_StreamOutOptionsStart(builder): builder.StartObject(1) +def Arrow_StreamOutOptionsAddDestination(builder, destination): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(destination), 0) +def Arrow_StreamOutOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py new file mode 100644 index 0000000000000..2e366c4d8f2ad --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py @@ -0,0 +1,45 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class FileFormat(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFileFormat(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = FileFormat() + x.Init(buf, n + offset) + return x + + # FileFormat + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # E.g. "parquet", "csv", ... + # FileFormat + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # FileFormat + def Options(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = o + self._tab.Pos + from org.apache.arrow.flatbuf.Buffer import Buffer + obj = Buffer() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def FileFormatStart(builder): builder.StartObject(2) +def FileFormatAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def FileFormatAddOptions(builder, options): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(options), 0) +def FileFormatEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py new file mode 100644 index 0000000000000..4d363f5bf61ea --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py @@ -0,0 +1,46 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Partitioning(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsPartitioning(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Partitioning() + x.Init(buf, n + offset) + return x + + # Partitioning + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Currently supported: "hive", "directory" + # Partitioning + def Flavor(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Fields on which data is partitioned + # Partitioning + def Schema(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.Schema import Schema + obj = Schema() + obj.Init(self._tab.Bytes, x) + return obj + return None + +def PartitioningStart(builder): builder.StartObject(2) +def PartitioningAddFlavor(builder, flavor): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(flavor), 0) +def PartitioningAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) +def PartitioningEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py new file mode 100644 index 0000000000000..acd8cc75edb1f --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py @@ -0,0 +1,38 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# The contents of Relation.options will be Sql_FromOptions +# if Relation.operation = NonCanonicalOperation{ +# .name_space = "sql", +# .name = "from", +# } +class Sql_FromOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSql_FromOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Sql_FromOptions() + x.Init(buf, n + offset) + return x + + # Sql_FromOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The name of a table referenced as a source relation. + # Sql_FromOptions + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def Sql_FromOptionsStart(builder): builder.StartObject(1) +def Sql_FromOptionsAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def Sql_FromOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py new file mode 100644 index 0000000000000..8df5b7c324ccb --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py @@ -0,0 +1,50 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +#////////////////////////////////////////////////////////// +# The contents of Relation.options will be Sql_IntoOptions +# if Relation.operation = NonCanonicalOperation{ +# .name_space = "sql", +# .name = "into", +# } +class Sql_IntoOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSql_IntoOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Sql_IntoOptions() + x.Init(buf, n + offset) + return x + + # Sql_IntoOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The name of a table into which rows will be inserted. + # Sql_IntoOptions + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Whether rows written into the table should be appended + # to the table's current rows (INSERT INTO). + # If false, the table will be overwritten (INTO). + # Sql_IntoOptions + def Append(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) + return True + +def Sql_IntoOptionsStart(builder): builder.StartObject(2) +def Sql_IntoOptionsAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def Sql_IntoOptionsAddAppend(builder, append): builder.PrependBoolSlot(1, append, 1) +def Sql_IntoOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py new file mode 100644 index 0000000000000..ece6db1eff778 --- /dev/null +++ b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py @@ -0,0 +1,100 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: ext + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +#////////////////////////////////////////////////////////// +class Uri(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUri(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Uri() + x.Init(buf, n + offset) + return x + + # Uri + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Uri + def Schema(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Uri + def Userinfo(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Uri + def Host(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Uri + def Port(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) + return 0 + + # Uri + def Path(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Uri + def Query(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.flatbuf.KeyValue import KeyValue + obj = KeyValue() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Uri + def QueryLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Uri + def QueryIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + return o == 0 + + # Uri + def Fragment(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def UriStart(builder): builder.StartObject(7) +def UriAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) +def UriAddUserinfo(builder, userinfo): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(userinfo), 0) +def UriAddHost(builder, host): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(host), 0) +def UriAddPort(builder, port): builder.PrependUint16Slot(3, port, 0) +def UriAddPath(builder, path): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(path), 0) +def UriAddQuery(builder, query): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(query), 0) +def UriStartQueryVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def UriAddFragment(builder, fragment): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(fragment), 0) +def UriEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/__init__.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/python/generated/org/apache/arrow/flatbuf/Binary.py b/python/generated/org/apache/arrow/flatbuf/Binary.py new file mode 100644 index 0000000000000..714ce9edf7306 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Binary.py @@ -0,0 +1,25 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Opaque binary data +class Binary(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsBinary(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Binary() + x.Init(buf, n + offset) + return x + + # Binary + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def BinaryStart(builder): builder.StartObject(0) +def BinaryEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Bool.py b/python/generated/org/apache/arrow/flatbuf/Bool.py new file mode 100644 index 0000000000000..b3992459594a5 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Bool.py @@ -0,0 +1,24 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Bool(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsBool(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Bool() + x.Init(buf, n + offset) + return x + + # Bool + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def BoolStart(builder): builder.StartObject(0) +def BoolEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Buffer.py b/python/generated/org/apache/arrow/flatbuf/Buffer.py new file mode 100644 index 0000000000000..70772254c0c62 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Buffer.py @@ -0,0 +1,34 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# ---------------------------------------------------------------------- +# A Buffer represents a single contiguous memory segment +class Buffer(object): + __slots__ = ['_tab'] + + # Buffer + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The relative offset into the shared memory page where the bytes for this + # buffer starts + # Buffer + def Offset(self): return self._tab.Get(flatbuffers.number_types.Int64Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0)) + # The absolute length (in bytes) of the memory buffer. The memory is found + # from offset (inclusive) to offset + length (non-inclusive). When building + # messages using the encapsulated IPC message, padding bytes may be written + # after a buffer, but such padding bytes do not need to be accounted for in + # the size here. + # Buffer + def Length(self): return self._tab.Get(flatbuffers.number_types.Int64Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(8)) + +def CreateBuffer(builder, offset, length): + builder.Prep(8, 16) + builder.PrependInt64(length) + builder.PrependInt64(offset) + return builder.Offset() diff --git a/python/generated/org/apache/arrow/flatbuf/Date.py b/python/generated/org/apache/arrow/flatbuf/Date.py new file mode 100644 index 0000000000000..460f7ef026cde --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Date.py @@ -0,0 +1,38 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Date is either a 32-bit or 64-bit type representing elapsed time since UNIX +# epoch (1970-01-01), stored in either of two units: +# +# * Milliseconds (64 bits) indicating UNIX time elapsed since the epoch (no +# leap seconds), where the values are evenly divisible by 86400000 +# * Days (32 bits) since the UNIX epoch +class Date(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsDate(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Date() + x.Init(buf, n + offset) + return x + + # Date + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Date + def Unit(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 1 + +def DateStart(builder): builder.StartObject(1) +def DateAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 1) +def DateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/DateUnit.py b/python/generated/org/apache/arrow/flatbuf/DateUnit.py new file mode 100644 index 0000000000000..882d6b4fc4f07 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/DateUnit.py @@ -0,0 +1,8 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class DateUnit(object): + DAY = 0 + MILLISECOND = 1 + diff --git a/python/generated/org/apache/arrow/flatbuf/Decimal.py b/python/generated/org/apache/arrow/flatbuf/Decimal.py new file mode 100644 index 0000000000000..083b254238f7e --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Decimal.py @@ -0,0 +1,56 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Exact decimal value represented as an integer value in two's +# complement. Currently only 128-bit (16-byte) and 256-bit (32-byte) integers +# are used. The representation uses the endianness indicated +# in the Schema. +class Decimal(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsDecimal(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Decimal() + x.Init(buf, n + offset) + return x + + # Decimal + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Total number of decimal digits + # Decimal + def Precision(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + + # Number of digits after the decimal point "." + # Decimal + def Scale(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + + # Number of bits per value. The only accepted widths are 128 and 256. + # We use bitWidth for consistency with Int::bitWidth. + # Decimal + def BitWidth(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 128 + +def DecimalStart(builder): builder.StartObject(3) +def DecimalAddPrecision(builder, precision): builder.PrependInt32Slot(0, precision, 0) +def DecimalAddScale(builder, scale): builder.PrependInt32Slot(1, scale, 0) +def DecimalAddBitWidth(builder, bitWidth): builder.PrependInt32Slot(2, bitWidth, 128) +def DecimalEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py b/python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py new file mode 100644 index 0000000000000..86a8122b4a707 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py @@ -0,0 +1,72 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class DictionaryEncoding(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsDictionaryEncoding(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = DictionaryEncoding() + x.Init(buf, n + offset) + return x + + # DictionaryEncoding + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # The known dictionary id in the application where this data is used. In + # the file or streaming formats, the dictionary ids are found in the + # DictionaryBatch messages + # DictionaryEncoding + def Id(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) + return 0 + + # The dictionary indices are constrained to be non-negative integers. If + # this field is null, the indices must be signed int32. To maximize + # cross-language compatibility and performance, implementations are + # recommended to prefer signed integer types over unsigned integer types + # and to avoid uint64 indices unless they are required by an application. + # DictionaryEncoding + def IndexType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.Int import Int + obj = Int() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # By default, dictionaries are not ordered, or the order does not have + # semantic meaning. In some statistical, applications, dictionary-encoding + # is used to represent ordered categorical data, and we provide a way to + # preserve that metadata here + # DictionaryEncoding + def IsOrdered(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) + return False + + # DictionaryEncoding + def DictionaryKind(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 0 + +def DictionaryEncodingStart(builder): builder.StartObject(4) +def DictionaryEncodingAddId(builder, id): builder.PrependInt64Slot(0, id, 0) +def DictionaryEncodingAddIndexType(builder, indexType): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(indexType), 0) +def DictionaryEncodingAddIsOrdered(builder, isOrdered): builder.PrependBoolSlot(2, isOrdered, 0) +def DictionaryEncodingAddDictionaryKind(builder, dictionaryKind): builder.PrependInt16Slot(3, dictionaryKind, 0) +def DictionaryEncodingEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/DictionaryKind.py b/python/generated/org/apache/arrow/flatbuf/DictionaryKind.py new file mode 100644 index 0000000000000..6a78b442fa8e0 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/DictionaryKind.py @@ -0,0 +1,12 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# ---------------------------------------------------------------------- +# Dictionary encoding metadata +# Maintained for forwards compatibility, in the future +# Dictionaries might be explicit maps between integers and values +# allowing for non-contiguous index values +class DictionaryKind(object): + DenseArray = 0 + diff --git a/python/generated/org/apache/arrow/flatbuf/Duration.py b/python/generated/org/apache/arrow/flatbuf/Duration.py new file mode 100644 index 0000000000000..6478ad973cb9e --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Duration.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Duration(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsDuration(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Duration() + x.Init(buf, n + offset) + return x + + # Duration + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Duration + def Unit(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 1 + +def DurationStart(builder): builder.StartObject(1) +def DurationAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 1) +def DurationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Endianness.py b/python/generated/org/apache/arrow/flatbuf/Endianness.py new file mode 100644 index 0000000000000..8f93354fd1e7e --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Endianness.py @@ -0,0 +1,10 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# ---------------------------------------------------------------------- +# Endianness of the platform producing the data +class Endianness(object): + Little = 0 + Big = 1 + diff --git a/python/generated/org/apache/arrow/flatbuf/Feature.py b/python/generated/org/apache/arrow/flatbuf/Feature.py new file mode 100644 index 0000000000000..42661cc65ddef --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Feature.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# Represents Arrow Features that might not have full support +# within implementations. This is intended to be used in +# two scenarios: +# 1. A mechanism for readers of Arrow Streams +# and files to understand that the stream or file makes +# use of a feature that isn't supported or unknown to +# the implementation (and therefore can meet the Arrow +# forward compatibility guarantees). +# 2. A means of negotiating between a client and server +# what features a stream is allowed to use. The enums +# values here are intented to represent higher level +# features, additional details maybe negotiated +# with key-value pairs specific to the protocol. +# +# Enums added to this list should be assigned power-of-two values +# to facilitate exchanging and comparing bitmaps for supported +# features. +class Feature(object): + # Needed to make flatbuffers happy. + UNUSED = 0 + # The stream makes use of multiple full dictionaries with the + # same ID and assumes clients implement dictionary replacement + # correctly. + DICTIONARY_REPLACEMENT = 1 + # The stream makes use of compressed bodies as described + # in Message.fbs. + COMPRESSED_BODY = 2 + diff --git a/python/generated/org/apache/arrow/flatbuf/Field.py b/python/generated/org/apache/arrow/flatbuf/Field.py new file mode 100644 index 0000000000000..cae8ce2faadae --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Field.py @@ -0,0 +1,135 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# ---------------------------------------------------------------------- +# A field represents a named column in a record / row batch or child of a +# nested type. +class Field(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsField(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Field() + x.Init(buf, n + offset) + return x + + # Field + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Name is not required, in i.e. a List + # Field + def Name(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # Whether or not this field can contain nulls. Should be true in general. + # Field + def Nullable(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) + return False + + # Field + def TypeType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) + return 0 + + # This is the type of the decoded value if the field is dictionary encoded. + # Field + def Type(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + from flatbuffers.table import Table + obj = Table(bytearray(), 0) + self._tab.Union(obj, o) + return obj + return None + + # Present only if the field is dictionary encoded. + # Field + def Dictionary(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) + if o != 0: + x = self._tab.Indirect(o + self._tab.Pos) + from org.apache.arrow.flatbuf.DictionaryEncoding import DictionaryEncoding + obj = DictionaryEncoding() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # children apply only to nested data types like Struct, List and Union. For + # primitive types children will have length 0. + # Field + def Children(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.flatbuf.Field import Field + obj = Field() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Field + def ChildrenLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Field + def ChildrenIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + return o == 0 + + # User-defined metadata + # Field + def CustomMetadata(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.flatbuf.KeyValue import KeyValue + obj = KeyValue() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Field + def CustomMetadataLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Field + def CustomMetadataIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) + return o == 0 + +def FieldStart(builder): builder.StartObject(7) +def FieldAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +def FieldAddNullable(builder, nullable): builder.PrependBoolSlot(1, nullable, 0) +def FieldAddTypeType(builder, typeType): builder.PrependUint8Slot(2, typeType, 0) +def FieldAddType(builder, type): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(type), 0) +def FieldAddDictionary(builder, dictionary): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(dictionary), 0) +def FieldAddChildren(builder, children): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(children), 0) +def FieldStartChildrenVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def FieldAddCustomMetadata(builder, customMetadata): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(customMetadata), 0) +def FieldStartCustomMetadataVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def FieldEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py b/python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py new file mode 100644 index 0000000000000..374b3e0302212 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py @@ -0,0 +1,33 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class FixedSizeBinary(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFixedSizeBinary(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = FixedSizeBinary() + x.Init(buf, n + offset) + return x + + # FixedSizeBinary + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Number of bytes per value + # FixedSizeBinary + def ByteWidth(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + +def FixedSizeBinaryStart(builder): builder.StartObject(1) +def FixedSizeBinaryAddByteWidth(builder, byteWidth): builder.PrependInt32Slot(0, byteWidth, 0) +def FixedSizeBinaryEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/FixedSizeList.py b/python/generated/org/apache/arrow/flatbuf/FixedSizeList.py new file mode 100644 index 0000000000000..0d64595c9ba50 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/FixedSizeList.py @@ -0,0 +1,33 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class FixedSizeList(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFixedSizeList(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = FixedSizeList() + x.Init(buf, n + offset) + return x + + # FixedSizeList + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Number of list items per value + # FixedSizeList + def ListSize(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + +def FixedSizeListStart(builder): builder.StartObject(1) +def FixedSizeListAddListSize(builder, listSize): builder.PrependInt32Slot(0, listSize, 0) +def FixedSizeListEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/FloatingPoint.py b/python/generated/org/apache/arrow/flatbuf/FloatingPoint.py new file mode 100644 index 0000000000000..77f9d1291e966 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/FloatingPoint.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class FloatingPoint(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFloatingPoint(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = FloatingPoint() + x.Init(buf, n + offset) + return x + + # FloatingPoint + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # FloatingPoint + def Precision(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 0 + +def FloatingPointStart(builder): builder.StartObject(1) +def FloatingPointAddPrecision(builder, precision): builder.PrependInt16Slot(0, precision, 0) +def FloatingPointEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Int.py b/python/generated/org/apache/arrow/flatbuf/Int.py new file mode 100644 index 0000000000000..cdd4ffe6d2ee6 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Int.py @@ -0,0 +1,40 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Int(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInt(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Int() + x.Init(buf, n + offset) + return x + + # Int + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Int + def BitWidth(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 0 + + # Int + def IsSigned(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) + return False + +def IntStart(builder): builder.StartObject(2) +def IntAddBitWidth(builder, bitWidth): builder.PrependInt32Slot(0, bitWidth, 0) +def IntAddIsSigned(builder, isSigned): builder.PrependBoolSlot(1, isSigned, 0) +def IntEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Interval.py b/python/generated/org/apache/arrow/flatbuf/Interval.py new file mode 100644 index 0000000000000..7752c14b65996 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Interval.py @@ -0,0 +1,32 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class Interval(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsInterval(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Interval() + x.Init(buf, n + offset) + return x + + # Interval + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Interval + def Unit(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 0 + +def IntervalStart(builder): builder.StartObject(1) +def IntervalAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 0) +def IntervalEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/IntervalUnit.py b/python/generated/org/apache/arrow/flatbuf/IntervalUnit.py new file mode 100644 index 0000000000000..f5abddb0e6419 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/IntervalUnit.py @@ -0,0 +1,8 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class IntervalUnit(object): + YEAR_MONTH = 0 + DAY_TIME = 1 + diff --git a/python/generated/org/apache/arrow/flatbuf/KeyValue.py b/python/generated/org/apache/arrow/flatbuf/KeyValue.py new file mode 100644 index 0000000000000..8b70825f6ec53 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/KeyValue.py @@ -0,0 +1,43 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# ---------------------------------------------------------------------- +# user defined key value pairs to add custom metadata to arrow +# key namespacing is the responsibility of the user +class KeyValue(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsKeyValue(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = KeyValue() + x.Init(buf, n + offset) + return x + + # KeyValue + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # KeyValue + def Key(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + + # KeyValue + def Value(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def KeyValueStart(builder): builder.StartObject(2) +def KeyValueAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0) +def KeyValueAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) +def KeyValueEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/LargeBinary.py b/python/generated/org/apache/arrow/flatbuf/LargeBinary.py new file mode 100644 index 0000000000000..3e8db74ab220e --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/LargeBinary.py @@ -0,0 +1,26 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Same as Binary, but with 64-bit offsets, allowing to represent +# extremely large data values. +class LargeBinary(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLargeBinary(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = LargeBinary() + x.Init(buf, n + offset) + return x + + # LargeBinary + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def LargeBinaryStart(builder): builder.StartObject(0) +def LargeBinaryEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/LargeList.py b/python/generated/org/apache/arrow/flatbuf/LargeList.py new file mode 100644 index 0000000000000..43419f07f9157 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/LargeList.py @@ -0,0 +1,26 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Same as List, but with 64-bit offsets, allowing to represent +# extremely large data values. +class LargeList(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLargeList(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = LargeList() + x.Init(buf, n + offset) + return x + + # LargeList + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def LargeListStart(builder): builder.StartObject(0) +def LargeListEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/LargeUtf8.py b/python/generated/org/apache/arrow/flatbuf/LargeUtf8.py new file mode 100644 index 0000000000000..744d73183bb6b --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/LargeUtf8.py @@ -0,0 +1,26 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Same as Utf8, but with 64-bit offsets, allowing to represent +# extremely large data values. +class LargeUtf8(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLargeUtf8(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = LargeUtf8() + x.Init(buf, n + offset) + return x + + # LargeUtf8 + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def LargeUtf8Start(builder): builder.StartObject(0) +def LargeUtf8End(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/List.py b/python/generated/org/apache/arrow/flatbuf/List.py new file mode 100644 index 0000000000000..84e3cdd015fd1 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/List.py @@ -0,0 +1,24 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +class List(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsList(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = List() + x.Init(buf, n + offset) + return x + + # List + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def ListStart(builder): builder.StartObject(0) +def ListEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Map.py b/python/generated/org/apache/arrow/flatbuf/Map.py new file mode 100644 index 0000000000000..d3187bff1fb9c --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Map.py @@ -0,0 +1,58 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A Map is a logical nested type that is represented as +# +# List> +# +# In this layout, the keys and values are each respectively contiguous. We do +# not constrain the key and value types, so the application is responsible +# for ensuring that the keys are hashable and unique. Whether the keys are sorted +# may be set in the metadata for this field. +# +# In a field with Map type, the field has a child Struct field, which then +# has two children: key type and the second the value type. The names of the +# child fields may be respectively "entries", "key", and "value", but this is +# not enforced. +# +# Map +# ```text +# - child[0] entries: Struct +# - child[0] key: K +# - child[1] value: V +# ``` +# Neither the "entries" field nor the "key" field may be nullable. +# +# The metadata is structured so that Arrow systems without special handling +# for Map can make Map an alias for List. The "layout" attribute for the Map +# field must have the same contents as a List. +class Map(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsMap(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Map() + x.Init(buf, n + offset) + return x + + # Map + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Set to true if the keys within each value are sorted + # Map + def KeysSorted(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) + return False + +def MapStart(builder): builder.StartObject(1) +def MapAddKeysSorted(builder, keysSorted): builder.PrependBoolSlot(0, keysSorted, 0) +def MapEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/MetadataVersion.py b/python/generated/org/apache/arrow/flatbuf/MetadataVersion.py new file mode 100644 index 0000000000000..5a3bd806c9e11 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/MetadataVersion.py @@ -0,0 +1,22 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class MetadataVersion(object): + # 0.1.0 (October 2016). + V1 = 0 + # 0.2.0 (February 2017). Non-backwards compatible with V1. + V2 = 1 + # 0.3.0 -> 0.7.1 (May - December 2017). Non-backwards compatible with V2. + V3 = 2 + # >= 0.8.0 (December 2017). Non-backwards compatible with V3. + V4 = 3 + # >= 1.0.0 (July 2020. Backwards compatible with V4 (V5 readers can read V4 + # metadata and IPC messages). Implementations are recommended to provide a + # V4 compatibility mode with V5 format changes disabled. + # + # Incompatible changes between V4 and V5: + # - Union buffer layout has changed. In V5, Unions don't have a validity + # bitmap buffer. + V5 = 4 + diff --git a/python/generated/org/apache/arrow/flatbuf/Null.py b/python/generated/org/apache/arrow/flatbuf/Null.py new file mode 100644 index 0000000000000..a6dcc0f7559fd --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Null.py @@ -0,0 +1,25 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# These are stored in the flatbuffer in the Type union below +class Null(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNull(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Null() + x.Init(buf, n + offset) + return x + + # Null + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def NullStart(builder): builder.StartObject(0) +def NullEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Precision.py b/python/generated/org/apache/arrow/flatbuf/Precision.py new file mode 100644 index 0000000000000..655d0f5ea4f59 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Precision.py @@ -0,0 +1,9 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class Precision(object): + HALF = 0 + SINGLE = 1 + DOUBLE = 2 + diff --git a/python/generated/org/apache/arrow/flatbuf/Schema.py b/python/generated/org/apache/arrow/flatbuf/Schema.py new file mode 100644 index 0000000000000..394e784979071 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Schema.py @@ -0,0 +1,121 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# ---------------------------------------------------------------------- +# A Schema describes the columns in a row batch +class Schema(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSchema(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Schema() + x.Init(buf, n + offset) + return x + + # Schema + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # endianness of the buffer + # it is Little Endian by default + # if endianness doesn't match the underlying system then the vectors need to be converted + # Schema + def Endianness(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 0 + + # Schema + def Fields(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.flatbuf.Field import Field + obj = Field() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Schema + def FieldsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Schema + def FieldsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + return o == 0 + + # Schema + def CustomMetadata(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + x = self._tab.Vector(o) + x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 + x = self._tab.Indirect(x) + from org.apache.arrow.flatbuf.KeyValue import KeyValue + obj = KeyValue() + obj.Init(self._tab.Bytes, x) + return obj + return None + + # Schema + def CustomMetadataLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Schema + def CustomMetadataIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + return o == 0 + + # Features used in the stream/file. + # Schema + def Features(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) + return 0 + + # Schema + def FeaturesAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o) + return 0 + + # Schema + def FeaturesLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Schema + def FeaturesIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + return o == 0 + +def SchemaStart(builder): builder.StartObject(4) +def SchemaAddEndianness(builder, endianness): builder.PrependInt16Slot(0, endianness, 0) +def SchemaAddFields(builder, fields): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(fields), 0) +def SchemaStartFieldsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def SchemaAddCustomMetadata(builder, customMetadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(customMetadata), 0) +def SchemaStartCustomMetadataVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def SchemaAddFeatures(builder, features): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(features), 0) +def SchemaStartFeaturesVector(builder, numElems): return builder.StartVector(8, numElems, 8) +def SchemaEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Struct_.py b/python/generated/org/apache/arrow/flatbuf/Struct_.py new file mode 100644 index 0000000000000..889b171bf40f5 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Struct_.py @@ -0,0 +1,27 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A Struct_ in the flatbuffer metadata is the same as an Arrow Struct +# (according to the physical memory layout). We used Struct_ here as +# Struct is a reserved word in Flatbuffers +class Struct_(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsStruct_(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Struct_() + x.Init(buf, n + offset) + return x + + # Struct_ + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def Struct_Start(builder): builder.StartObject(0) +def Struct_End(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Time.py b/python/generated/org/apache/arrow/flatbuf/Time.py new file mode 100644 index 0000000000000..5f9a663aa9291 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Time.py @@ -0,0 +1,43 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Time type. The physical storage type depends on the unit +# - SECOND and MILLISECOND: 32 bits +# - MICROSECOND and NANOSECOND: 64 bits +class Time(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsTime(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Time() + x.Init(buf, n + offset) + return x + + # Time + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Time + def Unit(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 1 + + # Time + def BitWidth(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 32 + +def TimeStart(builder): builder.StartObject(2) +def TimeAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 1) +def TimeAddBitWidth(builder, bitWidth): builder.PrependInt32Slot(1, bitWidth, 32) +def TimeEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/TimeUnit.py b/python/generated/org/apache/arrow/flatbuf/TimeUnit.py new file mode 100644 index 0000000000000..1ebf9b72f3e37 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/TimeUnit.py @@ -0,0 +1,10 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class TimeUnit(object): + SECOND = 0 + MILLISECOND = 1 + MICROSECOND = 2 + NANOSECOND = 3 + diff --git a/python/generated/org/apache/arrow/flatbuf/Timestamp.py b/python/generated/org/apache/arrow/flatbuf/Timestamp.py new file mode 100644 index 0000000000000..606594abfff2b --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Timestamp.py @@ -0,0 +1,89 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Time elapsed from the Unix epoch, 00:00:00.000 on 1 January 1970, excluding +# leap seconds, as a 64-bit integer. Note that UNIX time does not include +# leap seconds. +# +# Date & time libraries often have multiple different data types for temporal +# data. In order to ease interoperability between different implementations the +# Arrow project has some recommendations for encoding these types into a Timestamp +# column. +# +# An "instant" represents a single moment in time that has no meaningful time zone +# or the time zone is unknown. A column of instants can also contain values from +# multiple time zones. To encode an instant set the timezone string to "UTC". +# +# A "zoned date-time" represents a single moment in time that has a meaningful +# reference time zone. To encode a zoned date-time as a Timestamp set the timezone +# string to the name of the timezone. There is some ambiguity between an instant +# and a zoned date-time with the UTC time zone. Both of these are stored the same. +# Typically, this distinction does not matter. If it does, then an application should +# use custom metadata or an extension type to distinguish between the two cases. +# +# An "offset date-time" represents a single moment in time combined with a meaningful +# offset from UTC. To encode an offset date-time as a Timestamp set the timezone string +# to the numeric time zone offset string (e.g. "+03:00"). +# +# A "local date-time" does not represent a single moment in time. It represents a wall +# clock time combined with a date. Because of daylight savings time there may multiple +# instants that correspond to a single local date-time in any given time zone. A +# local date-time is often stored as a struct or a Date32/Time64 pair. However, it can +# also be encoded into a Timestamp column. To do so the value should be the the time +# elapsed from the Unix epoch so that a wall clock in UTC would display the desired time. +# The timezone string should be set to null or the empty string. +class Timestamp(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsTimestamp(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Timestamp() + x.Init(buf, n + offset) + return x + + # Timestamp + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Timestamp + def Unit(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 0 + + # The time zone is a string indicating the name of a time zone, one of: + # + # * As used in the Olson time zone database (the "tz database" or + # "tzdata"), such as "America/New_York" + # * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30 + # + # Whether a timezone string is present indicates different semantics about + # the data: + # + # * If the time zone is null or an empty string, the data is a local date-time + # and does not represent a single moment in time. Instead it represents a wall clock + # time and care should be taken to avoid interpreting it semantically as an instant. + # + # * If the time zone is set to a valid value, values can be displayed as + # "localized" to that time zone, even though the underlying 64-bit + # integers are identical to the same data stored in UTC. Converting + # between time zones is a metadata-only operation and does not change the + # underlying values + # Timestamp + def Timezone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.String(o + self._tab.Pos) + return None + +def TimestampStart(builder): builder.StartObject(2) +def TimestampAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 0) +def TimestampAddTimezone(builder, timezone): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(timezone), 0) +def TimestampEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Type.py b/python/generated/org/apache/arrow/flatbuf/Type.py new file mode 100644 index 0000000000000..4057739760a73 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Type.py @@ -0,0 +1,31 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +# ---------------------------------------------------------------------- +# Top-level Type value, enabling extensible type-specific metadata. We can +# add new logical types to Type without breaking backwards compatibility +class Type(object): + NONE = 0 + Null = 1 + Int = 2 + FloatingPoint = 3 + Binary = 4 + Utf8 = 5 + Bool = 6 + Decimal = 7 + Date = 8 + Time = 9 + Timestamp = 10 + Interval = 11 + List = 12 + Struct_ = 13 + Union = 14 + FixedSizeBinary = 15 + FixedSizeList = 16 + Map = 17 + Duration = 18 + LargeBinary = 19 + LargeUtf8 = 20 + LargeList = 21 + diff --git a/python/generated/org/apache/arrow/flatbuf/Union.py b/python/generated/org/apache/arrow/flatbuf/Union.py new file mode 100644 index 0000000000000..406b7f25f1ee6 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Union.py @@ -0,0 +1,65 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# A union is a complex type with children in Field +# By default ids in the type vector refer to the offsets in the children +# optionally typeIds provides an indirection between the child offset and the type id +# for each child `typeIds[offset]` is the id used in the type vector +class Union(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUnion(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Union() + x.Init(buf, n + offset) + return x + + # Union + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # Union + def Mode(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) + return 0 + + # Union + def TypeIds(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) + return 0 + + # Union + def TypeIdsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) + return 0 + + # Union + def TypeIdsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + + # Union + def TypeIdsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + return o == 0 + +def UnionStart(builder): builder.StartObject(2) +def UnionAddMode(builder, mode): builder.PrependInt16Slot(0, mode, 0) +def UnionAddTypeIds(builder, typeIds): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(typeIds), 0) +def UnionStartTypeIdsVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def UnionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/UnionMode.py b/python/generated/org/apache/arrow/flatbuf/UnionMode.py new file mode 100644 index 0000000000000..f698907667575 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/UnionMode.py @@ -0,0 +1,8 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +class UnionMode(object): + Sparse = 0 + Dense = 1 + diff --git a/python/generated/org/apache/arrow/flatbuf/Utf8.py b/python/generated/org/apache/arrow/flatbuf/Utf8.py new file mode 100644 index 0000000000000..0c2ccc9394586 --- /dev/null +++ b/python/generated/org/apache/arrow/flatbuf/Utf8.py @@ -0,0 +1,25 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: flatbuf + +import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() + +# Unicode with UTF-8 encoding +class Utf8(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsUtf8(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = Utf8() + x.Init(buf, n + offset) + return x + + # Utf8 + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + +def Utf8Start(builder): builder.StartObject(0) +def Utf8End(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/__init__.py b/python/generated/org/apache/arrow/flatbuf/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d From 4953530a2c97a64435eca9e18e2188c25d8b2d83 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:46:19 -0400 Subject: [PATCH 28/96] Clean up shell script and add Python compute IR compilation --- cpp/build-support/update-flatbuffers.sh | 49 ++++++++++++++++--------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/cpp/build-support/update-flatbuffers.sh b/cpp/build-support/update-flatbuffers.sh index 5c1528e5cb671..42a1fee625407 100755 --- a/cpp/build-support/update-flatbuffers.sh +++ b/cpp/build-support/update-flatbuffers.sh @@ -20,24 +20,37 @@ # Run this from cpp/ directory. flatc is expected to be in your path +set -o pipefail +set -o errexit +set -o nounset + CWD="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)" SOURCE_DIR=$CWD/../src +PYTHON_SOURCE_DIR=$CWD/../../python FORMAT_DIR=$CWD/../../format -FLATC="flatc --cpp --grpc --cpp-std c++11" - -$FLATC -o $SOURCE_DIR/generated \ - --scoped-enums \ - $FORMAT_DIR/ComputeIR.fbs \ - $FORMAT_DIR/ComputeIR.ExampleExtensions.fbs \ - $FORMAT_DIR/Message.fbs \ - $FORMAT_DIR/File.fbs \ - $FORMAT_DIR/Schema.fbs \ - $FORMAT_DIR/Tensor.fbs \ - $FORMAT_DIR/SparseTensor.fbs \ - $SOURCE_DIR/arrow/ipc/feather.fbs - -$FLATC -o $SOURCE_DIR/plasma \ - --gen-object-api \ - --scoped-enums \ - $SOURCE_DIR/plasma/common.fbs \ - $SOURCE_DIR/plasma/plasma.fbs +FLATC="flatc" + +OUT_DIR="$SOURCE_DIR/generated" +FILES=($(find $FORMAT_DIR -name '*.fbs')) +FILES+=($SOURCE_DIR/arrow/ipc/feather.fbs) + +COMPUTE_IR_FILES=($(find $FORMAT_DIR/experimental/computeir -name '*.fbs')) +COMPUTE_IR_FILES+=($FORMAT_DIR/Schema.fbs) + +$FLATC --cpp --cpp-std c++11 \ + --scoped-enums \ + -o $SOURCE_DIR/generated \ + "${FILES[@]}" + +# Only generate compute IR files for Python for now +$FLATC --python \ + -o $PYTHON_SOURCE_DIR/generated \ + "${COMPUTE_IR_FILES[@]}" + +PLASMA_FBS=($SOURCE_DIR/plasma/{plasma,common}.fbs) + +$FLATC --cpp --cpp-std c++11 \ + -o $SOURCE_DIR/plasma \ + --gen-object-api \ + --scoped-enums \ + "${PLASMA_FBS[@]}" From ee1e6968d97cdc8035d4764ef4194f54db6426de Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:46:34 -0400 Subject: [PATCH 29/96] Add generated C++ code --- .../ComputeIR.ExampleExtensions_generated.h | 99 +- cpp/src/generated/ComputeIR_generated.h | 2966 +++++++++++------ .../generated/ExampleExtensions_generated.h | 691 ++++ cpp/src/generated/Expression_generated.h | 2657 +++++++++++++++ cpp/src/generated/InlineBuffer_generated.h | 957 ++++++ cpp/src/generated/Literal_generated.h | 1981 +++++++++++ cpp/src/generated/Plan_generated.h | 132 + cpp/src/generated/Relation_generated.h | 2049 ++++++++++++ 8 files changed, 10556 insertions(+), 976 deletions(-) create mode 100644 cpp/src/generated/ExampleExtensions_generated.h create mode 100644 cpp/src/generated/Expression_generated.h create mode 100644 cpp/src/generated/InlineBuffer_generated.h create mode 100644 cpp/src/generated/Literal_generated.h create mode 100644 cpp/src/generated/Plan_generated.h create mode 100644 cpp/src/generated/Relation_generated.h diff --git a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h index a378f7a931e55..29ff7d5e434a5 100644 --- a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h +++ b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h @@ -1,19 +1,20 @@ // automatically generated by the FlatBuffers compiler, do not modify -#ifndef FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_EXT_H_ -#define FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_EXT_H_ +#ifndef FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ +#define FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ #include "flatbuffers/flatbuffers.h" -#include "ComputeIR_generated.h" #include "Schema_generated.h" +#include "ComputeIR_generated.h" +#include "IRLiteral_generated.h" namespace org { namespace apache { namespace arrow { -namespace flatbuf { namespace computeir { +namespace flatbuf { namespace ext { struct Uri; @@ -67,8 +68,8 @@ struct Uri FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const flatbuffers::String *path() const { return GetPointer(VT_PATH); } - const flatbuffers::Vector> *query() const { - return GetPointer> *>(VT_QUERY); + const flatbuffers::Vector> *query() const { + return GetPointer> *>(VT_QUERY); } const flatbuffers::String *fragment() const { return GetPointer(VT_FRAGMENT); @@ -112,7 +113,7 @@ struct UriBuilder { void add_path(flatbuffers::Offset path) { fbb_.AddOffset(Uri::VT_PATH, path); } - void add_query(flatbuffers::Offset>> query) { + void add_query(flatbuffers::Offset>> query) { fbb_.AddOffset(Uri::VT_QUERY, query); } void add_fragment(flatbuffers::Offset fragment) { @@ -140,7 +141,7 @@ inline flatbuffers::Offset CreateUri( flatbuffers::Offset host = 0, uint16_t port = 0, flatbuffers::Offset path = 0, - flatbuffers::Offset>> query = 0, + flatbuffers::Offset>> query = 0, flatbuffers::Offset fragment = 0) { UriBuilder builder_(_fbb); builder_.add_fragment(fragment); @@ -160,15 +161,15 @@ inline flatbuffers::Offset CreateUriDirect( const char *host = nullptr, uint16_t port = 0, const char *path = nullptr, - const std::vector> *query = nullptr, + const std::vector> *query = nullptr, const char *fragment = nullptr) { auto schema__ = schema ? _fbb.CreateString(schema) : 0; auto userinfo__ = userinfo ? _fbb.CreateString(userinfo) : 0; auto host__ = host ? _fbb.CreateString(host) : 0; auto path__ = path ? _fbb.CreateString(path) : 0; - auto query__ = query ? _fbb.CreateVector>(*query) : 0; + auto query__ = query ? _fbb.CreateVector>(*query) : 0; auto fragment__ = fragment ? _fbb.CreateString(fragment) : 0; - return org::apache::arrow::flatbuf::computeir::ext::CreateUri( + return org::apache::arrow::computeir::flatbuf::ext::CreateUri( _fbb, schema__, userinfo__, @@ -233,7 +234,7 @@ inline flatbuffers::Offset CreateSql_FromOptionsDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *name = nullptr) { auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::flatbuf::computeir::ext::CreateSql_FromOptions( + return org::apache::arrow::computeir::flatbuf::ext::CreateSql_FromOptions( _fbb, name__); } @@ -301,7 +302,7 @@ inline flatbuffers::Offset CreatePartitioningDirect( const char *flavor = nullptr, flatbuffers::Offset schema = 0) { auto flavor__ = flavor ? _fbb.CreateString(flavor) : 0; - return org::apache::arrow::flatbuf::computeir::ext::CreatePartitioning( + return org::apache::arrow::computeir::flatbuf::ext::CreatePartitioning( _fbb, flavor__, schema); @@ -367,7 +368,7 @@ inline flatbuffers::Offset CreateFileFormatDirect( const char *name = nullptr, const org::apache::arrow::flatbuf::Buffer *options = 0) { auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::flatbuf::computeir::ext::CreateFileFormat( + return org::apache::arrow::computeir::flatbuf::ext::CreateFileFormat( _fbb, name__, options); @@ -388,16 +389,16 @@ struct Arrow_FileSystemDatasetScanOptions FLATBUFFERS_FINAL_CLASS : private flat /// The base directory of a dataset which should be scanned /// as a source relation. A URI is used to accommodate potentially /// remote file systems. - const org::apache::arrow::flatbuf::computeir::ext::Uri *base_dir() const { - return GetPointer(VT_BASE_DIR); + const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { + return GetPointer(VT_BASE_DIR); } /// The format of files in this dataset. - const org::apache::arrow::flatbuf::computeir::ext::FileFormat *format() const { - return GetPointer(VT_FORMAT); + const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { + return GetPointer(VT_FORMAT); } /// A partitioning scheme in use in this dataset. - const org::apache::arrow::flatbuf::computeir::ext::Partitioning *partitioning() const { - return GetPointer(VT_PARTITIONING); + const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { + return GetPointer(VT_PARTITIONING); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -415,13 +416,13 @@ struct Arrow_FileSystemDatasetScanOptionsBuilder { typedef Arrow_FileSystemDatasetScanOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_base_dir(flatbuffers::Offset base_dir) { + void add_base_dir(flatbuffers::Offset base_dir) { fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR, base_dir); } - void add_format(flatbuffers::Offset format) { + void add_format(flatbuffers::Offset format) { fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_FORMAT, format); } - void add_partitioning(flatbuffers::Offset partitioning) { + void add_partitioning(flatbuffers::Offset partitioning) { fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_PARTITIONING, partitioning); } explicit Arrow_FileSystemDatasetScanOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) @@ -440,9 +441,9 @@ struct Arrow_FileSystemDatasetScanOptionsBuilder { inline flatbuffers::Offset CreateArrow_FileSystemDatasetScanOptions( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0) { + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0) { Arrow_FileSystemDatasetScanOptionsBuilder builder_(_fbb); builder_.add_partitioning(partitioning); builder_.add_format(format); @@ -519,7 +520,7 @@ inline flatbuffers::Offset CreateSql_IntoOptionsDirect( const char *name = nullptr, bool append = true) { auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::flatbuf::computeir::ext::CreateSql_IntoOptions( + return org::apache::arrow::computeir::flatbuf::ext::CreateSql_IntoOptions( _fbb, name__, append); @@ -536,8 +537,8 @@ struct Arrow_StreamOutOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tab VT_DESTINATION = 4 }; /// The URI to which RecordBatches of output should be streamed. - const org::apache::arrow::flatbuf::computeir::ext::Uri *destination() const { - return GetPointer(VT_DESTINATION); + const org::apache::arrow::computeir::flatbuf::ext::Uri *destination() const { + return GetPointer(VT_DESTINATION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -551,7 +552,7 @@ struct Arrow_StreamOutOptionsBuilder { typedef Arrow_StreamOutOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_destination(flatbuffers::Offset destination) { + void add_destination(flatbuffers::Offset destination) { fbb_.AddOffset(Arrow_StreamOutOptions::VT_DESTINATION, destination); } explicit Arrow_StreamOutOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) @@ -569,7 +570,7 @@ struct Arrow_StreamOutOptionsBuilder { inline flatbuffers::Offset CreateArrow_StreamOutOptions( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset destination = 0) { + flatbuffers::Offset destination = 0) { Arrow_StreamOutOptionsBuilder builder_(_fbb); builder_.add_destination(destination); return builder_.Finish(); @@ -592,16 +593,16 @@ struct Arrow_FileSystemDatasetWriteOptions FLATBUFFERS_FINAL_CLASS : private fla /// written. A URI is used to accommodate potentially remote file systems. /// Files present in this directory will not be explicitly deleted, though /// they may be overwritten. - const org::apache::arrow::flatbuf::computeir::ext::Uri *base_dir() const { - return GetPointer(VT_BASE_DIR); + const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { + return GetPointer(VT_BASE_DIR); } /// The format in which to write files. - const org::apache::arrow::flatbuf::computeir::ext::FileFormat *format() const { - return GetPointer(VT_FORMAT); + const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { + return GetPointer(VT_FORMAT); } /// A partitioning scheme which should be used when writing this dataset. - const org::apache::arrow::flatbuf::computeir::ext::Partitioning *partitioning() const { - return GetPointer(VT_PARTITIONING); + const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { + return GetPointer(VT_PARTITIONING); } /// Template string used to generate written files' basenames. /// {i} will be replaced by an auto incremented integer. @@ -626,13 +627,13 @@ struct Arrow_FileSystemDatasetWriteOptionsBuilder { typedef Arrow_FileSystemDatasetWriteOptions Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_base_dir(flatbuffers::Offset base_dir) { + void add_base_dir(flatbuffers::Offset base_dir) { fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR, base_dir); } - void add_format(flatbuffers::Offset format) { + void add_format(flatbuffers::Offset format) { fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_FORMAT, format); } - void add_partitioning(flatbuffers::Offset partitioning) { + void add_partitioning(flatbuffers::Offset partitioning) { fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_PARTITIONING, partitioning); } void add_basename_template(flatbuffers::Offset basename_template) { @@ -655,9 +656,9 @@ struct Arrow_FileSystemDatasetWriteOptionsBuilder { inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptions( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0, flatbuffers::Offset basename_template = 0) { Arrow_FileSystemDatasetWriteOptionsBuilder builder_(_fbb); builder_.add_basename_template(basename_template); @@ -669,12 +670,12 @@ inline flatbuffers::Offset CreateArrow_File inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptionsDirect( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0, const char *basename_template = nullptr) { auto basename_template__ = basename_template ? _fbb.CreateString(basename_template) : 0; - return org::apache::arrow::flatbuf::computeir::ext::CreateArrow_FileSystemDatasetWriteOptions( + return org::apache::arrow::computeir::flatbuf::ext::CreateArrow_FileSystemDatasetWriteOptions( _fbb, base_dir, format, @@ -683,10 +684,10 @@ inline flatbuffers::Offset CreateArrow_File } } // namespace ext -} // namespace computeir } // namespace flatbuf +} // namespace computeir } // namespace arrow } // namespace apache } // namespace org -#endif // FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_EXT_H_ +#endif // FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h index ac7d329ac1bfb..b9f484ec1f248 100644 --- a/cpp/src/generated/ComputeIR_generated.h +++ b/cpp/src/generated/ComputeIR_generated.h @@ -1,18 +1,19 @@ // automatically generated by the FlatBuffers compiler, do not modify -#ifndef FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_H_ -#define FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_H_ +#ifndef FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ +#define FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ #include "flatbuffers/flatbuffers.h" #include "Schema_generated.h" +#include "IRLiteral_generated.h" namespace org { namespace apache { namespace arrow { -namespace flatbuf { namespace computeir { +namespace flatbuf { struct Int8Buffer; struct Int8BufferBuilder; @@ -59,8 +60,20 @@ struct ScalarBuilder; struct Array; struct ArrayBuilder; -struct Literal; -struct LiteralBuilder; +struct MapKey; +struct MapKeyBuilder; + +struct StructField; +struct StructFieldBuilder; + +struct ArraySubscript; +struct ArraySubscriptBuilder; + +struct ArraySlice; +struct ArraySliceBuilder; + +struct FieldName; +struct FieldNameBuilder; struct FieldRef; struct FieldRefBuilder; @@ -74,23 +87,23 @@ struct NonCanonicalFunctionBuilder; struct Call; struct CallBuilder; -struct CanonicalOperation; -struct CanonicalOperationBuilder; +struct Remap; +struct RemapBuilder; -struct NonCanonicalOperation; -struct NonCanonicalOperationBuilder; +struct PassThrough; +struct PassThroughBuilder; -struct Relation; -struct RelationBuilder; +struct RelBase; +struct RelBaseBuilder; -struct FilterOptions; -struct FilterOptionsBuilder; +struct Filter; +struct FilterBuilder; -struct ProjectOptions; -struct ProjectOptionsBuilder; +struct Project; +struct ProjectBuilder; -struct AggregateOptions; -struct AggregateOptionsBuilder; +struct Aggregate; +struct AggregateBuilder; struct CanonicalJoinKind; struct CanonicalJoinKindBuilder; @@ -98,26 +111,44 @@ struct CanonicalJoinKindBuilder; struct NonCanonicalJoinKind; struct NonCanonicalJoinKindBuilder; -struct JoinOptions; -struct JoinOptionsBuilder; +struct Join; +struct JoinBuilder; struct SortKey; struct SortKeyBuilder; -struct OrderByOptions; -struct OrderByOptionsBuilder; +struct OrderBy; +struct OrderByBuilder; -struct LimitOptions; -struct LimitOptionsBuilder; +struct Limit; +struct LimitBuilder; -struct CommonOptions; -struct CommonOptionsBuilder; +struct Common; +struct CommonBuilder; -struct UnionOptions; -struct UnionOptionsBuilder; +struct CanonicalSetOpKind; +struct CanonicalSetOpKindBuilder; -struct LiteralOptions; -struct LiteralOptionsBuilder; +struct NonCanonicalSetOpKind; +struct NonCanonicalSetOpKindBuilder; + +struct SetOperation; +struct SetOperationBuilder; + +struct LiteralRelation; +struct LiteralRelationBuilder; + +struct Custom; +struct CustomBuilder; + +struct Read; +struct ReadBuilder; + +struct Write; +struct WriteBuilder; + +struct Relation; +struct RelationBuilder; struct Plan; struct PlanBuilder; @@ -186,47 +217,47 @@ template struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::NONE; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::Int8Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::Int16Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::Int32Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::Int64Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::UInt8Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::UInt16Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::UInt32Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::UInt64Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::Float32Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::Float64Buffer; }; -template<> struct InlineBufferImplTraits { +template<> struct InlineBufferImplTraits { static const InlineBufferImpl enum_value = InlineBufferImpl::TableBuffer; }; @@ -235,7 +266,7 @@ bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuf /// An expression is one of /// - a Literal datum -/// - a reference to a Field from a Relation +/// - a reference to a field from a Relation /// - a call to a named function /// On evaluation, an Expression will have either array or scalar shape. enum class ExpressionImpl : uint8_t { @@ -278,15 +309,15 @@ template struct ExpressionImplTraits { static const ExpressionImpl enum_value = ExpressionImpl::NONE; }; -template<> struct ExpressionImplTraits { +template<> struct ExpressionImplTraits { static const ExpressionImpl enum_value = ExpressionImpl::Literal; }; -template<> struct ExpressionImplTraits { +template<> struct ExpressionImplTraits { static const ExpressionImpl enum_value = ExpressionImpl::FieldRef; }; -template<> struct ExpressionImplTraits { +template<> struct ExpressionImplTraits { static const ExpressionImpl enum_value = ExpressionImpl::Call; }; @@ -330,17 +361,86 @@ template struct ShapeTraits { static const Shape enum_value = Shape::NONE; }; -template<> struct ShapeTraits { +template<> struct ShapeTraits { static const Shape enum_value = Shape::Array; }; -template<> struct ShapeTraits { +template<> struct ShapeTraits { static const Shape enum_value = Shape::Scalar; }; bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape type); bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); +enum class Deref : uint8_t { + NONE = 0, + MapKey = 1, + StructField = 2, + ArraySubscript = 3, + ArraySlice = 4, + FieldName = 5, + MIN = NONE, + MAX = FieldName +}; + +inline const Deref (&EnumValuesDeref())[6] { + static const Deref values[] = { + Deref::NONE, + Deref::MapKey, + Deref::StructField, + Deref::ArraySubscript, + Deref::ArraySlice, + Deref::FieldName + }; + return values; +} + +inline const char * const *EnumNamesDeref() { + static const char * const names[7] = { + "NONE", + "MapKey", + "StructField", + "ArraySubscript", + "ArraySlice", + "FieldName", + nullptr + }; + return names; +} + +inline const char *EnumNameDeref(Deref e) { + if (flatbuffers::IsOutRange(e, Deref::NONE, Deref::FieldName)) return ""; + const size_t index = static_cast(e); + return EnumNamesDeref()[index]; +} + +template struct DerefTraits { + static const Deref enum_value = Deref::NONE; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::MapKey; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::StructField; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::ArraySubscript; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::ArraySlice; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::FieldName; +}; + +bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type); +bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + /// A canonical (probably SQL equivalent) function enum class CanonicalFunctionId : uint32_t { And = 0, @@ -354,30 +454,32 @@ enum class CanonicalFunctionId : uint32_t { AbsoluteValue = 8, Negate = 9, Sign = 10, - Equal = 11, - NotEqual = 12, + Equals = 11, + NotEquals = 12, Greater = 13, - GreaterOrEqual = 14, + GreaterEqual = 14, Less = 15, - LessOrEqual = 16, + LessEqual = 16, All = 17, Any = 18, Count = 19, Mean = 20, Min = 21, Max = 22, - Mode = 23, - Product = 24, - Sum = 25, - Tdigest = 26, - Quantile = 27, - Variance = 28, - StandardDeviation = 29, + Product = 23, + Sum = 24, + Variance = 25, + StandardDeviation = 26, + Cast = 27, + Extract = 28, + Case = 29, + Coalesce = 30, + IsIn = 31, MIN = And, - MAX = StandardDeviation + MAX = IsIn }; -inline const CanonicalFunctionId (&EnumValuesCanonicalFunctionId())[30] { +inline const CanonicalFunctionId (&EnumValuesCanonicalFunctionId())[32] { static const CanonicalFunctionId values[] = { CanonicalFunctionId::And, CanonicalFunctionId::Not, @@ -390,31 +492,33 @@ inline const CanonicalFunctionId (&EnumValuesCanonicalFunctionId())[30] { CanonicalFunctionId::AbsoluteValue, CanonicalFunctionId::Negate, CanonicalFunctionId::Sign, - CanonicalFunctionId::Equal, - CanonicalFunctionId::NotEqual, + CanonicalFunctionId::Equals, + CanonicalFunctionId::NotEquals, CanonicalFunctionId::Greater, - CanonicalFunctionId::GreaterOrEqual, + CanonicalFunctionId::GreaterEqual, CanonicalFunctionId::Less, - CanonicalFunctionId::LessOrEqual, + CanonicalFunctionId::LessEqual, CanonicalFunctionId::All, CanonicalFunctionId::Any, CanonicalFunctionId::Count, CanonicalFunctionId::Mean, CanonicalFunctionId::Min, CanonicalFunctionId::Max, - CanonicalFunctionId::Mode, CanonicalFunctionId::Product, CanonicalFunctionId::Sum, - CanonicalFunctionId::Tdigest, - CanonicalFunctionId::Quantile, CanonicalFunctionId::Variance, - CanonicalFunctionId::StandardDeviation + CanonicalFunctionId::StandardDeviation, + CanonicalFunctionId::Cast, + CanonicalFunctionId::Extract, + CanonicalFunctionId::Case, + CanonicalFunctionId::Coalesce, + CanonicalFunctionId::IsIn }; return values; } inline const char * const *EnumNamesCanonicalFunctionId() { - static const char * const names[31] = { + static const char * const names[33] = { "And", "Not", "Or", @@ -426,37 +530,39 @@ inline const char * const *EnumNamesCanonicalFunctionId() { "AbsoluteValue", "Negate", "Sign", - "Equal", - "NotEqual", + "Equals", + "NotEquals", "Greater", - "GreaterOrEqual", + "GreaterEqual", "Less", - "LessOrEqual", + "LessEqual", "All", "Any", "Count", "Mean", "Min", "Max", - "Mode", "Product", "Sum", - "Tdigest", - "Quantile", "Variance", "StandardDeviation", + "Cast", + "Extract", + "Case", + "Coalesce", + "IsIn", nullptr }; return names; } inline const char *EnumNameCanonicalFunctionId(CanonicalFunctionId e) { - if (flatbuffers::IsOutRange(e, CanonicalFunctionId::And, CanonicalFunctionId::StandardDeviation)) return ""; + if (flatbuffers::IsOutRange(e, CanonicalFunctionId::And, CanonicalFunctionId::IsIn)) return ""; const size_t index = static_cast(e); return EnumNamesCanonicalFunctionId()[index]; } -enum class Function : uint8_t { +enum class FunctionImpl : uint8_t { NONE = 0, CanonicalFunction = 1, NonCanonicalFunction = 2, @@ -464,16 +570,16 @@ enum class Function : uint8_t { MAX = NonCanonicalFunction }; -inline const Function (&EnumValuesFunction())[3] { - static const Function values[] = { - Function::NONE, - Function::CanonicalFunction, - Function::NonCanonicalFunction +inline const FunctionImpl (&EnumValuesFunctionImpl())[3] { + static const FunctionImpl values[] = { + FunctionImpl::NONE, + FunctionImpl::CanonicalFunction, + FunctionImpl::NonCanonicalFunction }; return values; } -inline const char * const *EnumNamesFunction() { +inline const char * const *EnumNamesFunctionImpl() { static const char * const names[4] = { "NONE", "CanonicalFunction", @@ -483,164 +589,117 @@ inline const char * const *EnumNamesFunction() { return names; } -inline const char *EnumNameFunction(Function e) { - if (flatbuffers::IsOutRange(e, Function::NONE, Function::NonCanonicalFunction)) return ""; +inline const char *EnumNameFunctionImpl(FunctionImpl e) { + if (flatbuffers::IsOutRange(e, FunctionImpl::NONE, FunctionImpl::NonCanonicalFunction)) return ""; const size_t index = static_cast(e); - return EnumNamesFunction()[index]; + return EnumNamesFunctionImpl()[index]; } -template struct FunctionTraits { - static const Function enum_value = Function::NONE; +template struct FunctionImplTraits { + static const FunctionImpl enum_value = FunctionImpl::NONE; }; -template<> struct FunctionTraits { - static const Function enum_value = Function::CanonicalFunction; +template<> struct FunctionImplTraits { + static const FunctionImpl enum_value = FunctionImpl::CanonicalFunction; }; -template<> struct FunctionTraits { - static const Function enum_value = Function::NonCanonicalFunction; +template<> struct FunctionImplTraits { + static const FunctionImpl enum_value = FunctionImpl::NonCanonicalFunction; }; -bool VerifyFunction(flatbuffers::Verifier &verifier, const void *obj, Function type); -bool VerifyFunctionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class CanonicalOperationId : uint32_t { - Literal = 0, - Filter = 1, - Project = 2, - Aggregate = 3, - Join = 4, - OrderBy = 5, - Limit = 6, - Common = 7, - Union = 8, - InteractiveOutput = 9, - MIN = Literal, - MAX = InteractiveOutput -}; - -inline const CanonicalOperationId (&EnumValuesCanonicalOperationId())[10] { - static const CanonicalOperationId values[] = { - CanonicalOperationId::Literal, - CanonicalOperationId::Filter, - CanonicalOperationId::Project, - CanonicalOperationId::Aggregate, - CanonicalOperationId::Join, - CanonicalOperationId::OrderBy, - CanonicalOperationId::Limit, - CanonicalOperationId::Common, - CanonicalOperationId::Union, - CanonicalOperationId::InteractiveOutput - }; - return values; -} - -inline const char * const *EnumNamesCanonicalOperationId() { - static const char * const names[11] = { - "Literal", - "Filter", - "Project", - "Aggregate", - "Join", - "OrderBy", - "Limit", - "Common", - "Union", - "InteractiveOutput", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalOperationId(CanonicalOperationId e) { - if (flatbuffers::IsOutRange(e, CanonicalOperationId::Literal, CanonicalOperationId::InteractiveOutput)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalOperationId()[index]; -} +bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type); +bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); -enum class Operation : uint8_t { +/// A union for the different colum remapping variants +enum class Emit : uint8_t { NONE = 0, - CanonicalOperation = 1, - NonCanonicalOperation = 2, + Remap = 1, + PassThrough = 2, MIN = NONE, - MAX = NonCanonicalOperation + MAX = PassThrough }; -inline const Operation (&EnumValuesOperation())[3] { - static const Operation values[] = { - Operation::NONE, - Operation::CanonicalOperation, - Operation::NonCanonicalOperation +inline const Emit (&EnumValuesEmit())[3] { + static const Emit values[] = { + Emit::NONE, + Emit::Remap, + Emit::PassThrough }; return values; } -inline const char * const *EnumNamesOperation() { +inline const char * const *EnumNamesEmit() { static const char * const names[4] = { "NONE", - "CanonicalOperation", - "NonCanonicalOperation", + "Remap", + "PassThrough", nullptr }; return names; } -inline const char *EnumNameOperation(Operation e) { - if (flatbuffers::IsOutRange(e, Operation::NONE, Operation::NonCanonicalOperation)) return ""; +inline const char *EnumNameEmit(Emit e) { + if (flatbuffers::IsOutRange(e, Emit::NONE, Emit::PassThrough)) return ""; const size_t index = static_cast(e); - return EnumNamesOperation()[index]; + return EnumNamesEmit()[index]; } -template struct OperationTraits { - static const Operation enum_value = Operation::NONE; +template struct EmitTraits { + static const Emit enum_value = Emit::NONE; }; -template<> struct OperationTraits { - static const Operation enum_value = Operation::CanonicalOperation; +template<> struct EmitTraits { + static const Emit enum_value = Emit::Remap; }; -template<> struct OperationTraits { - static const Operation enum_value = Operation::NonCanonicalOperation; +template<> struct EmitTraits { + static const Emit enum_value = Emit::PassThrough; }; -bool VerifyOperation(flatbuffers::Verifier &verifier, const void *obj, Operation type); -bool VerifyOperationVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class CanonicalJoinKindId : uint32_t { - Inner = 0, - LeftOuter = 1, - RightOuter = 2, - FullOuter = 3, - Cross = 4, - MIN = Inner, - MAX = Cross +bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type); +bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class CanonicalJoinKindId : uint8_t { + Anti = 0, + Cross = 1, + FullOuter = 2, + Inner = 3, + LeftOuter = 4, + LeftSemi = 5, + RightOuter = 6, + MIN = Anti, + MAX = RightOuter }; -inline const CanonicalJoinKindId (&EnumValuesCanonicalJoinKindId())[5] { +inline const CanonicalJoinKindId (&EnumValuesCanonicalJoinKindId())[7] { static const CanonicalJoinKindId values[] = { + CanonicalJoinKindId::Anti, + CanonicalJoinKindId::Cross, + CanonicalJoinKindId::FullOuter, CanonicalJoinKindId::Inner, CanonicalJoinKindId::LeftOuter, - CanonicalJoinKindId::RightOuter, - CanonicalJoinKindId::FullOuter, - CanonicalJoinKindId::Cross + CanonicalJoinKindId::LeftSemi, + CanonicalJoinKindId::RightOuter }; return values; } inline const char * const *EnumNamesCanonicalJoinKindId() { - static const char * const names[6] = { + static const char * const names[8] = { + "Anti", + "Cross", + "FullOuter", "Inner", "LeftOuter", + "LeftSemi", "RightOuter", - "FullOuter", - "Cross", nullptr }; return names; } inline const char *EnumNameCanonicalJoinKindId(CanonicalJoinKindId e) { - if (flatbuffers::IsOutRange(e, CanonicalJoinKindId::Inner, CanonicalJoinKindId::Cross)) return ""; + if (flatbuffers::IsOutRange(e, CanonicalJoinKindId::Anti, CanonicalJoinKindId::RightOuter)) return ""; const size_t index = static_cast(e); return EnumNamesCanonicalJoinKindId()[index]; } @@ -682,11 +741,11 @@ template struct JoinKindTraits { static const JoinKind enum_value = JoinKind::NONE; }; -template<> struct JoinKindTraits { +template<> struct JoinKindTraits { static const JoinKind enum_value = JoinKind::CanonicalJoinKind; }; -template<> struct JoinKindTraits { +template<> struct JoinKindTraits { static const JoinKind enum_value = JoinKind::NonCanonicalJoinKind; }; @@ -731,6 +790,199 @@ inline const char *EnumNameOrdering(Ordering e) { return EnumNamesOrdering()[index]; } +/// The kind of set operation being performed. +enum class CanonicalSetOpKindId : uint8_t { + Union = 0, + Intersection = 1, + Difference = 2, + MIN = Union, + MAX = Difference +}; + +inline const CanonicalSetOpKindId (&EnumValuesCanonicalSetOpKindId())[3] { + static const CanonicalSetOpKindId values[] = { + CanonicalSetOpKindId::Union, + CanonicalSetOpKindId::Intersection, + CanonicalSetOpKindId::Difference + }; + return values; +} + +inline const char * const *EnumNamesCanonicalSetOpKindId() { + static const char * const names[4] = { + "Union", + "Intersection", + "Difference", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalSetOpKindId(CanonicalSetOpKindId e) { + if (flatbuffers::IsOutRange(e, CanonicalSetOpKindId::Union, CanonicalSetOpKindId::Difference)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalSetOpKindId()[index]; +} + +enum class SetOpKind : uint8_t { + NONE = 0, + CanonicalSetOpKind = 1, + NonCanonicalSetOpKind = 2, + MIN = NONE, + MAX = NonCanonicalSetOpKind +}; + +inline const SetOpKind (&EnumValuesSetOpKind())[3] { + static const SetOpKind values[] = { + SetOpKind::NONE, + SetOpKind::CanonicalSetOpKind, + SetOpKind::NonCanonicalSetOpKind + }; + return values; +} + +inline const char * const *EnumNamesSetOpKind() { + static const char * const names[4] = { + "NONE", + "CanonicalSetOpKind", + "NonCanonicalSetOpKind", + nullptr + }; + return names; +} + +inline const char *EnumNameSetOpKind(SetOpKind e) { + if (flatbuffers::IsOutRange(e, SetOpKind::NONE, SetOpKind::NonCanonicalSetOpKind)) return ""; + const size_t index = static_cast(e); + return EnumNamesSetOpKind()[index]; +} + +template struct SetOpKindTraits { + static const SetOpKind enum_value = SetOpKind::NONE; +}; + +template<> struct SetOpKindTraits { + static const SetOpKind enum_value = SetOpKind::CanonicalSetOpKind; +}; + +template<> struct SetOpKindTraits { + static const SetOpKind enum_value = SetOpKind::NonCanonicalSetOpKind; +}; + +bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type); +bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class RelationImpl : uint8_t { + NONE = 0, + Aggregate = 1, + Common = 2, + Custom = 3, + SetOperation = 4, + Filter = 5, + Limit = 6, + LiteralRelation = 7, + OrderBy = 8, + Project = 9, + Read = 10, + Write = 11, + MIN = NONE, + MAX = Write +}; + +inline const RelationImpl (&EnumValuesRelationImpl())[12] { + static const RelationImpl values[] = { + RelationImpl::NONE, + RelationImpl::Aggregate, + RelationImpl::Common, + RelationImpl::Custom, + RelationImpl::SetOperation, + RelationImpl::Filter, + RelationImpl::Limit, + RelationImpl::LiteralRelation, + RelationImpl::OrderBy, + RelationImpl::Project, + RelationImpl::Read, + RelationImpl::Write + }; + return values; +} + +inline const char * const *EnumNamesRelationImpl() { + static const char * const names[13] = { + "NONE", + "Aggregate", + "Common", + "Custom", + "SetOperation", + "Filter", + "Limit", + "LiteralRelation", + "OrderBy", + "Project", + "Read", + "Write", + nullptr + }; + return names; +} + +inline const char *EnumNameRelationImpl(RelationImpl e) { + if (flatbuffers::IsOutRange(e, RelationImpl::NONE, RelationImpl::Write)) return ""; + const size_t index = static_cast(e); + return EnumNamesRelationImpl()[index]; +} + +template struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::NONE; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Aggregate; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Common; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Custom; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::SetOperation; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Filter; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Limit; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::LiteralRelation; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::OrderBy; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Project; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Read; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Write; +}; + +bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type); +bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + struct Int8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef Int8BufferBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -779,7 +1031,7 @@ inline flatbuffers::Offset CreateInt8BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateInt8Buffer( + return org::apache::arrow::computeir::flatbuf::CreateInt8Buffer( _fbb, items__); } @@ -832,7 +1084,7 @@ inline flatbuffers::Offset CreateInt16BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateInt16Buffer( + return org::apache::arrow::computeir::flatbuf::CreateInt16Buffer( _fbb, items__); } @@ -885,7 +1137,7 @@ inline flatbuffers::Offset CreateInt32BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateInt32Buffer( + return org::apache::arrow::computeir::flatbuf::CreateInt32Buffer( _fbb, items__); } @@ -938,7 +1190,7 @@ inline flatbuffers::Offset CreateInt64BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateInt64Buffer( + return org::apache::arrow::computeir::flatbuf::CreateInt64Buffer( _fbb, items__); } @@ -991,7 +1243,7 @@ inline flatbuffers::Offset CreateUInt8BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateUInt8Buffer( + return org::apache::arrow::computeir::flatbuf::CreateUInt8Buffer( _fbb, items__); } @@ -1044,7 +1296,7 @@ inline flatbuffers::Offset CreateUInt16BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateUInt16Buffer( + return org::apache::arrow::computeir::flatbuf::CreateUInt16Buffer( _fbb, items__); } @@ -1097,7 +1349,7 @@ inline flatbuffers::Offset CreateUInt32BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateUInt32Buffer( + return org::apache::arrow::computeir::flatbuf::CreateUInt32Buffer( _fbb, items__); } @@ -1150,7 +1402,7 @@ inline flatbuffers::Offset CreateUInt64BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateUInt64Buffer( + return org::apache::arrow::computeir::flatbuf::CreateUInt64Buffer( _fbb, items__); } @@ -1203,7 +1455,7 @@ inline flatbuffers::Offset CreateFloat32BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateFloat32Buffer( + return org::apache::arrow::computeir::flatbuf::CreateFloat32Buffer( _fbb, items__); } @@ -1256,7 +1508,7 @@ inline flatbuffers::Offset CreateFloat64BufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateFloat64Buffer( + return org::apache::arrow::computeir::flatbuf::CreateFloat64Buffer( _fbb, items__); } @@ -1269,8 +1521,8 @@ struct TableBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const flatbuffers::Vector *items() const { return GetPointer *>(VT_ITEMS); } - const org::apache::arrow::flatbuf::computeir::InlineBuffer *items_nested_root() const { - return flatbuffers::GetRoot(items()->Data()); + const org::apache::arrow::computeir::flatbuf::InlineBuffer *items_nested_root() const { + return flatbuffers::GetRoot(items()->Data()); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -1312,7 +1564,7 @@ inline flatbuffers::Offset CreateTableBufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector *items = nullptr) { auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::flatbuf::computeir::CreateTableBuffer( + return org::apache::arrow::computeir::flatbuf::CreateTableBuffer( _fbb, items__); } @@ -1329,45 +1581,45 @@ struct InlineBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_IMPL_TYPE = 4, VT_IMPL = 6 }; - org::apache::arrow::flatbuf::computeir::InlineBufferImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); + org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); } const void *impl() const { return GetPointer(VT_IMPL); } template const T *impl_as() const; - const org::apache::arrow::flatbuf::computeir::Int8Buffer *impl_as_Int8Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int8Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Int8Buffer *impl_as_Int8Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int8Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::Int16Buffer *impl_as_Int16Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int16Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Int16Buffer *impl_as_Int16Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int16Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::Int32Buffer *impl_as_Int32Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int32Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Int32Buffer *impl_as_Int32Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int32Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::Int64Buffer *impl_as_Int64Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Int64Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Int64Buffer *impl_as_Int64Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int64Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::UInt8Buffer *impl_as_UInt8Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt8Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::UInt8Buffer *impl_as_UInt8Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt8Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::UInt16Buffer *impl_as_UInt16Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt16Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::UInt16Buffer *impl_as_UInt16Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt16Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::UInt32Buffer *impl_as_UInt32Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt32Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::UInt32Buffer *impl_as_UInt32Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt32Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::UInt64Buffer *impl_as_UInt64Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::UInt64Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::UInt64Buffer *impl_as_UInt64Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt64Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::Float32Buffer *impl_as_Float32Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Float32Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Float32Buffer *impl_as_Float32Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float32Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::Float64Buffer *impl_as_Float64Buffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::Float64Buffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Float64Buffer *impl_as_Float64Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float64Buffer ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::TableBuffer *impl_as_TableBuffer() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::InlineBufferImpl::TableBuffer ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::TableBuffer *impl_as_TableBuffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::TableBuffer ? static_cast(impl()) : nullptr; } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -1378,47 +1630,47 @@ struct InlineBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -template<> inline const org::apache::arrow::flatbuf::computeir::Int8Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Int8Buffer *InlineBuffer::impl_as() const { return impl_as_Int8Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::Int16Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Int16Buffer *InlineBuffer::impl_as() const { return impl_as_Int16Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::Int32Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Int32Buffer *InlineBuffer::impl_as() const { return impl_as_Int32Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::Int64Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Int64Buffer *InlineBuffer::impl_as() const { return impl_as_Int64Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::UInt8Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::UInt8Buffer *InlineBuffer::impl_as() const { return impl_as_UInt8Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::UInt16Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::UInt16Buffer *InlineBuffer::impl_as() const { return impl_as_UInt16Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::UInt32Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::UInt32Buffer *InlineBuffer::impl_as() const { return impl_as_UInt32Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::UInt64Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::UInt64Buffer *InlineBuffer::impl_as() const { return impl_as_UInt64Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::Float32Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Float32Buffer *InlineBuffer::impl_as() const { return impl_as_Float32Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::Float64Buffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Float64Buffer *InlineBuffer::impl_as() const { return impl_as_Float64Buffer(); } -template<> inline const org::apache::arrow::flatbuf::computeir::TableBuffer *InlineBuffer::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::TableBuffer *InlineBuffer::impl_as() const { return impl_as_TableBuffer(); } @@ -1426,7 +1678,7 @@ struct InlineBufferBuilder { typedef InlineBuffer Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::flatbuf::computeir::InlineBufferImpl impl_type) { + void add_impl_type(org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type) { fbb_.AddElement(InlineBuffer::VT_IMPL_TYPE, static_cast(impl_type), 0); } void add_impl(flatbuffers::Offset impl) { @@ -1447,7 +1699,7 @@ struct InlineBufferBuilder { inline flatbuffers::Offset CreateInlineBuffer( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::InlineBufferImpl impl_type = org::apache::arrow::flatbuf::computeir::InlineBufferImpl::NONE, + org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type = org::apache::arrow::computeir::flatbuf::InlineBufferImpl::NONE, flatbuffers::Offset impl = 0) { InlineBufferBuilder builder_(_fbb); builder_.add_impl(impl); @@ -1458,37 +1710,27 @@ inline flatbuffers::Offset CreateInlineBuffer( struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ExpressionBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_FIELD = 4, - VT_IMPL_TYPE = 6, - VT_IMPL = 8 + VT_IMPL_TYPE = 4, + VT_IMPL = 6 }; - /// The type of this literal. Field is used instead of Type to pick - /// up child fields, dictionary encoding, etc. - /// Field.name should always be absent since it is not meaningful - /// for Expressions. - const org::apache::arrow::flatbuf::Field *field() const { - return GetPointer(VT_FIELD); - } - org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); + org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); } const void *impl() const { return GetPointer(VT_IMPL); } template const T *impl_as() const; - const org::apache::arrow::flatbuf::computeir::Literal *impl_as_Literal() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::ExpressionImpl::Literal ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Literal *impl_as_Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Literal ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::FieldRef *impl_as_FieldRef() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::ExpressionImpl::FieldRef ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::FieldRef *impl_as_FieldRef() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::FieldRef ? static_cast(impl()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::Call *impl_as_Call() const { - return impl_type() == org::apache::arrow::flatbuf::computeir::ExpressionImpl::Call ? static_cast(impl()) : nullptr; + const org::apache::arrow::computeir::flatbuf::Call *impl_as_Call() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Call ? static_cast(impl()) : nullptr; } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_FIELD) && - verifier.VerifyTable(field()) && VerifyField(verifier, VT_IMPL_TYPE) && VerifyOffsetRequired(verifier, VT_IMPL) && VerifyExpressionImpl(verifier, impl(), impl_type()) && @@ -1496,15 +1738,15 @@ struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -template<> inline const org::apache::arrow::flatbuf::computeir::Literal *Expression::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Literal *Expression::impl_as() const { return impl_as_Literal(); } -template<> inline const org::apache::arrow::flatbuf::computeir::FieldRef *Expression::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::FieldRef *Expression::impl_as() const { return impl_as_FieldRef(); } -template<> inline const org::apache::arrow::flatbuf::computeir::Call *Expression::impl_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::Call *Expression::impl_as() const { return impl_as_Call(); } @@ -1512,10 +1754,7 @@ struct ExpressionBuilder { typedef Expression Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_field(flatbuffers::Offset field) { - fbb_.AddOffset(Expression::VT_FIELD, field); - } - void add_impl_type(org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type) { + void add_impl_type(org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type) { fbb_.AddElement(Expression::VT_IMPL_TYPE, static_cast(impl_type), 0); } void add_impl(flatbuffers::Offset impl) { @@ -1529,7 +1768,6 @@ struct ExpressionBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, Expression::VT_FIELD); fbb_.Required(o, Expression::VT_IMPL); return o; } @@ -1537,12 +1775,10 @@ struct ExpressionBuilder { inline flatbuffers::Offset CreateExpression( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset field = 0, - org::apache::arrow::flatbuf::computeir::ExpressionImpl impl_type = org::apache::arrow::flatbuf::computeir::ExpressionImpl::NONE, + org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type = org::apache::arrow::computeir::flatbuf::ExpressionImpl::NONE, flatbuffers::Offset impl = 0) { ExpressionBuilder builder_(_fbb); builder_.add_impl(impl); - builder_.add_field(field); builder_.add_impl_type(impl_type); return builder_.Finish(); } @@ -1620,422 +1856,359 @@ inline flatbuffers::Offset CreateArray( return builder_.Finish(); } -struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LiteralBuilder Builder; +struct MapKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef MapKeyBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SHAPE_TYPE = 4, - VT_SHAPE = 6, - VT_BUFFERS = 8, - VT_DICTIONARY = 10 - }; - org::apache::arrow::flatbuf::computeir::Shape shape_type() const { - return static_cast(GetField(VT_SHAPE_TYPE, 0)); - } - /// Shape of this literal. - /// - /// Note that this is orthogonal to type and refers to the number - /// of rows spanned by this Literal - a Literal may be Scalar shaped - /// with multiple "columns" if the type happens to be Struct. - const void *shape() const { - return GetPointer(VT_SHAPE); - } - template const T *shape_as() const; - const org::apache::arrow::flatbuf::computeir::Array *shape_as_Array() const { - return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::Array ? static_cast(shape()) : nullptr; - } - const org::apache::arrow::flatbuf::computeir::Scalar *shape_as_Scalar() const { - return shape_type() == org::apache::arrow::flatbuf::computeir::Shape::Scalar ? static_cast(shape()) : nullptr; - } - /// Buffers containing N elements of arrow-formatted data, where N - /// is Array.length if shape is Array or 1 if shape is Scalar. - /// XXX this can be optimized for trivial scalars later - const flatbuffers::Vector> *buffers() const { - return GetPointer> *>(VT_BUFFERS); - } - /// If (and only if) this Literal has dictionary type, this field dictionary - /// into which the literal's indices refer. - const org::apache::arrow::flatbuf::computeir::Literal *dictionary() const { - return GetPointer(VT_DICTIONARY); + VT_KEY = 4 + }; + const flatbuffers::String *key() const { + return GetPointer(VT_KEY); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_SHAPE_TYPE) && - VerifyOffsetRequired(verifier, VT_SHAPE) && - VerifyShape(verifier, shape(), shape_type()) && - VerifyOffset(verifier, VT_BUFFERS) && - verifier.VerifyVector(buffers()) && - verifier.VerifyVectorOfTables(buffers()) && - VerifyOffset(verifier, VT_DICTIONARY) && - verifier.VerifyTable(dictionary()) && + VerifyOffsetRequired(verifier, VT_KEY) && + verifier.VerifyString(key()) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::computeir::Array *Literal::shape_as() const { - return shape_as_Array(); -} - -template<> inline const org::apache::arrow::flatbuf::computeir::Scalar *Literal::shape_as() const { - return shape_as_Scalar(); -} - -struct LiteralBuilder { - typedef Literal Table; +struct MapKeyBuilder { + typedef MapKey Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_shape_type(org::apache::arrow::flatbuf::computeir::Shape shape_type) { - fbb_.AddElement(Literal::VT_SHAPE_TYPE, static_cast(shape_type), 0); - } - void add_shape(flatbuffers::Offset shape) { - fbb_.AddOffset(Literal::VT_SHAPE, shape); - } - void add_buffers(flatbuffers::Offset>> buffers) { - fbb_.AddOffset(Literal::VT_BUFFERS, buffers); + void add_key(flatbuffers::Offset key) { + fbb_.AddOffset(MapKey::VT_KEY, key); } - void add_dictionary(flatbuffers::Offset dictionary) { - fbb_.AddOffset(Literal::VT_DICTIONARY, dictionary); - } - explicit LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit MapKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - LiteralBuilder &operator=(const LiteralBuilder &); - flatbuffers::Offset Finish() { + MapKeyBuilder &operator=(const MapKeyBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Literal::VT_SHAPE); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, MapKey::VT_KEY); return o; } }; -inline flatbuffers::Offset CreateLiteral( +inline flatbuffers::Offset CreateMapKey( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, - flatbuffers::Offset shape = 0, - flatbuffers::Offset>> buffers = 0, - flatbuffers::Offset dictionary = 0) { - LiteralBuilder builder_(_fbb); - builder_.add_dictionary(dictionary); - builder_.add_buffers(buffers); - builder_.add_shape(shape); - builder_.add_shape_type(shape_type); + flatbuffers::Offset key = 0) { + MapKeyBuilder builder_(_fbb); + builder_.add_key(key); return builder_.Finish(); } -inline flatbuffers::Offset CreateLiteralDirect( +inline flatbuffers::Offset CreateMapKeyDirect( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Shape shape_type = org::apache::arrow::flatbuf::computeir::Shape::NONE, - flatbuffers::Offset shape = 0, - const std::vector> *buffers = nullptr, - flatbuffers::Offset dictionary = 0) { - auto buffers__ = buffers ? _fbb.CreateVector>(*buffers) : 0; - return org::apache::arrow::flatbuf::computeir::CreateLiteral( + const char *key = nullptr) { + auto key__ = key ? _fbb.CreateString(key) : 0; + return org::apache::arrow::computeir::flatbuf::CreateMapKey( _fbb, - shape_type, - shape, - buffers__, - dictionary); + key__); } -struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FieldRefBuilder Builder; +struct StructField FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef StructFieldBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_PATH = 4, - VT_RELATION_INDEX = 6 + VT_POSITION = 4, + VT_NESTING_LEVEL = 6 }; - /// A sequence of field names to allow referencing potentially nested fields - const flatbuffers::Vector> *path() const { - return GetPointer> *>(VT_PATH); + uint32_t position() const { + return GetField(VT_POSITION, 0); } - /// For Expressions which might reference fields in multiple Relations, - /// this index may be provided to indicate which Relation's fields - /// `path` points into. For example in the case of a join, - /// 0 refers to the left relation and 1 to the right relation. - int32_t relation_index() const { - return GetField(VT_RELATION_INDEX, 0); + uint32_t nesting_level() const { + return GetField(VT_NESTING_LEVEL, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_PATH) && - verifier.VerifyVector(path()) && - verifier.VerifyVectorOfStrings(path()) && - VerifyField(verifier, VT_RELATION_INDEX) && + VerifyField(verifier, VT_POSITION) && + VerifyField(verifier, VT_NESTING_LEVEL) && verifier.EndTable(); } }; -struct FieldRefBuilder { - typedef FieldRef Table; +struct StructFieldBuilder { + typedef StructField Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_path(flatbuffers::Offset>> path) { - fbb_.AddOffset(FieldRef::VT_PATH, path); + void add_position(uint32_t position) { + fbb_.AddElement(StructField::VT_POSITION, position, 0); } - void add_relation_index(int32_t relation_index) { - fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); + void add_nesting_level(uint32_t nesting_level) { + fbb_.AddElement(StructField::VT_NESTING_LEVEL, nesting_level, 0); } - explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit StructFieldBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - FieldRefBuilder &operator=(const FieldRefBuilder &); - flatbuffers::Offset Finish() { + StructFieldBuilder &operator=(const StructFieldBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateFieldRef( +inline flatbuffers::Offset CreateStructField( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> path = 0, - int32_t relation_index = 0) { - FieldRefBuilder builder_(_fbb); - builder_.add_relation_index(relation_index); - builder_.add_path(path); + uint32_t position = 0, + uint32_t nesting_level = 0) { + StructFieldBuilder builder_(_fbb); + builder_.add_nesting_level(nesting_level); + builder_.add_position(position); return builder_.Finish(); } -inline flatbuffers::Offset CreateFieldRefDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *path = nullptr, - int32_t relation_index = 0) { - auto path__ = path ? _fbb.CreateVector>(*path) : 0; - return org::apache::arrow::flatbuf::computeir::CreateFieldRef( - _fbb, - path__, - relation_index); -} - -struct CanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalFunctionBuilder Builder; +struct ArraySubscript FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ArraySubscriptBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 + VT_POSITION = 4 }; - org::apache::arrow::flatbuf::computeir::CanonicalFunctionId id() const { - return static_cast(GetField(VT_ID, 0)); + int64_t position() const { + return GetField(VT_POSITION, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && + VerifyField(verifier, VT_POSITION) && verifier.EndTable(); } }; -struct CanonicalFunctionBuilder { - typedef CanonicalFunction Table; +struct ArraySubscriptBuilder { + typedef ArraySubscript Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::flatbuf::computeir::CanonicalFunctionId id) { - fbb_.AddElement(CanonicalFunction::VT_ID, static_cast(id), 0); + void add_position(int64_t position) { + fbb_.AddElement(ArraySubscript::VT_POSITION, position, 0); } - explicit CanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit ArraySubscriptBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - CanonicalFunctionBuilder &operator=(const CanonicalFunctionBuilder &); - flatbuffers::Offset Finish() { + ArraySubscriptBuilder &operator=(const ArraySubscriptBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateCanonicalFunction( +inline flatbuffers::Offset CreateArraySubscript( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::CanonicalFunctionId id = org::apache::arrow::flatbuf::computeir::CanonicalFunctionId::And) { - CanonicalFunctionBuilder builder_(_fbb); - builder_.add_id(id); + int64_t position = 0) { + ArraySubscriptBuilder builder_(_fbb); + builder_.add_position(position); return builder_.Finish(); } -struct NonCanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalFunctionBuilder Builder; +struct ArraySlice FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ArraySliceBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 + VT_START_INCLUSIVE = 4, + VT_END_EXCLUSIVE = 6 }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); + int64_t start_inclusive() const { + return GetField(VT_START_INCLUSIVE, 0); } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); + int64_t end_exclusive() const { + return GetField(VT_END_EXCLUSIVE, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && + VerifyField(verifier, VT_START_INCLUSIVE) && + VerifyField(verifier, VT_END_EXCLUSIVE) && verifier.EndTable(); } }; -struct NonCanonicalFunctionBuilder { - typedef NonCanonicalFunction Table; +struct ArraySliceBuilder { + typedef ArraySlice Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalFunction::VT_NAME_SPACE, name_space); + void add_start_inclusive(int64_t start_inclusive) { + fbb_.AddElement(ArraySlice::VT_START_INCLUSIVE, start_inclusive, 0); } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalFunction::VT_NAME, name); + void add_end_exclusive(int64_t end_exclusive) { + fbb_.AddElement(ArraySlice::VT_END_EXCLUSIVE, end_exclusive, 0); } - explicit NonCanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit ArraySliceBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - NonCanonicalFunctionBuilder &operator=(const NonCanonicalFunctionBuilder &); - flatbuffers::Offset Finish() { + ArraySliceBuilder &operator=(const ArraySliceBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalFunction::VT_NAME_SPACE); - fbb_.Required(o, NonCanonicalFunction::VT_NAME); + auto o = flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateNonCanonicalFunction( +inline flatbuffers::Offset CreateArraySlice( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalFunctionBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); + int64_t start_inclusive = 0, + int64_t end_exclusive = 0) { + ArraySliceBuilder builder_(_fbb); + builder_.add_end_exclusive(end_exclusive); + builder_.add_start_inclusive(start_inclusive); return builder_.Finish(); } -inline flatbuffers::Offset CreateNonCanonicalFunctionDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::flatbuf::computeir::CreateNonCanonicalFunction( - _fbb, - name_space__, - name__); -} +struct FieldName FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FieldNameBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_POSITION = 4 + }; + uint32_t position() const { + return GetField(VT_POSITION, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_POSITION) && + verifier.EndTable(); + } +}; -struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CallBuilder Builder; +struct FieldNameBuilder { + typedef FieldName Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_position(uint32_t position) { + fbb_.AddElement(FieldName::VT_POSITION, position, 0); + } + explicit FieldNameBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FieldNameBuilder &operator=(const FieldNameBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateFieldName( + flatbuffers::FlatBufferBuilder &_fbb, + uint32_t position = 0) { + FieldNameBuilder builder_(_fbb); + builder_.add_position(position); + return builder_.Finish(); +} + +struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FieldRefBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_FUNCTION_TYPE = 4, - VT_FUNCTION = 6, - VT_OPTIONS = 8, - VT_ARGUMENTS = 10 + VT_REF_TYPE = 4, + VT_REF = 6, + VT_RELATION_INDEX = 8 }; - org::apache::arrow::flatbuf::computeir::Function function_type() const { - return static_cast(GetField(VT_FUNCTION_TYPE, 0)); + org::apache::arrow::computeir::flatbuf::Deref ref_type() const { + return static_cast(GetField(VT_REF_TYPE, 0)); } - /// The function whose invocation this Call represents. - const void *function() const { - return GetPointer(VT_FUNCTION); + /// A sequence of field names to allow referencing potentially nested fields + const void *ref() const { + return GetPointer(VT_REF); } - template const T *function_as() const; - const org::apache::arrow::flatbuf::computeir::CanonicalFunction *function_as_CanonicalFunction() const { - return function_type() == org::apache::arrow::flatbuf::computeir::Function::CanonicalFunction ? static_cast(function()) : nullptr; + template const T *ref_as() const; + const org::apache::arrow::computeir::flatbuf::MapKey *ref_as_MapKey() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::MapKey ? static_cast(ref()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *function_as_NonCanonicalFunction() const { - return function_type() == org::apache::arrow::flatbuf::computeir::Function::NonCanonicalFunction ? static_cast(function()) : nullptr; + const org::apache::arrow::computeir::flatbuf::StructField *ref_as_StructField() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::StructField ? static_cast(ref()) : nullptr; } - /// Parameters for `function_name`; content/format may be unique to each - /// value of `function_name`. - const org::apache::arrow::flatbuf::computeir::InlineBuffer *options() const { - return GetPointer(VT_OPTIONS); + const org::apache::arrow::computeir::flatbuf::ArraySubscript *ref_as_ArraySubscript() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySubscript ? static_cast(ref()) : nullptr; } - /// The arguments passed to `function_name`. - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); + const org::apache::arrow::computeir::flatbuf::ArraySlice *ref_as_ArraySlice() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySlice ? static_cast(ref()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::FieldName *ref_as_FieldName() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::FieldName ? static_cast(ref()) : nullptr; + } + /// For Expressions which might reference fields in multiple Relations, + /// this index may be provided to indicate which Relation's fields + /// `path` points into. For example in the case of a join, + /// 0 refers to the left relation and 1 to the right relation. + int32_t relation_index() const { + return GetField(VT_RELATION_INDEX, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_FUNCTION_TYPE) && - VerifyOffsetRequired(verifier, VT_FUNCTION) && - VerifyFunction(verifier, function(), function_type()) && - VerifyOffset(verifier, VT_OPTIONS) && - verifier.VerifyTable(options()) && - VerifyOffsetRequired(verifier, VT_ARGUMENTS) && - verifier.VerifyVector(arguments()) && - verifier.VerifyVectorOfTables(arguments()) && + VerifyField(verifier, VT_REF_TYPE) && + VerifyOffsetRequired(verifier, VT_REF) && + VerifyDeref(verifier, ref(), ref_type()) && + VerifyField(verifier, VT_RELATION_INDEX) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalFunction *Call::function_as() const { - return function_as_CanonicalFunction(); +template<> inline const org::apache::arrow::computeir::flatbuf::MapKey *FieldRef::ref_as() const { + return ref_as_MapKey(); } -template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalFunction *Call::function_as() const { - return function_as_NonCanonicalFunction(); +template<> inline const org::apache::arrow::computeir::flatbuf::StructField *FieldRef::ref_as() const { + return ref_as_StructField(); } -struct CallBuilder { - typedef Call Table; +template<> inline const org::apache::arrow::computeir::flatbuf::ArraySubscript *FieldRef::ref_as() const { + return ref_as_ArraySubscript(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::ArraySlice *FieldRef::ref_as() const { + return ref_as_ArraySlice(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::FieldName *FieldRef::ref_as() const { + return ref_as_FieldName(); +} + +struct FieldRefBuilder { + typedef FieldRef Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_function_type(org::apache::arrow::flatbuf::computeir::Function function_type) { - fbb_.AddElement(Call::VT_FUNCTION_TYPE, static_cast(function_type), 0); + void add_ref_type(org::apache::arrow::computeir::flatbuf::Deref ref_type) { + fbb_.AddElement(FieldRef::VT_REF_TYPE, static_cast(ref_type), 0); } - void add_function(flatbuffers::Offset function) { - fbb_.AddOffset(Call::VT_FUNCTION, function); + void add_ref(flatbuffers::Offset ref) { + fbb_.AddOffset(FieldRef::VT_REF, ref); } - void add_options(flatbuffers::Offset options) { - fbb_.AddOffset(Call::VT_OPTIONS, options); - } - void add_arguments(flatbuffers::Offset>> arguments) { - fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); + void add_relation_index(int32_t relation_index) { + fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); } - explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - CallBuilder &operator=(const CallBuilder &); - flatbuffers::Offset Finish() { + FieldRefBuilder &operator=(const FieldRefBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Call::VT_FUNCTION); - fbb_.Required(o, Call::VT_ARGUMENTS); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, FieldRef::VT_REF); return o; } }; -inline flatbuffers::Offset CreateCall( +inline flatbuffers::Offset CreateFieldRef( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Function function_type = org::apache::arrow::flatbuf::computeir::Function::NONE, - flatbuffers::Offset function = 0, - flatbuffers::Offset options = 0, - flatbuffers::Offset>> arguments = 0) { - CallBuilder builder_(_fbb); - builder_.add_arguments(arguments); - builder_.add_options(options); - builder_.add_function(function); - builder_.add_function_type(function_type); + org::apache::arrow::computeir::flatbuf::Deref ref_type = org::apache::arrow::computeir::flatbuf::Deref::NONE, + flatbuffers::Offset ref = 0, + int32_t relation_index = 0) { + FieldRefBuilder builder_(_fbb); + builder_.add_relation_index(relation_index); + builder_.add_ref(ref); + builder_.add_ref_type(ref_type); return builder_.Finish(); } -inline flatbuffers::Offset CreateCallDirect( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Function function_type = org::apache::arrow::flatbuf::computeir::Function::NONE, - flatbuffers::Offset function = 0, - flatbuffers::Offset options = 0, - const std::vector> *arguments = nullptr) { - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; - return org::apache::arrow::flatbuf::computeir::CreateCall( - _fbb, - function_type, - function, - options, - arguments__); -} - -struct CanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalOperationBuilder Builder; +struct CanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalFunctionBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ID = 4 }; - org::apache::arrow::flatbuf::computeir::CanonicalOperationId id() const { - return static_cast(GetField(VT_ID, 0)); + org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id() const { + return static_cast(GetField(VT_ID, 0)); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -2044,35 +2217,35 @@ struct CanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -struct CanonicalOperationBuilder { - typedef CanonicalOperation Table; +struct CanonicalFunctionBuilder { + typedef CanonicalFunction Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::flatbuf::computeir::CanonicalOperationId id) { - fbb_.AddElement(CanonicalOperation::VT_ID, static_cast(id), 0); + void add_id(org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id) { + fbb_.AddElement(CanonicalFunction::VT_ID, static_cast(id), 0); } - explicit CanonicalOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit CanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - CanonicalOperationBuilder &operator=(const CanonicalOperationBuilder &); - flatbuffers::Offset Finish() { + CanonicalFunctionBuilder &operator=(const CanonicalFunctionBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateCanonicalOperation( +inline flatbuffers::Offset CreateCanonicalFunction( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::CanonicalOperationId id = org::apache::arrow::flatbuf::computeir::CanonicalOperationId::Literal) { - CanonicalOperationBuilder builder_(_fbb); + org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id = org::apache::arrow::computeir::flatbuf::CanonicalFunctionId::And) { + CanonicalFunctionBuilder builder_(_fbb); builder_.add_id(id); return builder_.Finish(); } -struct NonCanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalOperationBuilder Builder; +struct NonCanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalFunctionBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NAME_SPACE = 4, VT_NAME = 6 @@ -2085,7 +2258,7 @@ struct NonCanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME_SPACE) && + VerifyOffset(verifier, VT_NAME_SPACE) && verifier.VerifyString(name_space()) && VerifyOffsetRequired(verifier, VT_NAME) && verifier.VerifyString(name()) && @@ -2093,242 +2266,443 @@ struct NonCanonicalOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl } }; -struct NonCanonicalOperationBuilder { - typedef NonCanonicalOperation Table; +struct NonCanonicalFunctionBuilder { + typedef NonCanonicalFunction Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalOperation::VT_NAME_SPACE, name_space); + fbb_.AddOffset(NonCanonicalFunction::VT_NAME_SPACE, name_space); } void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalOperation::VT_NAME, name); + fbb_.AddOffset(NonCanonicalFunction::VT_NAME, name); } - explicit NonCanonicalOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit NonCanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - NonCanonicalOperationBuilder &operator=(const NonCanonicalOperationBuilder &); - flatbuffers::Offset Finish() { + NonCanonicalFunctionBuilder &operator=(const NonCanonicalFunctionBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalOperation::VT_NAME_SPACE); - fbb_.Required(o, NonCanonicalOperation::VT_NAME); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalFunction::VT_NAME); return o; } }; -inline flatbuffers::Offset CreateNonCanonicalOperation( +inline flatbuffers::Offset CreateNonCanonicalFunction( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset name_space = 0, flatbuffers::Offset name = 0) { - NonCanonicalOperationBuilder builder_(_fbb); + NonCanonicalFunctionBuilder builder_(_fbb); builder_.add_name(name); builder_.add_name_space(name_space); return builder_.Finish(); } -inline flatbuffers::Offset CreateNonCanonicalOperationDirect( +inline flatbuffers::Offset CreateNonCanonicalFunctionDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *name_space = nullptr, const char *name = nullptr) { auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::flatbuf::computeir::CreateNonCanonicalOperation( + return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalFunction( _fbb, name_space__, name__); } -/// A relation is a set of rows with consistent schema. -struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef RelationBuilder Builder; +struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CallBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_OPERATION_TYPE = 4, - VT_OPERATION = 6, - VT_OPTIONS = 8, - VT_ARGUMENTS = 10, - VT_SCHEMA = 12 + VT_KIND_TYPE = 4, + VT_KIND = 6, + VT_ARGUMENTS = 8, + VT_METADATA = 10 + }; + org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type() const { + return static_cast(GetField(VT_KIND_TYPE, 0)); + } + /// The kind of function call this is + const void *kind() const { + return GetPointer(VT_KIND); + } + template const T *kind_as() const; + const org::apache::arrow::computeir::flatbuf::CanonicalFunction *kind_as_CanonicalFunction() const { + return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::CanonicalFunction ? static_cast(kind()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *kind_as_NonCanonicalFunction() const { + return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::NonCanonicalFunction ? static_cast(kind()) : nullptr; + } + /// The arguments passed to `function_name`. + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); + } + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { + return GetPointer(VT_METADATA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_KIND_TYPE) && + VerifyOffsetRequired(verifier, VT_KIND) && + VerifyFunctionImpl(verifier, kind(), kind_type()) && + VerifyOffsetRequired(verifier, VT_ARGUMENTS) && + verifier.VerifyVector(arguments()) && + verifier.VerifyVectorOfTables(arguments()) && + VerifyOffset(verifier, VT_METADATA) && + verifier.VerifyTable(metadata()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalFunction *Call::kind_as() const { + return kind_as_CanonicalFunction(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *Call::kind_as() const { + return kind_as_NonCanonicalFunction(); +} + +struct CallBuilder { + typedef Call Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_kind_type(org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type) { + fbb_.AddElement(Call::VT_KIND_TYPE, static_cast(kind_type), 0); + } + void add_kind(flatbuffers::Offset kind) { + fbb_.AddOffset(Call::VT_KIND, kind); + } + void add_arguments(flatbuffers::Offset>> arguments) { + fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); + } + void add_metadata(flatbuffers::Offset metadata) { + fbb_.AddOffset(Call::VT_METADATA, metadata); + } + explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CallBuilder &operator=(const CallBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Call::VT_KIND); + fbb_.Required(o, Call::VT_ARGUMENTS); + return o; + } +}; + +inline flatbuffers::Offset CreateCall( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, + flatbuffers::Offset kind = 0, + flatbuffers::Offset>> arguments = 0, + flatbuffers::Offset metadata = 0) { + CallBuilder builder_(_fbb); + builder_.add_metadata(metadata); + builder_.add_arguments(arguments); + builder_.add_kind(kind); + builder_.add_kind_type(kind_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateCallDirect( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, + flatbuffers::Offset kind = 0, + const std::vector> *arguments = nullptr, + flatbuffers::Offset metadata = 0) { + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + return org::apache::arrow::computeir::flatbuf::CreateCall( + _fbb, + kind_type, + kind, + arguments__, + metadata); +} + +/// A data type indicating a different mapping of columns +/// should occur in the output. +/// +/// For example: +/// +/// Given a query `SELECT a, b FROM t` where `t` has columns a, b, c +/// the mapping value for the projection would equal [0, 1]. +struct Remap FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef RemapBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_MAPPING = 4 }; - org::apache::arrow::flatbuf::computeir::Operation operation_type() const { - return static_cast(GetField(VT_OPERATION_TYPE, 0)); + const flatbuffers::Vector *mapping() const { + return GetPointer *>(VT_MAPPING); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_MAPPING) && + verifier.VerifyVector(mapping()) && + verifier.EndTable(); + } +}; + +struct RemapBuilder { + typedef Remap Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_mapping(flatbuffers::Offset> mapping) { + fbb_.AddOffset(Remap::VT_MAPPING, mapping); + } + explicit RemapBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); } - /// The operation which this Relation wraps. - const void *operation() const { - return GetPointer(VT_OPERATION); + RemapBuilder &operator=(const RemapBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Remap::VT_MAPPING); + return o; } - template const T *operation_as() const; - const org::apache::arrow::flatbuf::computeir::CanonicalOperation *operation_as_CanonicalOperation() const { - return operation_type() == org::apache::arrow::flatbuf::computeir::Operation::CanonicalOperation ? static_cast(operation()) : nullptr; +}; + +inline flatbuffers::Offset CreateRemap( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> mapping = 0) { + RemapBuilder builder_(_fbb); + builder_.add_mapping(mapping); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateRemapDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *mapping = nullptr) { + auto mapping__ = mapping ? _fbb.CreateVector(*mapping) : 0; + return org::apache::arrow::computeir::flatbuf::CreateRemap( + _fbb, + mapping__); +} + +struct PassThrough FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef PassThroughBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); } - const org::apache::arrow::flatbuf::computeir::NonCanonicalOperation *operation_as_NonCanonicalOperation() const { - return operation_type() == org::apache::arrow::flatbuf::computeir::Operation::NonCanonicalOperation ? static_cast(operation()) : nullptr; +}; + +struct PassThroughBuilder { + typedef PassThrough Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit PassThroughBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); } - /// Parameters for `operation`; content/format may be unique to each - /// value of `operation`. - const org::apache::arrow::flatbuf::computeir::InlineBuffer *options() const { - return GetPointer(VT_OPTIONS); + PassThroughBuilder &operator=(const PassThroughBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; } +}; + +inline flatbuffers::Offset CreatePassThrough( + flatbuffers::FlatBufferBuilder &_fbb) { + PassThroughBuilder builder_(_fbb); + return builder_.Finish(); +} + +/// Fields common to every relational operator +struct RelBase FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef RelBaseBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ARGUMENTS = 4, + VT_OUTPUT_MAPPING_TYPE = 6, + VT_OUTPUT_MAPPING = 8, + VT_OPTIONS = 10 + }; /// The arguments passed to `operation`. - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); } - /// The schema of rows in this Relation - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); + org::apache::arrow::computeir::flatbuf::Emit output_mapping_type() const { + return static_cast(GetField(VT_OUTPUT_MAPPING_TYPE, 0)); + } + /// Output remapping of ordinals for a given operation + const void *output_mapping() const { + return GetPointer(VT_OUTPUT_MAPPING); + } + template const T *output_mapping_as() const; + const org::apache::arrow::computeir::flatbuf::Remap *output_mapping_as_Remap() const { + return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::Remap ? static_cast(output_mapping()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::PassThrough *output_mapping_as_PassThrough() const { + return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::PassThrough ? static_cast(output_mapping()) : nullptr; + } + /// Arguments for custom operations + const org::apache::arrow::computeir::flatbuf::InlineBuffer *options() const { + return GetPointer(VT_OPTIONS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_OPERATION_TYPE) && - VerifyOffsetRequired(verifier, VT_OPERATION) && - VerifyOperation(verifier, operation(), operation_type()) && - VerifyOffset(verifier, VT_OPTIONS) && - verifier.VerifyTable(options()) && VerifyOffsetRequired(verifier, VT_ARGUMENTS) && verifier.VerifyVector(arguments()) && verifier.VerifyVectorOfTables(arguments()) && - VerifyOffset(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && + VerifyField(verifier, VT_OUTPUT_MAPPING_TYPE) && + VerifyOffsetRequired(verifier, VT_OUTPUT_MAPPING) && + VerifyEmit(verifier, output_mapping(), output_mapping_type()) && + VerifyOffset(verifier, VT_OPTIONS) && + verifier.VerifyTable(options()) && verifier.EndTable(); } }; -template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalOperation *Relation::operation_as() const { - return operation_as_CanonicalOperation(); +template<> inline const org::apache::arrow::computeir::flatbuf::Remap *RelBase::output_mapping_as() const { + return output_mapping_as_Remap(); } -template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalOperation *Relation::operation_as() const { - return operation_as_NonCanonicalOperation(); +template<> inline const org::apache::arrow::computeir::flatbuf::PassThrough *RelBase::output_mapping_as() const { + return output_mapping_as_PassThrough(); } -struct RelationBuilder { - typedef Relation Table; +struct RelBaseBuilder { + typedef RelBase Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_operation_type(org::apache::arrow::flatbuf::computeir::Operation operation_type) { - fbb_.AddElement(Relation::VT_OPERATION_TYPE, static_cast(operation_type), 0); - } - void add_operation(flatbuffers::Offset operation) { - fbb_.AddOffset(Relation::VT_OPERATION, operation); + void add_arguments(flatbuffers::Offset>> arguments) { + fbb_.AddOffset(RelBase::VT_ARGUMENTS, arguments); } - void add_options(flatbuffers::Offset options) { - fbb_.AddOffset(Relation::VT_OPTIONS, options); + void add_output_mapping_type(org::apache::arrow::computeir::flatbuf::Emit output_mapping_type) { + fbb_.AddElement(RelBase::VT_OUTPUT_MAPPING_TYPE, static_cast(output_mapping_type), 0); } - void add_arguments(flatbuffers::Offset>> arguments) { - fbb_.AddOffset(Relation::VT_ARGUMENTS, arguments); + void add_output_mapping(flatbuffers::Offset output_mapping) { + fbb_.AddOffset(RelBase::VT_OUTPUT_MAPPING, output_mapping); } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Relation::VT_SCHEMA, schema); + void add_options(flatbuffers::Offset options) { + fbb_.AddOffset(RelBase::VT_OPTIONS, options); } - explicit RelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit RelBaseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - RelationBuilder &operator=(const RelationBuilder &); - flatbuffers::Offset Finish() { + RelBaseBuilder &operator=(const RelBaseBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Relation::VT_OPERATION); - fbb_.Required(o, Relation::VT_ARGUMENTS); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, RelBase::VT_ARGUMENTS); + fbb_.Required(o, RelBase::VT_OUTPUT_MAPPING); return o; } }; -inline flatbuffers::Offset CreateRelation( +inline flatbuffers::Offset CreateRelBase( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Operation operation_type = org::apache::arrow::flatbuf::computeir::Operation::NONE, - flatbuffers::Offset operation = 0, - flatbuffers::Offset options = 0, - flatbuffers::Offset>> arguments = 0, - flatbuffers::Offset schema = 0) { - RelationBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_arguments(arguments); + flatbuffers::Offset>> arguments = 0, + org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, + flatbuffers::Offset output_mapping = 0, + flatbuffers::Offset options = 0) { + RelBaseBuilder builder_(_fbb); builder_.add_options(options); - builder_.add_operation(operation); - builder_.add_operation_type(operation_type); + builder_.add_output_mapping(output_mapping); + builder_.add_arguments(arguments); + builder_.add_output_mapping_type(output_mapping_type); return builder_.Finish(); } -inline flatbuffers::Offset CreateRelationDirect( +inline flatbuffers::Offset CreateRelBaseDirect( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::Operation operation_type = org::apache::arrow::flatbuf::computeir::Operation::NONE, - flatbuffers::Offset operation = 0, - flatbuffers::Offset options = 0, - const std::vector> *arguments = nullptr, - flatbuffers::Offset schema = 0) { - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; - return org::apache::arrow::flatbuf::computeir::CreateRelation( + const std::vector> *arguments = nullptr, + org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, + flatbuffers::Offset output_mapping = 0, + flatbuffers::Offset options = 0) { + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + return org::apache::arrow::computeir::flatbuf::CreateRelBase( _fbb, - operation_type, - operation, - options, arguments__, - schema); + output_mapping_type, + output_mapping, + options); } -/// The contents of Relation.options will be FilterOptions -/// if Relation.operation = CanonicalOperation::Filter -struct FilterOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FilterOptionsBuilder Builder; +/// Filter operation +struct Filter FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FilterBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_FILTER_EXPRESSION = 4 + VT_BASE = 4, + VT_PREDICATE = 6 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// The expression which will be evaluated against input rows /// to determine whether they should be excluded from the /// filter relation's output. - const org::apache::arrow::flatbuf::computeir::Expression *filter_expression() const { - return GetPointer(VT_FILTER_EXPRESSION); + const org::apache::arrow::computeir::flatbuf::Expression *predicate() const { + return GetPointer(VT_PREDICATE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_FILTER_EXPRESSION) && - verifier.VerifyTable(filter_expression()) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_PREDICATE) && + verifier.VerifyTable(predicate()) && verifier.EndTable(); } }; -struct FilterOptionsBuilder { - typedef FilterOptions Table; +struct FilterBuilder { + typedef Filter Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_filter_expression(flatbuffers::Offset filter_expression) { - fbb_.AddOffset(FilterOptions::VT_FILTER_EXPRESSION, filter_expression); + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Filter::VT_BASE, base); } - explicit FilterOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + void add_predicate(flatbuffers::Offset predicate) { + fbb_.AddOffset(Filter::VT_PREDICATE, predicate); + } + explicit FilterBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - FilterOptionsBuilder &operator=(const FilterOptionsBuilder &); - flatbuffers::Offset Finish() { + FilterBuilder &operator=(const FilterBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, FilterOptions::VT_FILTER_EXPRESSION); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Filter::VT_PREDICATE); return o; } }; -inline flatbuffers::Offset CreateFilterOptions( +inline flatbuffers::Offset CreateFilter( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset filter_expression = 0) { - FilterOptionsBuilder builder_(_fbb); - builder_.add_filter_expression(filter_expression); + flatbuffers::Offset base = 0, + flatbuffers::Offset predicate = 0) { + FilterBuilder builder_(_fbb); + builder_.add_predicate(predicate); + builder_.add_base(base); return builder_.Finish(); } -/// The contents of Relation.options will be ProjectOptions -/// if Relation.operation = CanonicalOperation::Project -struct ProjectOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ProjectOptionsBuilder Builder; +/// Projection +struct Project FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ProjectBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_EXPRESSIONS = 4 + VT_BASE = 4, + VT_EXPRESSIONS = 6 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// Expressions which will be evaluated to produce to /// the rows of the project relation's output. - const flatbuffers::Vector> *expressions() const { - return GetPointer> *>(VT_EXPRESSIONS); + const flatbuffers::Vector> *expressions() const { + return GetPointer> *>(VT_EXPRESSIONS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && VerifyOffsetRequired(verifier, VT_EXPRESSIONS) && verifier.VerifyVector(expressions()) && verifier.VerifyVectorOfTables(expressions()) && @@ -2336,62 +2710,74 @@ struct ProjectOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -struct ProjectOptionsBuilder { - typedef ProjectOptions Table; +struct ProjectBuilder { + typedef Project Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_expressions(flatbuffers::Offset>> expressions) { - fbb_.AddOffset(ProjectOptions::VT_EXPRESSIONS, expressions); + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Project::VT_BASE, base); } - explicit ProjectOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + void add_expressions(flatbuffers::Offset>> expressions) { + fbb_.AddOffset(Project::VT_EXPRESSIONS, expressions); + } + explicit ProjectBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ProjectOptionsBuilder &operator=(const ProjectOptionsBuilder &); - flatbuffers::Offset Finish() { + ProjectBuilder &operator=(const ProjectBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, ProjectOptions::VT_EXPRESSIONS); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Project::VT_EXPRESSIONS); return o; } }; -inline flatbuffers::Offset CreateProjectOptions( +inline flatbuffers::Offset CreateProject( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> expressions = 0) { - ProjectOptionsBuilder builder_(_fbb); + flatbuffers::Offset base = 0, + flatbuffers::Offset>> expressions = 0) { + ProjectBuilder builder_(_fbb); builder_.add_expressions(expressions); + builder_.add_base(base); return builder_.Finish(); } -inline flatbuffers::Offset CreateProjectOptionsDirect( +inline flatbuffers::Offset CreateProjectDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *expressions = nullptr) { - auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; - return org::apache::arrow::flatbuf::computeir::CreateProjectOptions( + flatbuffers::Offset base = 0, + const std::vector> *expressions = nullptr) { + auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; + return org::apache::arrow::computeir::flatbuf::CreateProject( _fbb, + base, expressions__); } -/// The contents of Relation.options will be AggregateOptions -/// if Relation.operation = CanonicalOperation::Aggregate -struct AggregateOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef AggregateOptionsBuilder Builder; +/// Aggregate operation +struct Aggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef AggregateBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_AGGREGATIONS = 4, - VT_KEYS = 6 + VT_BASE = 4, + VT_AGGREGATIONS = 6, + VT_KEYS = 8 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// Expressions which will be evaluated to produce to /// the rows of the aggregate relation's output. - const flatbuffers::Vector> *aggregations() const { - return GetPointer> *>(VT_AGGREGATIONS); + const flatbuffers::Vector> *aggregations() const { + return GetPointer> *>(VT_AGGREGATIONS); } /// Keys by which `aggregations` will be grouped. - const flatbuffers::Vector> *keys() const { - return GetPointer> *>(VT_KEYS); + const flatbuffers::Vector> *keys() const { + return GetPointer> *>(VT_KEYS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && VerifyOffsetRequired(verifier, VT_AGGREGATIONS) && verifier.VerifyVector(aggregations()) && verifier.VerifyVectorOfTables(aggregations()) && @@ -2402,48 +2788,55 @@ struct AggregateOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -struct AggregateOptionsBuilder { - typedef AggregateOptions Table; +struct AggregateBuilder { + typedef Aggregate Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_aggregations(flatbuffers::Offset>> aggregations) { - fbb_.AddOffset(AggregateOptions::VT_AGGREGATIONS, aggregations); + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Aggregate::VT_BASE, base); + } + void add_aggregations(flatbuffers::Offset>> aggregations) { + fbb_.AddOffset(Aggregate::VT_AGGREGATIONS, aggregations); } - void add_keys(flatbuffers::Offset>> keys) { - fbb_.AddOffset(AggregateOptions::VT_KEYS, keys); + void add_keys(flatbuffers::Offset>> keys) { + fbb_.AddOffset(Aggregate::VT_KEYS, keys); } - explicit AggregateOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit AggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - AggregateOptionsBuilder &operator=(const AggregateOptionsBuilder &); - flatbuffers::Offset Finish() { + AggregateBuilder &operator=(const AggregateBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, AggregateOptions::VT_AGGREGATIONS); - fbb_.Required(o, AggregateOptions::VT_KEYS); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Aggregate::VT_AGGREGATIONS); + fbb_.Required(o, Aggregate::VT_KEYS); return o; } }; -inline flatbuffers::Offset CreateAggregateOptions( +inline flatbuffers::Offset CreateAggregate( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> aggregations = 0, - flatbuffers::Offset>> keys = 0) { - AggregateOptionsBuilder builder_(_fbb); + flatbuffers::Offset base = 0, + flatbuffers::Offset>> aggregations = 0, + flatbuffers::Offset>> keys = 0) { + AggregateBuilder builder_(_fbb); builder_.add_keys(keys); builder_.add_aggregations(aggregations); + builder_.add_base(base); return builder_.Finish(); } -inline flatbuffers::Offset CreateAggregateOptionsDirect( +inline flatbuffers::Offset CreateAggregateDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *aggregations = nullptr, - const std::vector> *keys = nullptr) { - auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; - auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; - return org::apache::arrow::flatbuf::computeir::CreateAggregateOptions( + flatbuffers::Offset base = 0, + const std::vector> *aggregations = nullptr, + const std::vector> *keys = nullptr) { + auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; + auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; + return org::apache::arrow::computeir::flatbuf::CreateAggregate( _fbb, + base, aggregations__, keys__); } @@ -2453,12 +2846,12 @@ struct CanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ID = 4 }; - org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId id() const { - return static_cast(GetField(VT_ID, 0)); + org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id() const { + return static_cast(GetField(VT_ID, 0)); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && + VerifyField(verifier, VT_ID) && verifier.EndTable(); } }; @@ -2467,8 +2860,8 @@ struct CanonicalJoinKindBuilder { typedef CanonicalJoinKind Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId id) { - fbb_.AddElement(CanonicalJoinKind::VT_ID, static_cast(id), 0); + void add_id(org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id) { + fbb_.AddElement(CanonicalJoinKind::VT_ID, static_cast(id), 0); } explicit CanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { @@ -2484,7 +2877,7 @@ struct CanonicalJoinKindBuilder { inline flatbuffers::Offset CreateCanonicalJoinKind( flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId id = org::apache::arrow::flatbuf::computeir::CanonicalJoinKindId::Inner) { + org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id = org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId::Anti) { CanonicalJoinKindBuilder builder_(_fbb); builder_.add_id(id); return builder_.Finish(); @@ -2504,7 +2897,7 @@ struct NonCanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME_SPACE) && + VerifyOffset(verifier, VT_NAME_SPACE) && verifier.VerifyString(name_space()) && VerifyOffsetRequired(verifier, VT_NAME) && verifier.VerifyString(name()) && @@ -2530,7 +2923,6 @@ struct NonCanonicalJoinKindBuilder { flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalJoinKind::VT_NAME_SPACE); fbb_.Required(o, NonCanonicalJoinKind::VT_NAME); return o; } @@ -2552,7 +2944,7 @@ inline flatbuffers::Offset CreateNonCanonicalJoinKindDirec const char *name = nullptr) { auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::flatbuf::computeir::CreateNonCanonicalJoinKind( + return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalJoinKind( _fbb, name_space__, name__); @@ -2560,35 +2952,41 @@ inline flatbuffers::Offset CreateNonCanonicalJoinKindDirec /// The contents of Relation.options will be JoinOptions /// if Relation.operation = CanonicalOperation::Join -struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef JoinOptionsBuilder Builder; +struct Join FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef JoinBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ON_EXPRESSION = 4, - VT_JOIN_KIND_TYPE = 6, - VT_JOIN_KIND = 8 + VT_BASE = 4, + VT_ON_EXPRESSION = 6, + VT_JOIN_KIND_TYPE = 8, + VT_JOIN_KIND = 10 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// The expression which will be evaluated against rows from each /// input to determine whether they should be included in the /// join relation's output. - const org::apache::arrow::flatbuf::computeir::Expression *on_expression() const { - return GetPointer(VT_ON_EXPRESSION); + const org::apache::arrow::computeir::flatbuf::Expression *on_expression() const { + return GetPointer(VT_ON_EXPRESSION); } - org::apache::arrow::flatbuf::computeir::JoinKind join_kind_type() const { - return static_cast(GetField(VT_JOIN_KIND_TYPE, 0)); + org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type() const { + return static_cast(GetField(VT_JOIN_KIND_TYPE, 0)); } /// The kind of join to use. const void *join_kind() const { return GetPointer(VT_JOIN_KIND); } template const T *join_kind_as() const; - const org::apache::arrow::flatbuf::computeir::CanonicalJoinKind *join_kind_as_CanonicalJoinKind() const { - return join_kind_type() == org::apache::arrow::flatbuf::computeir::JoinKind::CanonicalJoinKind ? static_cast(join_kind()) : nullptr; + const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *join_kind_as_CanonicalJoinKind() const { + return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::CanonicalJoinKind ? static_cast(join_kind()) : nullptr; } - const org::apache::arrow::flatbuf::computeir::NonCanonicalJoinKind *join_kind_as_NonCanonicalJoinKind() const { - return join_kind_type() == org::apache::arrow::flatbuf::computeir::JoinKind::NonCanonicalJoinKind ? static_cast(join_kind()) : nullptr; + const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *join_kind_as_NonCanonicalJoinKind() const { + return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::NonCanonicalJoinKind ? static_cast(join_kind()) : nullptr; } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && verifier.VerifyTable(on_expression()) && VerifyField(verifier, VT_JOIN_KIND_TYPE) && @@ -2598,49 +2996,54 @@ struct JoinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -template<> inline const org::apache::arrow::flatbuf::computeir::CanonicalJoinKind *JoinOptions::join_kind_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *Join::join_kind_as() const { return join_kind_as_CanonicalJoinKind(); } -template<> inline const org::apache::arrow::flatbuf::computeir::NonCanonicalJoinKind *JoinOptions::join_kind_as() const { +template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *Join::join_kind_as() const { return join_kind_as_NonCanonicalJoinKind(); } -struct JoinOptionsBuilder { - typedef JoinOptions Table; +struct JoinBuilder { + typedef Join Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_on_expression(flatbuffers::Offset on_expression) { - fbb_.AddOffset(JoinOptions::VT_ON_EXPRESSION, on_expression); + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Join::VT_BASE, base); } - void add_join_kind_type(org::apache::arrow::flatbuf::computeir::JoinKind join_kind_type) { - fbb_.AddElement(JoinOptions::VT_JOIN_KIND_TYPE, static_cast(join_kind_type), 0); + void add_on_expression(flatbuffers::Offset on_expression) { + fbb_.AddOffset(Join::VT_ON_EXPRESSION, on_expression); + } + void add_join_kind_type(org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type) { + fbb_.AddElement(Join::VT_JOIN_KIND_TYPE, static_cast(join_kind_type), 0); } void add_join_kind(flatbuffers::Offset join_kind) { - fbb_.AddOffset(JoinOptions::VT_JOIN_KIND, join_kind); + fbb_.AddOffset(Join::VT_JOIN_KIND, join_kind); } - explicit JoinOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit JoinBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - JoinOptionsBuilder &operator=(const JoinOptionsBuilder &); - flatbuffers::Offset Finish() { + JoinBuilder &operator=(const JoinBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, JoinOptions::VT_ON_EXPRESSION); - fbb_.Required(o, JoinOptions::VT_JOIN_KIND); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Join::VT_ON_EXPRESSION); + fbb_.Required(o, Join::VT_JOIN_KIND); return o; } }; -inline flatbuffers::Offset CreateJoinOptions( +inline flatbuffers::Offset CreateJoin( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset on_expression = 0, - org::apache::arrow::flatbuf::computeir::JoinKind join_kind_type = org::apache::arrow::flatbuf::computeir::JoinKind::NONE, + flatbuffers::Offset base = 0, + flatbuffers::Offset on_expression = 0, + org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type = org::apache::arrow::computeir::flatbuf::JoinKind::NONE, flatbuffers::Offset join_kind = 0) { - JoinOptionsBuilder builder_(_fbb); + JoinBuilder builder_(_fbb); builder_.add_join_kind(join_kind); builder_.add_on_expression(on_expression); + builder_.add_base(base); builder_.add_join_kind_type(join_kind_type); return builder_.Finish(); } @@ -2651,11 +3054,11 @@ struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_VALUE = 4, VT_ORDERING = 6 }; - const org::apache::arrow::flatbuf::computeir::Expression *value() const { - return GetPointer(VT_VALUE); + const org::apache::arrow::computeir::flatbuf::Expression *value() const { + return GetPointer(VT_VALUE); } - org::apache::arrow::flatbuf::computeir::Ordering ordering() const { - return static_cast(GetField(VT_ORDERING, 0)); + org::apache::arrow::computeir::flatbuf::Ordering ordering() const { + return static_cast(GetField(VT_ORDERING, 0)); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -2670,10 +3073,10 @@ struct SortKeyBuilder { typedef SortKey Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_value(flatbuffers::Offset value) { + void add_value(flatbuffers::Offset value) { fbb_.AddOffset(SortKey::VT_VALUE, value); } - void add_ordering(org::apache::arrow::flatbuf::computeir::Ordering ordering) { + void add_ordering(org::apache::arrow::computeir::flatbuf::Ordering ordering) { fbb_.AddElement(SortKey::VT_ORDERING, static_cast(ordering), 0); } explicit SortKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) @@ -2691,28 +3094,33 @@ struct SortKeyBuilder { inline flatbuffers::Offset CreateSortKey( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset value = 0, - org::apache::arrow::flatbuf::computeir::Ordering ordering = org::apache::arrow::flatbuf::computeir::Ordering::ASCENDING_THEN_NULLS) { + flatbuffers::Offset value = 0, + org::apache::arrow::computeir::flatbuf::Ordering ordering = org::apache::arrow::computeir::flatbuf::Ordering::ASCENDING_THEN_NULLS) { SortKeyBuilder builder_(_fbb); builder_.add_value(value); builder_.add_ordering(ordering); return builder_.Finish(); } -/// The contents of Relation.options will be OrderByOptions -/// if Relation.operation = CanonicalOperation::OrderBy -struct OrderByOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef OrderByOptionsBuilder Builder; +/// Order by relation +struct OrderBy FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef OrderByBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KEYS = 4 + VT_BASE = 4, + VT_KEYS = 6 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// Define sort order for rows of output. /// Keys with higher precedence are ordered ahead of other keys. - const flatbuffers::Vector> *keys() const { - return GetPointer> *>(VT_KEYS); + const flatbuffers::Vector> *keys() const { + return GetPointer> *>(VT_KEYS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && VerifyOffsetRequired(verifier, VT_KEYS) && verifier.VerifyVector(keys()) && verifier.VerifyVectorOfTables(keys()) && @@ -2720,95 +3128,115 @@ struct OrderByOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -struct OrderByOptionsBuilder { - typedef OrderByOptions Table; +struct OrderByBuilder { + typedef OrderBy Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_keys(flatbuffers::Offset>> keys) { - fbb_.AddOffset(OrderByOptions::VT_KEYS, keys); + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(OrderBy::VT_BASE, base); + } + void add_keys(flatbuffers::Offset>> keys) { + fbb_.AddOffset(OrderBy::VT_KEYS, keys); } - explicit OrderByOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit OrderByBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - OrderByOptionsBuilder &operator=(const OrderByOptionsBuilder &); - flatbuffers::Offset Finish() { + OrderByBuilder &operator=(const OrderByBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, OrderByOptions::VT_KEYS); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, OrderBy::VT_KEYS); return o; } }; -inline flatbuffers::Offset CreateOrderByOptions( +inline flatbuffers::Offset CreateOrderBy( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> keys = 0) { - OrderByOptionsBuilder builder_(_fbb); + flatbuffers::Offset base = 0, + flatbuffers::Offset>> keys = 0) { + OrderByBuilder builder_(_fbb); builder_.add_keys(keys); + builder_.add_base(base); return builder_.Finish(); } -inline flatbuffers::Offset CreateOrderByOptionsDirect( +inline flatbuffers::Offset CreateOrderByDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *keys = nullptr) { - auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; - return org::apache::arrow::flatbuf::computeir::CreateOrderByOptions( + flatbuffers::Offset base = 0, + const std::vector> *keys = nullptr) { + auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; + return org::apache::arrow::computeir::flatbuf::CreateOrderBy( _fbb, + base, keys__); } -/// The contents of Relation.options will be LimitOptions -/// if Relation.operation = CanonicalOperation::Limit -struct LimitOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LimitOptionsBuilder Builder; +/// Limit operation +struct Limit FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LimitBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_COUNT = 4 + VT_BASE = 4, + VT_COUNT = 6 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// Set the maximum number of rows of output. int64_t count() const { return GetField(VT_COUNT, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && VerifyField(verifier, VT_COUNT) && verifier.EndTable(); } }; -struct LimitOptionsBuilder { - typedef LimitOptions Table; +struct LimitBuilder { + typedef Limit Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Limit::VT_BASE, base); + } void add_count(int64_t count) { - fbb_.AddElement(LimitOptions::VT_COUNT, count, 0); + fbb_.AddElement(Limit::VT_COUNT, count, 0); } - explicit LimitOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit LimitBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - LimitOptionsBuilder &operator=(const LimitOptionsBuilder &); - flatbuffers::Offset Finish() { + LimitBuilder &operator=(const LimitBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateLimitOptions( +inline flatbuffers::Offset CreateLimit( flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, int64_t count = 0) { - LimitOptionsBuilder builder_(_fbb); + LimitBuilder builder_(_fbb); builder_.add_count(count); + builder_.add_base(base); return builder_.Finish(); } -/// The contents of Relation.options will be CommonOptions -/// if Relation.operation = CanonicalOperation::Common -struct CommonOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CommonOptionsBuilder Builder; +/// Common table expresssion +struct Common FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CommonBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME = 4 + VT_BASE = 4, + VT_NAME = 6 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// Commons (CTEs in SQL) allow assigning a name to a stream /// of data and reusing it, potentially multiple times and /// potentially recursively. @@ -2817,94 +3245,268 @@ struct CommonOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && VerifyOffsetRequired(verifier, VT_NAME) && verifier.VerifyString(name()) && verifier.EndTable(); } }; -struct CommonOptionsBuilder { - typedef CommonOptions Table; +struct CommonBuilder { + typedef Common Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Common::VT_BASE, base); + } void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(CommonOptions::VT_NAME, name); + fbb_.AddOffset(Common::VT_NAME, name); } - explicit CommonOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + explicit CommonBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - CommonOptionsBuilder &operator=(const CommonOptionsBuilder &); - flatbuffers::Offset Finish() { + CommonBuilder &operator=(const CommonBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, CommonOptions::VT_NAME); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Common::VT_NAME); return o; } }; -inline flatbuffers::Offset CreateCommonOptions( +inline flatbuffers::Offset CreateCommon( flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, flatbuffers::Offset name = 0) { - CommonOptionsBuilder builder_(_fbb); + CommonBuilder builder_(_fbb); builder_.add_name(name); + builder_.add_base(base); return builder_.Finish(); } -inline flatbuffers::Offset CreateCommonOptionsDirect( +inline flatbuffers::Offset CreateCommonDirect( flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, const char *name = nullptr) { auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::flatbuf::computeir::CreateCommonOptions( + return org::apache::arrow::computeir::flatbuf::CreateCommon( _fbb, + base, name__); } -/// The contents of Relation.options will be UnionOptions -/// if Relation.operation = CanonicalOperation::Union -struct UnionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UnionOptionsBuilder Builder; +struct CanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalSetOpKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id() const { + return static_cast(GetField(VT_ID, 0)); + } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && verifier.EndTable(); } }; -struct UnionOptionsBuilder { - typedef UnionOptions Table; +struct CanonicalSetOpKindBuilder { + typedef CanonicalSetOpKind Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - explicit UnionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + void add_id(org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id) { + fbb_.AddElement(CanonicalSetOpKind::VT_ID, static_cast(id), 0); + } + explicit CanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - UnionOptionsBuilder &operator=(const UnionOptionsBuilder &); - flatbuffers::Offset Finish() { + CanonicalSetOpKindBuilder &operator=(const CanonicalSetOpKindBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); + auto o = flatbuffers::Offset(end); return o; } }; -inline flatbuffers::Offset CreateUnionOptions( - flatbuffers::FlatBufferBuilder &_fbb) { - UnionOptionsBuilder builder_(_fbb); +inline flatbuffers::Offset CreateCanonicalSetOpKind( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id = org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId::Union) { + CanonicalSetOpKindBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalSetOpKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalSetOpKindBuilder { + typedef NonCanonicalSetOpKind Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME, name); + } + explicit NonCanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalSetOpKindBuilder &operator=(const NonCanonicalSetOpKindBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalSetOpKind::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalSetOpKind( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalSetOpKindBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); return builder_.Finish(); } -/// The contents of Relation.options will be LiteralOptions -/// if Relation.operation = CanonicalOperation::Literal -struct LiteralOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LiteralOptionsBuilder Builder; +inline flatbuffers::Offset CreateNonCanonicalSetOpKindDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalSetOpKind( + _fbb, + name_space__, + name__); +} + +/// A set operation on two or more relations +struct SetOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef SetOperationBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_COLUMNS = 4 + VT_BASE = 4, + VT_SET_OP_TYPE = 6, + VT_SET_OP = 8 }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type() const { + return static_cast(GetField(VT_SET_OP_TYPE, 0)); + } + /// The kind of set operation + const void *set_op() const { + return GetPointer(VT_SET_OP); + } + template const T *set_op_as() const; + const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *set_op_as_CanonicalSetOpKind() const { + return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::CanonicalSetOpKind ? static_cast(set_op()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *set_op_as_NonCanonicalSetOpKind() const { + return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::NonCanonicalSetOpKind ? static_cast(set_op()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyField(verifier, VT_SET_OP_TYPE) && + VerifyOffsetRequired(verifier, VT_SET_OP) && + VerifySetOpKind(verifier, set_op(), set_op_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *SetOperation::set_op_as() const { + return set_op_as_CanonicalSetOpKind(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *SetOperation::set_op_as() const { + return set_op_as_NonCanonicalSetOpKind(); +} + +struct SetOperationBuilder { + typedef SetOperation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(SetOperation::VT_BASE, base); + } + void add_set_op_type(org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type) { + fbb_.AddElement(SetOperation::VT_SET_OP_TYPE, static_cast(set_op_type), 0); + } + void add_set_op(flatbuffers::Offset set_op) { + fbb_.AddOffset(SetOperation::VT_SET_OP, set_op); + } + explicit SetOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + SetOperationBuilder &operator=(const SetOperationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, SetOperation::VT_BASE); + fbb_.Required(o, SetOperation::VT_SET_OP); + return o; + } +}; + +inline flatbuffers::Offset CreateSetOperation( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type = org::apache::arrow::computeir::flatbuf::SetOpKind::NONE, + flatbuffers::Offset set_op = 0) { + SetOperationBuilder builder_(_fbb); + builder_.add_set_op(set_op); + builder_.add_base(base); + builder_.add_set_op_type(set_op_type); + return builder_.Finish(); +} + +/// Literal relation +struct LiteralRelation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LiteralRelationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_COLUMNS = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } /// The columns of this literal relation. - const flatbuffers::Vector> *columns() const { - return GetPointer> *>(VT_COLUMNS); + const flatbuffers::Vector> *columns() const { + return GetPointer> *>(VT_COLUMNS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && VerifyOffsetRequired(verifier, VT_COLUMNS) && verifier.VerifyVector(columns()) && verifier.VerifyVectorOfTables(columns()) && @@ -2912,43 +3514,418 @@ struct LiteralOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { } }; -struct LiteralOptionsBuilder { - typedef LiteralOptions Table; +struct LiteralRelationBuilder { + typedef LiteralRelation Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_columns(flatbuffers::Offset>> columns) { - fbb_.AddOffset(LiteralOptions::VT_COLUMNS, columns); + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(LiteralRelation::VT_BASE, base); } - explicit LiteralOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + void add_columns(flatbuffers::Offset>> columns) { + fbb_.AddOffset(LiteralRelation::VT_COLUMNS, columns); + } + explicit LiteralRelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - LiteralOptionsBuilder &operator=(const LiteralOptionsBuilder &); - flatbuffers::Offset Finish() { + LiteralRelationBuilder &operator=(const LiteralRelationBuilder &); + flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, LiteralOptions::VT_COLUMNS); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, LiteralRelation::VT_BASE); + fbb_.Required(o, LiteralRelation::VT_COLUMNS); return o; } }; -inline flatbuffers::Offset CreateLiteralOptions( +inline flatbuffers::Offset CreateLiteralRelation( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> columns = 0) { - LiteralOptionsBuilder builder_(_fbb); + flatbuffers::Offset base = 0, + flatbuffers::Offset>> columns = 0) { + LiteralRelationBuilder builder_(_fbb); builder_.add_columns(columns); + builder_.add_base(base); return builder_.Finish(); } -inline flatbuffers::Offset CreateLiteralOptionsDirect( +inline flatbuffers::Offset CreateLiteralRelationDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *columns = nullptr) { - auto columns__ = columns ? _fbb.CreateVector>(*columns) : 0; - return org::apache::arrow::flatbuf::computeir::CreateLiteralOptions( + flatbuffers::Offset base = 0, + const std::vector> *columns = nullptr) { + auto columns__ = columns ? _fbb.CreateVector>(*columns) : 0; + return org::apache::arrow::computeir::flatbuf::CreateLiteralRelation( _fbb, + base, columns__); } +/// A user-defined relation +struct Custom FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CustomBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + verifier.EndTable(); + } +}; + +struct CustomBuilder { + typedef Custom Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Custom::VT_BASE, base); + } + explicit CustomBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CustomBuilder &operator=(const CustomBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCustom( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0) { + CustomBuilder builder_(_fbb); + builder_.add_base(base); + return builder_.Finish(); +} + +struct Read FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ReadBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_RESOURCE = 6, + VT_OPTIONS = 8, + VT_SCHEMA = 10 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + const flatbuffers::String *resource() const { + return GetPointer(VT_RESOURCE); + } + const flatbuffers::Vector> *options() const { + return GetPointer> *>(VT_OPTIONS); + } + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_RESOURCE) && + verifier.VerifyString(resource()) && + VerifyOffset(verifier, VT_OPTIONS) && + verifier.VerifyVector(options()) && + verifier.VerifyVectorOfTables(options()) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct ReadBuilder { + typedef Read Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Read::VT_BASE, base); + } + void add_resource(flatbuffers::Offset resource) { + fbb_.AddOffset(Read::VT_RESOURCE, resource); + } + void add_options(flatbuffers::Offset>> options) { + fbb_.AddOffset(Read::VT_OPTIONS, options); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Read::VT_SCHEMA, schema); + } + explicit ReadBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ReadBuilder &operator=(const ReadBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Read::VT_RESOURCE); + fbb_.Required(o, Read::VT_SCHEMA); + return o; + } +}; + +inline flatbuffers::Offset CreateRead( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset resource = 0, + flatbuffers::Offset>> options = 0, + flatbuffers::Offset schema = 0) { + ReadBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_options(options); + builder_.add_resource(resource); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateReadDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const char *resource = nullptr, + const std::vector> *options = nullptr, + flatbuffers::Offset schema = 0) { + auto resource__ = resource ? _fbb.CreateString(resource) : 0; + auto options__ = options ? _fbb.CreateVector>(*options) : 0; + return org::apache::arrow::computeir::flatbuf::CreateRead( + _fbb, + base, + resource__, + options__, + schema); +} + +struct Write FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef WriteBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_RESOURCE = 6, + VT_OPTIONS = 8, + VT_SCHEMA = 10 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + const flatbuffers::String *resource() const { + return GetPointer(VT_RESOURCE); + } + const flatbuffers::Vector> *options() const { + return GetPointer> *>(VT_OPTIONS); + } + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_RESOURCE) && + verifier.VerifyString(resource()) && + VerifyOffset(verifier, VT_OPTIONS) && + verifier.VerifyVector(options()) && + verifier.VerifyVectorOfTables(options()) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct WriteBuilder { + typedef Write Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Write::VT_BASE, base); + } + void add_resource(flatbuffers::Offset resource) { + fbb_.AddOffset(Write::VT_RESOURCE, resource); + } + void add_options(flatbuffers::Offset>> options) { + fbb_.AddOffset(Write::VT_OPTIONS, options); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Write::VT_SCHEMA, schema); + } + explicit WriteBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + WriteBuilder &operator=(const WriteBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Write::VT_RESOURCE); + fbb_.Required(o, Write::VT_SCHEMA); + return o; + } +}; + +inline flatbuffers::Offset CreateWrite( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset resource = 0, + flatbuffers::Offset>> options = 0, + flatbuffers::Offset schema = 0) { + WriteBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_options(options); + builder_.add_resource(resource); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateWriteDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const char *resource = nullptr, + const std::vector> *options = nullptr, + flatbuffers::Offset schema = 0) { + auto resource__ = resource ? _fbb.CreateString(resource) : 0; + auto options__ = options ? _fbb.CreateVector>(*options) : 0; + return org::apache::arrow::computeir::flatbuf::CreateWrite( + _fbb, + base, + resource__, + options__, + schema); +} + +/// A table holding an instance of the possible relation types. +struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef RelationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_REL_TYPE = 4, + VT_REL = 6 + }; + org::apache::arrow::computeir::flatbuf::RelationImpl rel_type() const { + return static_cast(GetField(VT_REL_TYPE, 0)); + } + const void *rel() const { + return GetPointer(VT_REL); + } + template const T *rel_as() const; + const org::apache::arrow::computeir::flatbuf::Aggregate *rel_as_Aggregate() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Aggregate ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Common *rel_as_Common() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Common ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Custom *rel_as_Custom() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Custom ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::SetOperation *rel_as_SetOperation() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::SetOperation ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Filter *rel_as_Filter() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Filter ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Limit *rel_as_Limit() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Limit ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::LiteralRelation *rel_as_LiteralRelation() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::LiteralRelation ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::OrderBy *rel_as_OrderBy() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::OrderBy ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Project *rel_as_Project() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Project ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Read *rel_as_Read() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Read ? static_cast(rel()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Write *rel_as_Write() const { + return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Write ? static_cast(rel()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_REL_TYPE) && + VerifyOffsetRequired(verifier, VT_REL) && + VerifyRelationImpl(verifier, rel(), rel_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Aggregate *Relation::rel_as() const { + return rel_as_Aggregate(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Common *Relation::rel_as() const { + return rel_as_Common(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Custom *Relation::rel_as() const { + return rel_as_Custom(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::SetOperation *Relation::rel_as() const { + return rel_as_SetOperation(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Filter *Relation::rel_as() const { + return rel_as_Filter(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Limit *Relation::rel_as() const { + return rel_as_Limit(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::LiteralRelation *Relation::rel_as() const { + return rel_as_LiteralRelation(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::OrderBy *Relation::rel_as() const { + return rel_as_OrderBy(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Project *Relation::rel_as() const { + return rel_as_Project(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Read *Relation::rel_as() const { + return rel_as_Read(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Write *Relation::rel_as() const { + return rel_as_Write(); +} + +struct RelationBuilder { + typedef Relation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_rel_type(org::apache::arrow::computeir::flatbuf::RelationImpl rel_type) { + fbb_.AddElement(Relation::VT_REL_TYPE, static_cast(rel_type), 0); + } + void add_rel(flatbuffers::Offset rel) { + fbb_.AddOffset(Relation::VT_REL, rel); + } + explicit RelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + RelationBuilder &operator=(const RelationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Relation::VT_REL); + return o; + } +}; + +inline flatbuffers::Offset CreateRelation( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::RelationImpl rel_type = org::apache::arrow::computeir::flatbuf::RelationImpl::NONE, + flatbuffers::Offset rel = 0) { + RelationBuilder builder_(_fbb); + builder_.add_rel(rel); + builder_.add_rel_type(rel_type); + return builder_.Finish(); +} + /// A specification of a query. struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef PlanBuilder Builder; @@ -2957,14 +3934,14 @@ struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_DERIVED_FROM = 6 }; /// One or more output relations. - const flatbuffers::Vector> *sinks() const { - return GetPointer> *>(VT_SINKS); + const flatbuffers::Vector> *sinks() const { + return GetPointer> *>(VT_SINKS); } /// If this Plan was derived from another (for example by running /// an optimization pass), that plan may be included here to /// provide a backtrace of derivations. - const org::apache::arrow::flatbuf::computeir::Plan *derived_from() const { - return GetPointer(VT_DERIVED_FROM); + const org::apache::arrow::computeir::flatbuf::Plan *derived_from() const { + return GetPointer(VT_DERIVED_FROM); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && @@ -2981,10 +3958,10 @@ struct PlanBuilder { typedef Plan Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; - void add_sinks(flatbuffers::Offset>> sinks) { + void add_sinks(flatbuffers::Offset>> sinks) { fbb_.AddOffset(Plan::VT_SINKS, sinks); } - void add_derived_from(flatbuffers::Offset derived_from) { + void add_derived_from(flatbuffers::Offset derived_from) { fbb_.AddOffset(Plan::VT_DERIVED_FROM, derived_from); } explicit PlanBuilder(flatbuffers::FlatBufferBuilder &_fbb) @@ -3002,8 +3979,8 @@ struct PlanBuilder { inline flatbuffers::Offset CreatePlan( flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> sinks = 0, - flatbuffers::Offset derived_from = 0) { + flatbuffers::Offset>> sinks = 0, + flatbuffers::Offset derived_from = 0) { PlanBuilder builder_(_fbb); builder_.add_derived_from(derived_from); builder_.add_sinks(sinks); @@ -3012,10 +3989,10 @@ inline flatbuffers::Offset CreatePlan( inline flatbuffers::Offset CreatePlanDirect( flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *sinks = nullptr, - flatbuffers::Offset derived_from = 0) { - auto sinks__ = sinks ? _fbb.CreateVector>(*sinks) : 0; - return org::apache::arrow::flatbuf::computeir::CreatePlan( + const std::vector> *sinks = nullptr, + flatbuffers::Offset derived_from = 0) { + auto sinks__ = sinks ? _fbb.CreateVector>(*sinks) : 0; + return org::apache::arrow::computeir::flatbuf::CreatePlan( _fbb, sinks__, derived_from); @@ -3027,47 +4004,47 @@ inline bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void * return true; } case InlineBufferImpl::Int8Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::Int16Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::Int32Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::Int64Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::UInt8Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::UInt16Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::UInt32Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::UInt64Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::Float32Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::Float64Buffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case InlineBufferImpl::TableBuffer: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; @@ -3092,15 +4069,15 @@ inline bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *ob return true; } case ExpressionImpl::Literal: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case ExpressionImpl::FieldRef: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case ExpressionImpl::Call: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; @@ -3125,11 +4102,11 @@ inline bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape return true; } case Shape::Array: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case Shape::Scalar: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; @@ -3148,58 +4125,99 @@ inline bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers return true; } -inline bool VerifyFunction(flatbuffers::Verifier &verifier, const void *obj, Function type) { +inline bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type) { + switch (type) { + case Deref::NONE: { + return true; + } + case Deref::MapKey: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::StructField: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::ArraySubscript: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::ArraySlice: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::FieldName: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyDeref( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type) { switch (type) { - case Function::NONE: { + case FunctionImpl::NONE: { return true; } - case Function::CanonicalFunction: { - auto ptr = reinterpret_cast(obj); + case FunctionImpl::CanonicalFunction: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } - case Function::NonCanonicalFunction: { - auto ptr = reinterpret_cast(obj); + case FunctionImpl::NonCanonicalFunction: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; } } -inline bool VerifyFunctionVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { +inline bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { if (!values || !types) return !values && !types; if (values->size() != types->size()) return false; for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyFunction( - verifier, values->Get(i), types->GetEnum(i))) { + if (!VerifyFunctionImpl( + verifier, values->Get(i), types->GetEnum(i))) { return false; } } return true; } -inline bool VerifyOperation(flatbuffers::Verifier &verifier, const void *obj, Operation type) { +inline bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type) { switch (type) { - case Operation::NONE: { + case Emit::NONE: { return true; } - case Operation::CanonicalOperation: { - auto ptr = reinterpret_cast(obj); + case Emit::Remap: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } - case Operation::NonCanonicalOperation: { - auto ptr = reinterpret_cast(obj); + case Emit::PassThrough: { + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; } } -inline bool VerifyOperationVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { +inline bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { if (!values || !types) return !values && !types; if (values->size() != types->size()) return false; for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyOperation( - verifier, values->Get(i), types->GetEnum(i))) { + if (!VerifyEmit( + verifier, values->Get(i), types->GetEnum(i))) { return false; } } @@ -3212,11 +4230,11 @@ inline bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, Joi return true; } case JoinKind::CanonicalJoinKind: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } case JoinKind::NonCanonicalJoinKind: { - auto ptr = reinterpret_cast(obj); + auto ptr = reinterpret_cast(obj); return verifier.VerifyTable(ptr); } default: return true; @@ -3235,40 +4253,134 @@ inline bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuff return true; } -inline const org::apache::arrow::flatbuf::computeir::Plan *GetPlan(const void *buf) { - return flatbuffers::GetRoot(buf); +inline bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type) { + switch (type) { + case SetOpKind::NONE: { + return true; + } + case SetOpKind::CanonicalSetOpKind: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case SetOpKind::NonCanonicalSetOpKind: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } } -inline const org::apache::arrow::flatbuf::computeir::Plan *GetSizePrefixedPlan(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); +inline bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifySetOpKind( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type) { + switch (type) { + case RelationImpl::NONE: { + return true; + } + case RelationImpl::Aggregate: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Common: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Custom: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::SetOperation: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Filter: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Limit: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::LiteralRelation: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::OrderBy: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Project: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Read: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Write: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyRelationImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const org::apache::arrow::computeir::flatbuf::Plan *GetPlan(const void *buf) { + return flatbuffers::GetRoot(buf); +} + +inline const org::apache::arrow::computeir::flatbuf::Plan *GetSizePrefixedPlan(const void *buf) { + return flatbuffers::GetSizePrefixedRoot(buf); } inline bool VerifyPlanBuffer( flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); + return verifier.VerifyBuffer(nullptr); } inline bool VerifySizePrefixedPlanBuffer( flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); + return verifier.VerifySizePrefixedBuffer(nullptr); } inline void FinishPlanBuffer( flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { + flatbuffers::Offset root) { fbb.Finish(root); } inline void FinishSizePrefixedPlanBuffer( flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { + flatbuffers::Offset root) { fbb.FinishSizePrefixed(root); } -} // namespace computeir } // namespace flatbuf +} // namespace computeir } // namespace arrow } // namespace apache } // namespace org -#endif // FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_FLATBUF_COMPUTEIR_H_ +#endif // FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/ExampleExtensions_generated.h b/cpp/src/generated/ExampleExtensions_generated.h new file mode 100644 index 0000000000000..fc98c8f689503 --- /dev/null +++ b/cpp/src/generated/ExampleExtensions_generated.h @@ -0,0 +1,691 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_EXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ +#define FLATBUFFERS_GENERATED_EXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ + +#include "flatbuffers/flatbuffers.h" + +#include "Schema_generated.h" + +namespace org { +namespace apache { +namespace arrow { +namespace computeir { +namespace flatbuf { +namespace ext { + +struct Uri; +struct UriBuilder; + +struct Sql_FromOptions; +struct Sql_FromOptionsBuilder; + +struct Partitioning; +struct PartitioningBuilder; + +struct FileFormat; +struct FileFormatBuilder; + +struct Arrow_FileSystemDatasetScanOptions; +struct Arrow_FileSystemDatasetScanOptionsBuilder; + +struct Sql_IntoOptions; +struct Sql_IntoOptionsBuilder; + +struct Arrow_StreamOutOptions; +struct Arrow_StreamOutOptionsBuilder; + +struct Arrow_FileSystemDatasetWriteOptions; +struct Arrow_FileSystemDatasetWriteOptionsBuilder; + +///////////////////////////////////////////////////////////// +struct Uri FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UriBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SCHEMA = 4, + VT_USERINFO = 6, + VT_HOST = 8, + VT_PORT = 10, + VT_PATH = 12, + VT_QUERY = 14, + VT_FRAGMENT = 16 + }; + const flatbuffers::String *schema() const { + return GetPointer(VT_SCHEMA); + } + const flatbuffers::String *userinfo() const { + return GetPointer(VT_USERINFO); + } + const flatbuffers::String *host() const { + return GetPointer(VT_HOST); + } + uint16_t port() const { + return GetField(VT_PORT, 0); + } + const flatbuffers::String *path() const { + return GetPointer(VT_PATH); + } + const flatbuffers::Vector> *query() const { + return GetPointer> *>(VT_QUERY); + } + const flatbuffers::String *fragment() const { + return GetPointer(VT_FRAGMENT); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyString(schema()) && + VerifyOffset(verifier, VT_USERINFO) && + verifier.VerifyString(userinfo()) && + VerifyOffsetRequired(verifier, VT_HOST) && + verifier.VerifyString(host()) && + VerifyField(verifier, VT_PORT) && + VerifyOffsetRequired(verifier, VT_PATH) && + verifier.VerifyString(path()) && + VerifyOffset(verifier, VT_QUERY) && + verifier.VerifyVector(query()) && + verifier.VerifyVectorOfTables(query()) && + VerifyOffset(verifier, VT_FRAGMENT) && + verifier.VerifyString(fragment()) && + verifier.EndTable(); + } +}; + +struct UriBuilder { + typedef Uri Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Uri::VT_SCHEMA, schema); + } + void add_userinfo(flatbuffers::Offset userinfo) { + fbb_.AddOffset(Uri::VT_USERINFO, userinfo); + } + void add_host(flatbuffers::Offset host) { + fbb_.AddOffset(Uri::VT_HOST, host); + } + void add_port(uint16_t port) { + fbb_.AddElement(Uri::VT_PORT, port, 0); + } + void add_path(flatbuffers::Offset path) { + fbb_.AddOffset(Uri::VT_PATH, path); + } + void add_query(flatbuffers::Offset>> query) { + fbb_.AddOffset(Uri::VT_QUERY, query); + } + void add_fragment(flatbuffers::Offset fragment) { + fbb_.AddOffset(Uri::VT_FRAGMENT, fragment); + } + explicit UriBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UriBuilder &operator=(const UriBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Uri::VT_SCHEMA); + fbb_.Required(o, Uri::VT_HOST); + fbb_.Required(o, Uri::VT_PATH); + return o; + } +}; + +inline flatbuffers::Offset CreateUri( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset schema = 0, + flatbuffers::Offset userinfo = 0, + flatbuffers::Offset host = 0, + uint16_t port = 0, + flatbuffers::Offset path = 0, + flatbuffers::Offset>> query = 0, + flatbuffers::Offset fragment = 0) { + UriBuilder builder_(_fbb); + builder_.add_fragment(fragment); + builder_.add_query(query); + builder_.add_path(path); + builder_.add_host(host); + builder_.add_userinfo(userinfo); + builder_.add_schema(schema); + builder_.add_port(port); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUriDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *schema = nullptr, + const char *userinfo = nullptr, + const char *host = nullptr, + uint16_t port = 0, + const char *path = nullptr, + const std::vector> *query = nullptr, + const char *fragment = nullptr) { + auto schema__ = schema ? _fbb.CreateString(schema) : 0; + auto userinfo__ = userinfo ? _fbb.CreateString(userinfo) : 0; + auto host__ = host ? _fbb.CreateString(host) : 0; + auto path__ = path ? _fbb.CreateString(path) : 0; + auto query__ = query ? _fbb.CreateVector>(*query) : 0; + auto fragment__ = fragment ? _fbb.CreateString(fragment) : 0; + return org::apache::arrow::computeir::flatbuf::ext::CreateUri( + _fbb, + schema__, + userinfo__, + host__, + port, + path__, + query__, + fragment__); +} + +/// The contents of Relation.options will be Sql_FromOptions +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "sql", +/// .name = "from", +/// } +struct Sql_FromOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Sql_FromOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4 + }; + /// The name of a table referenced as a source relation. + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct Sql_FromOptionsBuilder { + typedef Sql_FromOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(Sql_FromOptions::VT_NAME, name); + } + explicit Sql_FromOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Sql_FromOptionsBuilder &operator=(const Sql_FromOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Sql_FromOptions::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateSql_FromOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0) { + Sql_FromOptionsBuilder builder_(_fbb); + builder_.add_name(name); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateSql_FromOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::ext::CreateSql_FromOptions( + _fbb, + name__); +} + +struct Partitioning FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef PartitioningBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_FLAVOR = 4, + VT_SCHEMA = 6 + }; + /// Currently supported: "hive", "directory" + const flatbuffers::String *flavor() const { + return GetPointer(VT_FLAVOR); + } + /// Fields on which data is partitioned + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_FLAVOR) && + verifier.VerifyString(flavor()) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct PartitioningBuilder { + typedef Partitioning Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_flavor(flatbuffers::Offset flavor) { + fbb_.AddOffset(Partitioning::VT_FLAVOR, flavor); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Partitioning::VT_SCHEMA, schema); + } + explicit PartitioningBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + PartitioningBuilder &operator=(const PartitioningBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Partitioning::VT_FLAVOR); + fbb_.Required(o, Partitioning::VT_SCHEMA); + return o; + } +}; + +inline flatbuffers::Offset CreatePartitioning( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset flavor = 0, + flatbuffers::Offset schema = 0) { + PartitioningBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_flavor(flavor); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreatePartitioningDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *flavor = nullptr, + flatbuffers::Offset schema = 0) { + auto flavor__ = flavor ? _fbb.CreateString(flavor) : 0; + return org::apache::arrow::computeir::flatbuf::ext::CreatePartitioning( + _fbb, + flavor__, + schema); +} + +struct FileFormat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FileFormatBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4, + VT_OPTIONS = 6 + }; + /// E.g. "parquet", "csv", ... + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + const org::apache::arrow::flatbuf::Buffer *options() const { + return GetStruct(VT_OPTIONS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + VerifyField(verifier, VT_OPTIONS) && + verifier.EndTable(); + } +}; + +struct FileFormatBuilder { + typedef FileFormat Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(FileFormat::VT_NAME, name); + } + void add_options(const org::apache::arrow::flatbuf::Buffer *options) { + fbb_.AddStruct(FileFormat::VT_OPTIONS, options); + } + explicit FileFormatBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FileFormatBuilder &operator=(const FileFormatBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, FileFormat::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateFileFormat( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0, + const org::apache::arrow::flatbuf::Buffer *options = 0) { + FileFormatBuilder builder_(_fbb); + builder_.add_options(options); + builder_.add_name(name); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateFileFormatDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr, + const org::apache::arrow::flatbuf::Buffer *options = 0) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::ext::CreateFileFormat( + _fbb, + name__, + options); +} + +/// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "filesystem_dataset_scan", +/// } +struct Arrow_FileSystemDatasetScanOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Arrow_FileSystemDatasetScanOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE_DIR = 4, + VT_FORMAT = 6, + VT_PARTITIONING = 8 + }; + /// The base directory of a dataset which should be scanned + /// as a source relation. A URI is used to accommodate potentially + /// remote file systems. + const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { + return GetPointer(VT_BASE_DIR); + } + /// The format of files in this dataset. + const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { + return GetPointer(VT_FORMAT); + } + /// A partitioning scheme in use in this dataset. + const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { + return GetPointer(VT_PARTITIONING); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE_DIR) && + verifier.VerifyTable(base_dir()) && + VerifyOffsetRequired(verifier, VT_FORMAT) && + verifier.VerifyTable(format()) && + VerifyOffset(verifier, VT_PARTITIONING) && + verifier.VerifyTable(partitioning()) && + verifier.EndTable(); + } +}; + +struct Arrow_FileSystemDatasetScanOptionsBuilder { + typedef Arrow_FileSystemDatasetScanOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base_dir(flatbuffers::Offset base_dir) { + fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR, base_dir); + } + void add_format(flatbuffers::Offset format) { + fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_FORMAT, format); + } + void add_partitioning(flatbuffers::Offset partitioning) { + fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_PARTITIONING, partitioning); + } + explicit Arrow_FileSystemDatasetScanOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Arrow_FileSystemDatasetScanOptionsBuilder &operator=(const Arrow_FileSystemDatasetScanOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR); + fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_FORMAT); + return o; + } +}; + +inline flatbuffers::Offset CreateArrow_FileSystemDatasetScanOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0) { + Arrow_FileSystemDatasetScanOptionsBuilder builder_(_fbb); + builder_.add_partitioning(partitioning); + builder_.add_format(format); + builder_.add_base_dir(base_dir); + return builder_.Finish(); +} + +///////////////////////////////////////////////////////////// +/// The contents of Relation.options will be Sql_IntoOptions +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "sql", +/// .name = "into", +/// } +struct Sql_IntoOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Sql_IntoOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4, + VT_APPEND = 6 + }; + /// The name of a table into which rows will be inserted. + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + /// Whether rows written into the table should be appended + /// to the table's current rows (INSERT INTO). + /// If false, the table will be overwritten (INTO). + bool append() const { + return GetField(VT_APPEND, 1) != 0; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + VerifyField(verifier, VT_APPEND) && + verifier.EndTable(); + } +}; + +struct Sql_IntoOptionsBuilder { + typedef Sql_IntoOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(Sql_IntoOptions::VT_NAME, name); + } + void add_append(bool append) { + fbb_.AddElement(Sql_IntoOptions::VT_APPEND, static_cast(append), 1); + } + explicit Sql_IntoOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Sql_IntoOptionsBuilder &operator=(const Sql_IntoOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Sql_IntoOptions::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateSql_IntoOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0, + bool append = true) { + Sql_IntoOptionsBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_append(append); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateSql_IntoOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr, + bool append = true) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::ext::CreateSql_IntoOptions( + _fbb, + name__, + append); +} + +/// The contents of Relation.options will be Arrow_StreamOutOptions +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "stream_out", +/// } +struct Arrow_StreamOutOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Arrow_StreamOutOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_DESTINATION = 4 + }; + /// The URI to which RecordBatches of output should be streamed. + const org::apache::arrow::computeir::flatbuf::ext::Uri *destination() const { + return GetPointer(VT_DESTINATION); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_DESTINATION) && + verifier.VerifyTable(destination()) && + verifier.EndTable(); + } +}; + +struct Arrow_StreamOutOptionsBuilder { + typedef Arrow_StreamOutOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_destination(flatbuffers::Offset destination) { + fbb_.AddOffset(Arrow_StreamOutOptions::VT_DESTINATION, destination); + } + explicit Arrow_StreamOutOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Arrow_StreamOutOptionsBuilder &operator=(const Arrow_StreamOutOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Arrow_StreamOutOptions::VT_DESTINATION); + return o; + } +}; + +inline flatbuffers::Offset CreateArrow_StreamOutOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset destination = 0) { + Arrow_StreamOutOptionsBuilder builder_(_fbb); + builder_.add_destination(destination); + return builder_.Finish(); +} + +/// The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions +/// if Relation.operation = NonCanonicalOperation{ +/// .name_space = "arrow", +/// .name = "filesystem_dataset_write", +/// } +struct Arrow_FileSystemDatasetWriteOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Arrow_FileSystemDatasetWriteOptionsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE_DIR = 4, + VT_FORMAT = 6, + VT_PARTITIONING = 8, + VT_BASENAME_TEMPLATE = 10 + }; + /// The base directory of a dataset into which output batches should be + /// written. A URI is used to accommodate potentially remote file systems. + /// Files present in this directory will not be explicitly deleted, though + /// they may be overwritten. + const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { + return GetPointer(VT_BASE_DIR); + } + /// The format in which to write files. + const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { + return GetPointer(VT_FORMAT); + } + /// A partitioning scheme which should be used when writing this dataset. + const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { + return GetPointer(VT_PARTITIONING); + } + /// Template string used to generate written files' basenames. + /// {i} will be replaced by an auto incremented integer. + const flatbuffers::String *basename_template() const { + return GetPointer(VT_BASENAME_TEMPLATE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE_DIR) && + verifier.VerifyTable(base_dir()) && + VerifyOffsetRequired(verifier, VT_FORMAT) && + verifier.VerifyTable(format()) && + VerifyOffset(verifier, VT_PARTITIONING) && + verifier.VerifyTable(partitioning()) && + VerifyOffsetRequired(verifier, VT_BASENAME_TEMPLATE) && + verifier.VerifyString(basename_template()) && + verifier.EndTable(); + } +}; + +struct Arrow_FileSystemDatasetWriteOptionsBuilder { + typedef Arrow_FileSystemDatasetWriteOptions Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base_dir(flatbuffers::Offset base_dir) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR, base_dir); + } + void add_format(flatbuffers::Offset format) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_FORMAT, format); + } + void add_partitioning(flatbuffers::Offset partitioning) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_PARTITIONING, partitioning); + } + void add_basename_template(flatbuffers::Offset basename_template) { + fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE, basename_template); + } + explicit Arrow_FileSystemDatasetWriteOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Arrow_FileSystemDatasetWriteOptionsBuilder &operator=(const Arrow_FileSystemDatasetWriteOptionsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR); + fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_FORMAT); + fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE); + return o; + } +}; + +inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptions( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0, + flatbuffers::Offset basename_template = 0) { + Arrow_FileSystemDatasetWriteOptionsBuilder builder_(_fbb); + builder_.add_basename_template(basename_template); + builder_.add_partitioning(partitioning); + builder_.add_format(format); + builder_.add_base_dir(base_dir); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptionsDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base_dir = 0, + flatbuffers::Offset format = 0, + flatbuffers::Offset partitioning = 0, + const char *basename_template = nullptr) { + auto basename_template__ = basename_template ? _fbb.CreateString(basename_template) : 0; + return org::apache::arrow::computeir::flatbuf::ext::CreateArrow_FileSystemDatasetWriteOptions( + _fbb, + base_dir, + format, + partitioning, + basename_template__); +} + +} // namespace ext +} // namespace flatbuf +} // namespace computeir +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_EXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ diff --git a/cpp/src/generated/Expression_generated.h b/cpp/src/generated/Expression_generated.h new file mode 100644 index 0000000000000..0f5667f03c824 --- /dev/null +++ b/cpp/src/generated/Expression_generated.h @@ -0,0 +1,2657 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_EXPRESSION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ +#define FLATBUFFERS_GENERATED_EXPRESSION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ + +#include "flatbuffers/flatbuffers.h" + +#include "Schema_generated.h" +#include "InlineBuffer_generated.h" +#include "Literal_generated.h" + +namespace org { +namespace apache { +namespace arrow { +namespace computeir { +namespace flatbuf { + +struct MapKey; +struct MapKeyBuilder; + +struct StructField; +struct StructFieldBuilder; + +struct ArraySubscript; +struct ArraySubscriptBuilder; + +struct ArraySlice; +struct ArraySliceBuilder; + +struct FieldName; +struct FieldNameBuilder; + +struct FieldRef; +struct FieldRefBuilder; + +struct CanonicalFunction; +struct CanonicalFunctionBuilder; + +struct NonCanonicalFunction; +struct NonCanonicalFunctionBuilder; + +struct Call; +struct CallBuilder; + +struct CaseFragment; +struct CaseFragmentBuilder; + +struct Case; +struct CaseBuilder; + +struct Cast; +struct CastBuilder; + +struct Extract; +struct ExtractBuilder; + +struct SortKey; +struct SortKeyBuilder; + +struct Unbounded; +struct UnboundedBuilder; + +struct Preceding; +struct PrecedingBuilder; + +struct Following; +struct FollowingBuilder; + +struct CurrentRow; +struct CurrentRowBuilder; + +struct Bound; +struct BoundBuilder; + +struct WindowCall; +struct WindowCallBuilder; + +struct CanonicalAggregate; +struct CanonicalAggregateBuilder; + +struct NonCanonicalAggregate; +struct NonCanonicalAggregateBuilder; + +struct AggregateCall; +struct AggregateCallBuilder; + +struct Expression; +struct ExpressionBuilder; + +/// A union of possible dereference operations +enum class Deref : uint8_t { + NONE = 0, + /// Access a value for a given map key + MapKey = 1, + /// Access the value at a struct field + StructField = 2, + /// Access the element at a given index in an array + ArraySubscript = 3, + /// Access a range of elements in an array + ArraySlice = 4, + /// Access a field of a relation + FieldName = 5, + MIN = NONE, + MAX = FieldName +}; + +inline const Deref (&EnumValuesDeref())[6] { + static const Deref values[] = { + Deref::NONE, + Deref::MapKey, + Deref::StructField, + Deref::ArraySubscript, + Deref::ArraySlice, + Deref::FieldName + }; + return values; +} + +inline const char * const *EnumNamesDeref() { + static const char * const names[7] = { + "NONE", + "MapKey", + "StructField", + "ArraySubscript", + "ArraySlice", + "FieldName", + nullptr + }; + return names; +} + +inline const char *EnumNameDeref(Deref e) { + if (flatbuffers::IsOutRange(e, Deref::NONE, Deref::FieldName)) return ""; + const size_t index = static_cast(e); + return EnumNamesDeref()[index]; +} + +template struct DerefTraits { + static const Deref enum_value = Deref::NONE; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::MapKey; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::StructField; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::ArraySubscript; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::ArraySlice; +}; + +template<> struct DerefTraits { + static const Deref enum_value = Deref::FieldName; +}; + +bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type); +bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// A canonical (probably SQL equivalent) function +enum class CanonicalFunctionId : uint32_t { + And = 0, + Not = 1, + Or = 2, + Add = 3, + Subtract = 4, + Multiply = 5, + Divide = 6, + Power = 7, + AbsoluteValue = 8, + Negate = 9, + Sign = 10, + DateSub = 11, + DateAdd = 12, + DateDiff = 13, + TimeAdd = 14, + TimeSub = 15, + TimeDiff = 16, + TimestampAdd = 17, + TimestampSub = 18, + TimestampDiff = 19, + Equals = 20, + NotEquals = 21, + Greater = 22, + GreaterEqual = 23, + Less = 24, + LessEqual = 25, + MIN = And, + MAX = LessEqual +}; + +inline const CanonicalFunctionId (&EnumValuesCanonicalFunctionId())[26] { + static const CanonicalFunctionId values[] = { + CanonicalFunctionId::And, + CanonicalFunctionId::Not, + CanonicalFunctionId::Or, + CanonicalFunctionId::Add, + CanonicalFunctionId::Subtract, + CanonicalFunctionId::Multiply, + CanonicalFunctionId::Divide, + CanonicalFunctionId::Power, + CanonicalFunctionId::AbsoluteValue, + CanonicalFunctionId::Negate, + CanonicalFunctionId::Sign, + CanonicalFunctionId::DateSub, + CanonicalFunctionId::DateAdd, + CanonicalFunctionId::DateDiff, + CanonicalFunctionId::TimeAdd, + CanonicalFunctionId::TimeSub, + CanonicalFunctionId::TimeDiff, + CanonicalFunctionId::TimestampAdd, + CanonicalFunctionId::TimestampSub, + CanonicalFunctionId::TimestampDiff, + CanonicalFunctionId::Equals, + CanonicalFunctionId::NotEquals, + CanonicalFunctionId::Greater, + CanonicalFunctionId::GreaterEqual, + CanonicalFunctionId::Less, + CanonicalFunctionId::LessEqual + }; + return values; +} + +inline const char * const *EnumNamesCanonicalFunctionId() { + static const char * const names[27] = { + "And", + "Not", + "Or", + "Add", + "Subtract", + "Multiply", + "Divide", + "Power", + "AbsoluteValue", + "Negate", + "Sign", + "DateSub", + "DateAdd", + "DateDiff", + "TimeAdd", + "TimeSub", + "TimeDiff", + "TimestampAdd", + "TimestampSub", + "TimestampDiff", + "Equals", + "NotEquals", + "Greater", + "GreaterEqual", + "Less", + "LessEqual", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalFunctionId(CanonicalFunctionId e) { + if (flatbuffers::IsOutRange(e, CanonicalFunctionId::And, CanonicalFunctionId::LessEqual)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalFunctionId()[index]; +} + +enum class FunctionImpl : uint8_t { + NONE = 0, + CanonicalFunction = 1, + NonCanonicalFunction = 2, + MIN = NONE, + MAX = NonCanonicalFunction +}; + +inline const FunctionImpl (&EnumValuesFunctionImpl())[3] { + static const FunctionImpl values[] = { + FunctionImpl::NONE, + FunctionImpl::CanonicalFunction, + FunctionImpl::NonCanonicalFunction + }; + return values; +} + +inline const char * const *EnumNamesFunctionImpl() { + static const char * const names[4] = { + "NONE", + "CanonicalFunction", + "NonCanonicalFunction", + nullptr + }; + return names; +} + +inline const char *EnumNameFunctionImpl(FunctionImpl e) { + if (flatbuffers::IsOutRange(e, FunctionImpl::NONE, FunctionImpl::NonCanonicalFunction)) return ""; + const size_t index = static_cast(e); + return EnumNamesFunctionImpl()[index]; +} + +template struct FunctionImplTraits { + static const FunctionImpl enum_value = FunctionImpl::NONE; +}; + +template<> struct FunctionImplTraits { + static const FunctionImpl enum_value = FunctionImpl::CanonicalFunction; +}; + +template<> struct FunctionImplTraits { + static const FunctionImpl enum_value = FunctionImpl::NonCanonicalFunction; +}; + +bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type); +bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// Whether lesser values should precede greater or vice versa, +/// also whether nulls should preced or follow values. +enum class Ordering : uint8_t { + ASCENDING_THEN_NULLS = 0, + DESCENDING_THEN_NULLS = 1, + NULLS_THEN_ASCENDING = 2, + NULLS_THEN_DESCENDING = 3, + MIN = ASCENDING_THEN_NULLS, + MAX = NULLS_THEN_DESCENDING +}; + +inline const Ordering (&EnumValuesOrdering())[4] { + static const Ordering values[] = { + Ordering::ASCENDING_THEN_NULLS, + Ordering::DESCENDING_THEN_NULLS, + Ordering::NULLS_THEN_ASCENDING, + Ordering::NULLS_THEN_DESCENDING + }; + return values; +} + +inline const char * const *EnumNamesOrdering() { + static const char * const names[5] = { + "ASCENDING_THEN_NULLS", + "DESCENDING_THEN_NULLS", + "NULLS_THEN_ASCENDING", + "NULLS_THEN_DESCENDING", + nullptr + }; + return names; +} + +inline const char *EnumNameOrdering(Ordering e) { + if (flatbuffers::IsOutRange(e, Ordering::ASCENDING_THEN_NULLS, Ordering::NULLS_THEN_DESCENDING)) return ""; + const size_t index = static_cast(e); + return EnumNamesOrdering()[index]; +} + +enum class ConcreteBoundImpl : uint8_t { + NONE = 0, + Expression = 1, + Unbounded = 2, + MIN = NONE, + MAX = Unbounded +}; + +inline const ConcreteBoundImpl (&EnumValuesConcreteBoundImpl())[3] { + static const ConcreteBoundImpl values[] = { + ConcreteBoundImpl::NONE, + ConcreteBoundImpl::Expression, + ConcreteBoundImpl::Unbounded + }; + return values; +} + +inline const char * const *EnumNamesConcreteBoundImpl() { + static const char * const names[4] = { + "NONE", + "Expression", + "Unbounded", + nullptr + }; + return names; +} + +inline const char *EnumNameConcreteBoundImpl(ConcreteBoundImpl e) { + if (flatbuffers::IsOutRange(e, ConcreteBoundImpl::NONE, ConcreteBoundImpl::Unbounded)) return ""; + const size_t index = static_cast(e); + return EnumNamesConcreteBoundImpl()[index]; +} + +template struct ConcreteBoundImplTraits { + static const ConcreteBoundImpl enum_value = ConcreteBoundImpl::NONE; +}; + +template<> struct ConcreteBoundImplTraits { + static const ConcreteBoundImpl enum_value = ConcreteBoundImpl::Expression; +}; + +template<> struct ConcreteBoundImplTraits { + static const ConcreteBoundImpl enum_value = ConcreteBoundImpl::Unbounded; +}; + +bool VerifyConcreteBoundImpl(flatbuffers::Verifier &verifier, const void *obj, ConcreteBoundImpl type); +bool VerifyConcreteBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class BoundImpl : uint8_t { + NONE = 0, + Preceding = 1, + Following = 2, + CurrentRow = 3, + MIN = NONE, + MAX = CurrentRow +}; + +inline const BoundImpl (&EnumValuesBoundImpl())[4] { + static const BoundImpl values[] = { + BoundImpl::NONE, + BoundImpl::Preceding, + BoundImpl::Following, + BoundImpl::CurrentRow + }; + return values; +} + +inline const char * const *EnumNamesBoundImpl() { + static const char * const names[5] = { + "NONE", + "Preceding", + "Following", + "CurrentRow", + nullptr + }; + return names; +} + +inline const char *EnumNameBoundImpl(BoundImpl e) { + if (flatbuffers::IsOutRange(e, BoundImpl::NONE, BoundImpl::CurrentRow)) return ""; + const size_t index = static_cast(e); + return EnumNamesBoundImpl()[index]; +} + +template struct BoundImplTraits { + static const BoundImpl enum_value = BoundImpl::NONE; +}; + +template<> struct BoundImplTraits { + static const BoundImpl enum_value = BoundImpl::Preceding; +}; + +template<> struct BoundImplTraits { + static const BoundImpl enum_value = BoundImpl::Following; +}; + +template<> struct BoundImplTraits { + static const BoundImpl enum_value = BoundImpl::CurrentRow; +}; + +bool VerifyBoundImpl(flatbuffers::Verifier &verifier, const void *obj, BoundImpl type); +bool VerifyBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// The kind of window function to be executed. +enum class Frame : uint8_t { + Rows = 0, + Range = 1, + MIN = Rows, + MAX = Range +}; + +inline const Frame (&EnumValuesFrame())[2] { + static const Frame values[] = { + Frame::Rows, + Frame::Range + }; + return values; +} + +inline const char * const *EnumNamesFrame() { + static const char * const names[3] = { + "Rows", + "Range", + nullptr + }; + return names; +} + +inline const char *EnumNameFrame(Frame e) { + if (flatbuffers::IsOutRange(e, Frame::Rows, Frame::Range)) return ""; + const size_t index = static_cast(e); + return EnumNamesFrame()[index]; +} + +/// A canonical (probably SQL equivalent) function +enum class CanonicalAggregateId : uint32_t { + All = 0, + Any = 1, + Count = 2, + CountTable = 3, + Mean = 4, + Min = 5, + Max = 6, + Product = 7, + Sum = 8, + Variance = 9, + StandardDev = 10, + MIN = All, + MAX = StandardDev +}; + +inline const CanonicalAggregateId (&EnumValuesCanonicalAggregateId())[11] { + static const CanonicalAggregateId values[] = { + CanonicalAggregateId::All, + CanonicalAggregateId::Any, + CanonicalAggregateId::Count, + CanonicalAggregateId::CountTable, + CanonicalAggregateId::Mean, + CanonicalAggregateId::Min, + CanonicalAggregateId::Max, + CanonicalAggregateId::Product, + CanonicalAggregateId::Sum, + CanonicalAggregateId::Variance, + CanonicalAggregateId::StandardDev + }; + return values; +} + +inline const char * const *EnumNamesCanonicalAggregateId() { + static const char * const names[12] = { + "All", + "Any", + "Count", + "CountTable", + "Mean", + "Min", + "Max", + "Product", + "Sum", + "Variance", + "StandardDev", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalAggregateId(CanonicalAggregateId e) { + if (flatbuffers::IsOutRange(e, CanonicalAggregateId::All, CanonicalAggregateId::StandardDev)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalAggregateId()[index]; +} + +enum class AggregateImpl : uint8_t { + NONE = 0, + CanonicalAggregate = 1, + NonCanonicalAggregate = 2, + MIN = NONE, + MAX = NonCanonicalAggregate +}; + +inline const AggregateImpl (&EnumValuesAggregateImpl())[3] { + static const AggregateImpl values[] = { + AggregateImpl::NONE, + AggregateImpl::CanonicalAggregate, + AggregateImpl::NonCanonicalAggregate + }; + return values; +} + +inline const char * const *EnumNamesAggregateImpl() { + static const char * const names[4] = { + "NONE", + "CanonicalAggregate", + "NonCanonicalAggregate", + nullptr + }; + return names; +} + +inline const char *EnumNameAggregateImpl(AggregateImpl e) { + if (flatbuffers::IsOutRange(e, AggregateImpl::NONE, AggregateImpl::NonCanonicalAggregate)) return ""; + const size_t index = static_cast(e); + return EnumNamesAggregateImpl()[index]; +} + +template struct AggregateImplTraits { + static const AggregateImpl enum_value = AggregateImpl::NONE; +}; + +template<> struct AggregateImplTraits { + static const AggregateImpl enum_value = AggregateImpl::CanonicalAggregate; +}; + +template<> struct AggregateImplTraits { + static const AggregateImpl enum_value = AggregateImpl::NonCanonicalAggregate; +}; + +bool VerifyAggregateImpl(flatbuffers::Verifier &verifier, const void *obj, AggregateImpl type); +bool VerifyAggregateImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// An expression is one of +/// - a Literal datum +/// - a reference to a field from a Relation +/// - a call to a named function +/// - a case expression +/// - a cast expression +/// - an extract operation +/// - a window function call +/// - an aggregate function call +/// +/// The expressions here that look like function calls such as +/// Cast,Case and Extract are special in that while they might +/// fit into a Call, they don't cleanly do so without having +/// to pass around non-expression arguments as metadata. +/// +/// AggregateCall and WindowCall are also separate variants +/// due to special options for each that don't apply to generic +/// function calls. Again this is done to make it easier +/// for consumers to deal with the structure of the operation +enum class ExpressionImpl : uint8_t { + NONE = 0, + Literal = 1, + FieldRef = 2, + Call = 3, + Case = 4, + Cast = 5, + Extract = 6, + WindowCall = 7, + AggregateCall = 8, + MIN = NONE, + MAX = AggregateCall +}; + +inline const ExpressionImpl (&EnumValuesExpressionImpl())[9] { + static const ExpressionImpl values[] = { + ExpressionImpl::NONE, + ExpressionImpl::Literal, + ExpressionImpl::FieldRef, + ExpressionImpl::Call, + ExpressionImpl::Case, + ExpressionImpl::Cast, + ExpressionImpl::Extract, + ExpressionImpl::WindowCall, + ExpressionImpl::AggregateCall + }; + return values; +} + +inline const char * const *EnumNamesExpressionImpl() { + static const char * const names[10] = { + "NONE", + "Literal", + "FieldRef", + "Call", + "Case", + "Cast", + "Extract", + "WindowCall", + "AggregateCall", + nullptr + }; + return names; +} + +inline const char *EnumNameExpressionImpl(ExpressionImpl e) { + if (flatbuffers::IsOutRange(e, ExpressionImpl::NONE, ExpressionImpl::AggregateCall)) return ""; + const size_t index = static_cast(e); + return EnumNamesExpressionImpl()[index]; +} + +template struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::NONE; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::Literal; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::FieldRef; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::Call; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::Case; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::Cast; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::Extract; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::WindowCall; +}; + +template<> struct ExpressionImplTraits { + static const ExpressionImpl enum_value = ExpressionImpl::AggregateCall; +}; + +bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type); +bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// Access a value for a given map key +struct MapKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef MapKeyBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_KEY = 4 + }; + const flatbuffers::String *key() const { + return GetPointer(VT_KEY); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_KEY) && + verifier.VerifyString(key()) && + verifier.EndTable(); + } +}; + +struct MapKeyBuilder { + typedef MapKey Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_key(flatbuffers::Offset key) { + fbb_.AddOffset(MapKey::VT_KEY, key); + } + explicit MapKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + MapKeyBuilder &operator=(const MapKeyBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, MapKey::VT_KEY); + return o; + } +}; + +inline flatbuffers::Offset CreateMapKey( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset key = 0) { + MapKeyBuilder builder_(_fbb); + builder_.add_key(key); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateMapKeyDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *key = nullptr) { + auto key__ = key ? _fbb.CreateString(key) : 0; + return org::apache::arrow::computeir::flatbuf::CreateMapKey( + _fbb, + key__); +} + +/// Struct field access +struct StructField FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef StructFieldBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_POSITION = 4 + }; + /// The position of the field in the struct schema + uint32_t position() const { + return GetField(VT_POSITION, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_POSITION) && + verifier.EndTable(); + } +}; + +struct StructFieldBuilder { + typedef StructField Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_position(uint32_t position) { + fbb_.AddElement(StructField::VT_POSITION, position, 0); + } + explicit StructFieldBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + StructFieldBuilder &operator=(const StructFieldBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateStructField( + flatbuffers::FlatBufferBuilder &_fbb, + uint32_t position = 0) { + StructFieldBuilder builder_(_fbb); + builder_.add_position(position); + return builder_.Finish(); +} + +/// Zero-based array index +struct ArraySubscript FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ArraySubscriptBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_POSITION = 4 + }; + uint32_t position() const { + return GetField(VT_POSITION, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_POSITION) && + verifier.EndTable(); + } +}; + +struct ArraySubscriptBuilder { + typedef ArraySubscript Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_position(uint32_t position) { + fbb_.AddElement(ArraySubscript::VT_POSITION, position, 0); + } + explicit ArraySubscriptBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ArraySubscriptBuilder &operator=(const ArraySubscriptBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateArraySubscript( + flatbuffers::FlatBufferBuilder &_fbb, + uint32_t position = 0) { + ArraySubscriptBuilder builder_(_fbb); + builder_.add_position(position); + return builder_.Finish(); +} + +/// Zero-based range of elements in an array +struct ArraySlice FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ArraySliceBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_START_INCLUSIVE = 4, + VT_END_EXCLUSIVE = 6 + }; + /// The start of an array slice, inclusive + uint32_t start_inclusive() const { + return GetField(VT_START_INCLUSIVE, 0); + } + /// The end of an array slice, exclusive + uint32_t end_exclusive() const { + return GetField(VT_END_EXCLUSIVE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_START_INCLUSIVE) && + VerifyField(verifier, VT_END_EXCLUSIVE) && + verifier.EndTable(); + } +}; + +struct ArraySliceBuilder { + typedef ArraySlice Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_start_inclusive(uint32_t start_inclusive) { + fbb_.AddElement(ArraySlice::VT_START_INCLUSIVE, start_inclusive, 0); + } + void add_end_exclusive(uint32_t end_exclusive) { + fbb_.AddElement(ArraySlice::VT_END_EXCLUSIVE, end_exclusive, 0); + } + explicit ArraySliceBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ArraySliceBuilder &operator=(const ArraySliceBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateArraySlice( + flatbuffers::FlatBufferBuilder &_fbb, + uint32_t start_inclusive = 0, + uint32_t end_exclusive = 0) { + ArraySliceBuilder builder_(_fbb); + builder_.add_end_exclusive(end_exclusive); + builder_.add_start_inclusive(start_inclusive); + return builder_.Finish(); +} + +/// Field name in a relation +struct FieldName FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FieldNameBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_POSITION = 4 + }; + uint32_t position() const { + return GetField(VT_POSITION, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_POSITION) && + verifier.EndTable(); + } +}; + +struct FieldNameBuilder { + typedef FieldName Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_position(uint32_t position) { + fbb_.AddElement(FieldName::VT_POSITION, position, 0); + } + explicit FieldNameBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FieldNameBuilder &operator=(const FieldNameBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateFieldName( + flatbuffers::FlatBufferBuilder &_fbb, + uint32_t position = 0) { + FieldNameBuilder builder_(_fbb); + builder_.add_position(position); + return builder_.Finish(); +} + +/// Access the data of a field +struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FieldRefBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_REF_TYPE = 4, + VT_REF = 6, + VT_RELATION_INDEX = 8 + }; + org::apache::arrow::computeir::flatbuf::Deref ref_type() const { + return static_cast(GetField(VT_REF_TYPE, 0)); + } + /// A sequence of field names to allow referencing potentially nested fields + const void *ref() const { + return GetPointer(VT_REF); + } + template const T *ref_as() const; + const org::apache::arrow::computeir::flatbuf::MapKey *ref_as_MapKey() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::MapKey ? static_cast(ref()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::StructField *ref_as_StructField() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::StructField ? static_cast(ref()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::ArraySubscript *ref_as_ArraySubscript() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySubscript ? static_cast(ref()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::ArraySlice *ref_as_ArraySlice() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySlice ? static_cast(ref()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::FieldName *ref_as_FieldName() const { + return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::FieldName ? static_cast(ref()) : nullptr; + } + /// For Expressions which might reference fields in multiple Relations, + /// this index may be provided to indicate which Relation's fields + /// `path` points into. For example in the case of a join, + /// 0 refers to the left relation and 1 to the right relation. + int32_t relation_index() const { + return GetField(VT_RELATION_INDEX, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_REF_TYPE) && + VerifyOffsetRequired(verifier, VT_REF) && + VerifyDeref(verifier, ref(), ref_type()) && + VerifyField(verifier, VT_RELATION_INDEX) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::MapKey *FieldRef::ref_as() const { + return ref_as_MapKey(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::StructField *FieldRef::ref_as() const { + return ref_as_StructField(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::ArraySubscript *FieldRef::ref_as() const { + return ref_as_ArraySubscript(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::ArraySlice *FieldRef::ref_as() const { + return ref_as_ArraySlice(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::FieldName *FieldRef::ref_as() const { + return ref_as_FieldName(); +} + +struct FieldRefBuilder { + typedef FieldRef Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_ref_type(org::apache::arrow::computeir::flatbuf::Deref ref_type) { + fbb_.AddElement(FieldRef::VT_REF_TYPE, static_cast(ref_type), 0); + } + void add_ref(flatbuffers::Offset ref) { + fbb_.AddOffset(FieldRef::VT_REF, ref); + } + void add_relation_index(int32_t relation_index) { + fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); + } + explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FieldRefBuilder &operator=(const FieldRefBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, FieldRef::VT_REF); + return o; + } +}; + +inline flatbuffers::Offset CreateFieldRef( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::Deref ref_type = org::apache::arrow::computeir::flatbuf::Deref::NONE, + flatbuffers::Offset ref = 0, + int32_t relation_index = 0) { + FieldRefBuilder builder_(_fbb); + builder_.add_relation_index(relation_index); + builder_.add_ref(ref); + builder_.add_ref_type(ref_type); + return builder_.Finish(); +} + +struct CanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalFunctionBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id() const { + return static_cast(GetField(VT_ID, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && + verifier.EndTable(); + } +}; + +struct CanonicalFunctionBuilder { + typedef CanonicalFunction Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_id(org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id) { + fbb_.AddElement(CanonicalFunction::VT_ID, static_cast(id), 0); + } + explicit CanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CanonicalFunctionBuilder &operator=(const CanonicalFunctionBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCanonicalFunction( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id = org::apache::arrow::computeir::flatbuf::CanonicalFunctionId::And) { + CanonicalFunctionBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalFunctionBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalFunctionBuilder { + typedef NonCanonicalFunction Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalFunction::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalFunction::VT_NAME, name); + } + explicit NonCanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalFunctionBuilder &operator=(const NonCanonicalFunctionBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalFunction::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalFunction( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalFunctionBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateNonCanonicalFunctionDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalFunction( + _fbb, + name_space__, + name__); +} + +/// A function call expression +struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CallBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_KIND_TYPE = 4, + VT_KIND = 6, + VT_ARGUMENTS = 8, + VT_METADATA = 10 + }; + org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type() const { + return static_cast(GetField(VT_KIND_TYPE, 0)); + } + /// The kind of function call this is. + const void *kind() const { + return GetPointer(VT_KIND); + } + template const T *kind_as() const; + const org::apache::arrow::computeir::flatbuf::CanonicalFunction *kind_as_CanonicalFunction() const { + return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::CanonicalFunction ? static_cast(kind()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *kind_as_NonCanonicalFunction() const { + return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::NonCanonicalFunction ? static_cast(kind()) : nullptr; + } + /// The arguments passed to `function_name`. + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); + } + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { + return GetPointer(VT_METADATA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_KIND_TYPE) && + VerifyOffsetRequired(verifier, VT_KIND) && + VerifyFunctionImpl(verifier, kind(), kind_type()) && + VerifyOffsetRequired(verifier, VT_ARGUMENTS) && + verifier.VerifyVector(arguments()) && + verifier.VerifyVectorOfTables(arguments()) && + VerifyOffset(verifier, VT_METADATA) && + verifier.VerifyTable(metadata()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalFunction *Call::kind_as() const { + return kind_as_CanonicalFunction(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *Call::kind_as() const { + return kind_as_NonCanonicalFunction(); +} + +struct CallBuilder { + typedef Call Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_kind_type(org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type) { + fbb_.AddElement(Call::VT_KIND_TYPE, static_cast(kind_type), 0); + } + void add_kind(flatbuffers::Offset kind) { + fbb_.AddOffset(Call::VT_KIND, kind); + } + void add_arguments(flatbuffers::Offset>> arguments) { + fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); + } + void add_metadata(flatbuffers::Offset metadata) { + fbb_.AddOffset(Call::VT_METADATA, metadata); + } + explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CallBuilder &operator=(const CallBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Call::VT_KIND); + fbb_.Required(o, Call::VT_ARGUMENTS); + return o; + } +}; + +inline flatbuffers::Offset CreateCall( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, + flatbuffers::Offset kind = 0, + flatbuffers::Offset>> arguments = 0, + flatbuffers::Offset metadata = 0) { + CallBuilder builder_(_fbb); + builder_.add_metadata(metadata); + builder_.add_arguments(arguments); + builder_.add_kind(kind); + builder_.add_kind_type(kind_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateCallDirect( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, + flatbuffers::Offset kind = 0, + const std::vector> *arguments = nullptr, + flatbuffers::Offset metadata = 0) { + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + return org::apache::arrow::computeir::flatbuf::CreateCall( + _fbb, + kind_type, + kind, + arguments__, + metadata); +} + +/// A single WHEN x THEN y fragment. +struct CaseFragment FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CaseFragmentBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_WHEN = 4, + VT_THEN = 6 + }; + const org::apache::arrow::computeir::flatbuf::Expression *when() const { + return GetPointer(VT_WHEN); + } + const org::apache::arrow::computeir::flatbuf::Expression *then() const { + return GetPointer(VT_THEN); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_WHEN) && + verifier.VerifyTable(when()) && + VerifyOffsetRequired(verifier, VT_THEN) && + verifier.VerifyTable(then()) && + verifier.EndTable(); + } +}; + +struct CaseFragmentBuilder { + typedef CaseFragment Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_when(flatbuffers::Offset when) { + fbb_.AddOffset(CaseFragment::VT_WHEN, when); + } + void add_then(flatbuffers::Offset then) { + fbb_.AddOffset(CaseFragment::VT_THEN, then); + } + explicit CaseFragmentBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CaseFragmentBuilder &operator=(const CaseFragmentBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, CaseFragment::VT_WHEN); + fbb_.Required(o, CaseFragment::VT_THEN); + return o; + } +}; + +inline flatbuffers::Offset CreateCaseFragment( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset when = 0, + flatbuffers::Offset then = 0) { + CaseFragmentBuilder builder_(_fbb); + builder_.add_then(then); + builder_.add_when(when); + return builder_.Finish(); +} + +/// Case statement-style expression. +struct Case FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CaseBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_CASES = 4, + VT_DEFAULT_ = 6, + VT_METADATA = 8 + }; + const flatbuffers::Vector> *cases() const { + return GetPointer> *>(VT_CASES); + } + /// The default value if no cases match. This is typically NULL in SQL + /// + /// Defaulting to NULL is a frontend choice, so producers must specify NULL + /// if that's their desired behavior. + const org::apache::arrow::computeir::flatbuf::Expression *default_() const { + return GetPointer(VT_DEFAULT_); + } + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { + return GetPointer(VT_METADATA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_CASES) && + verifier.VerifyVector(cases()) && + verifier.VerifyVectorOfTables(cases()) && + VerifyOffsetRequired(verifier, VT_DEFAULT_) && + verifier.VerifyTable(default_()) && + VerifyOffset(verifier, VT_METADATA) && + verifier.VerifyTable(metadata()) && + verifier.EndTable(); + } +}; + +struct CaseBuilder { + typedef Case Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_cases(flatbuffers::Offset>> cases) { + fbb_.AddOffset(Case::VT_CASES, cases); + } + void add_default_(flatbuffers::Offset default_) { + fbb_.AddOffset(Case::VT_DEFAULT_, default_); + } + void add_metadata(flatbuffers::Offset metadata) { + fbb_.AddOffset(Case::VT_METADATA, metadata); + } + explicit CaseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CaseBuilder &operator=(const CaseBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Case::VT_CASES); + fbb_.Required(o, Case::VT_DEFAULT_); + return o; + } +}; + +inline flatbuffers::Offset CreateCase( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> cases = 0, + flatbuffers::Offset default_ = 0, + flatbuffers::Offset metadata = 0) { + CaseBuilder builder_(_fbb); + builder_.add_metadata(metadata); + builder_.add_default_(default_); + builder_.add_cases(cases); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateCaseDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *cases = nullptr, + flatbuffers::Offset default_ = 0, + flatbuffers::Offset metadata = 0) { + auto cases__ = cases ? _fbb.CreateVector>(*cases) : 0; + return org::apache::arrow::computeir::flatbuf::CreateCase( + _fbb, + cases__, + default_, + metadata); +} + +struct Cast FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CastBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_EXPRESSION = 4, + VT_TYPE = 6, + VT_METADATA = 8 + }; + /// The expression to cast + const org::apache::arrow::computeir::flatbuf::Expression *expression() const { + return GetPointer(VT_EXPRESSION); + } + /// The type to cast `argument` to. + const org::apache::arrow::flatbuf::Field *type() const { + return GetPointer(VT_TYPE); + } + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { + return GetPointer(VT_METADATA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_EXPRESSION) && + verifier.VerifyTable(expression()) && + VerifyOffsetRequired(verifier, VT_TYPE) && + verifier.VerifyTable(type()) && + VerifyOffset(verifier, VT_METADATA) && + verifier.VerifyTable(metadata()) && + verifier.EndTable(); + } +}; + +struct CastBuilder { + typedef Cast Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_expression(flatbuffers::Offset expression) { + fbb_.AddOffset(Cast::VT_EXPRESSION, expression); + } + void add_type(flatbuffers::Offset type) { + fbb_.AddOffset(Cast::VT_TYPE, type); + } + void add_metadata(flatbuffers::Offset metadata) { + fbb_.AddOffset(Cast::VT_METADATA, metadata); + } + explicit CastBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CastBuilder &operator=(const CastBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Cast::VT_EXPRESSION); + fbb_.Required(o, Cast::VT_TYPE); + return o; + } +}; + +inline flatbuffers::Offset CreateCast( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset expression = 0, + flatbuffers::Offset type = 0, + flatbuffers::Offset metadata = 0) { + CastBuilder builder_(_fbb); + builder_.add_metadata(metadata); + builder_.add_type(type); + builder_.add_expression(expression); + return builder_.Finish(); +} + +struct Extract FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ExtractBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_EXPRESSION = 4, + VT_FIELD = 6, + VT_METADATA = 8 + }; + /// Expression from which to extract components. + const org::apache::arrow::computeir::flatbuf::Expression *expression() const { + return GetPointer(VT_EXPRESSION); + } + /// Field to extract from `expression`. + const flatbuffers::String *field() const { + return GetPointer(VT_FIELD); + } + /// Parameters for `function_name`; content/format may be unique to each + /// value of `function_name`. + const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { + return GetPointer(VT_METADATA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_EXPRESSION) && + verifier.VerifyTable(expression()) && + VerifyOffsetRequired(verifier, VT_FIELD) && + verifier.VerifyString(field()) && + VerifyOffset(verifier, VT_METADATA) && + verifier.VerifyTable(metadata()) && + verifier.EndTable(); + } +}; + +struct ExtractBuilder { + typedef Extract Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_expression(flatbuffers::Offset expression) { + fbb_.AddOffset(Extract::VT_EXPRESSION, expression); + } + void add_field(flatbuffers::Offset field) { + fbb_.AddOffset(Extract::VT_FIELD, field); + } + void add_metadata(flatbuffers::Offset metadata) { + fbb_.AddOffset(Extract::VT_METADATA, metadata); + } + explicit ExtractBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ExtractBuilder &operator=(const ExtractBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Extract::VT_EXPRESSION); + fbb_.Required(o, Extract::VT_FIELD); + return o; + } +}; + +inline flatbuffers::Offset CreateExtract( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset expression = 0, + flatbuffers::Offset field = 0, + flatbuffers::Offset metadata = 0) { + ExtractBuilder builder_(_fbb); + builder_.add_metadata(metadata); + builder_.add_field(field); + builder_.add_expression(expression); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateExtractDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset expression = 0, + const char *field = nullptr, + flatbuffers::Offset metadata = 0) { + auto field__ = field ? _fbb.CreateString(field) : 0; + return org::apache::arrow::computeir::flatbuf::CreateExtract( + _fbb, + expression, + field__, + metadata); +} + +/// An expression with an order +struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef SortKeyBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_EXPRESSION = 4, + VT_ORDERING = 6 + }; + const org::apache::arrow::computeir::flatbuf::Expression *expression() const { + return GetPointer(VT_EXPRESSION); + } + org::apache::arrow::computeir::flatbuf::Ordering ordering() const { + return static_cast(GetField(VT_ORDERING, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_EXPRESSION) && + verifier.VerifyTable(expression()) && + VerifyField(verifier, VT_ORDERING) && + verifier.EndTable(); + } +}; + +struct SortKeyBuilder { + typedef SortKey Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_expression(flatbuffers::Offset expression) { + fbb_.AddOffset(SortKey::VT_EXPRESSION, expression); + } + void add_ordering(org::apache::arrow::computeir::flatbuf::Ordering ordering) { + fbb_.AddElement(SortKey::VT_ORDERING, static_cast(ordering), 0); + } + explicit SortKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + SortKeyBuilder &operator=(const SortKeyBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, SortKey::VT_EXPRESSION); + return o; + } +}; + +inline flatbuffers::Offset CreateSortKey( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset expression = 0, + org::apache::arrow::computeir::flatbuf::Ordering ordering = org::apache::arrow::computeir::flatbuf::Ordering::ASCENDING_THEN_NULLS) { + SortKeyBuilder builder_(_fbb); + builder_.add_expression(expression); + builder_.add_ordering(ordering); + return builder_.Finish(); +} + +/// Boundary is unbounded +struct Unbounded FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UnboundedBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct UnboundedBuilder { + typedef Unbounded Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit UnboundedBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UnboundedBuilder &operator=(const UnboundedBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateUnbounded( + flatbuffers::FlatBufferBuilder &_fbb) { + UnboundedBuilder builder_(_fbb); + return builder_.Finish(); +} + +/// Boundary is preceding rows, determined by the contained expression +struct Preceding FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef PrecedingBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IPML_TYPE = 4, + VT_IPML = 6 + }; + org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl ipml_type() const { + return static_cast(GetField(VT_IPML_TYPE, 0)); + } + const void *ipml() const { + return GetPointer(VT_IPML); + } + template const T *ipml_as() const; + const org::apache::arrow::computeir::flatbuf::Expression *ipml_as_Expression() const { + return ipml_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Expression ? static_cast(ipml()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Unbounded *ipml_as_Unbounded() const { + return ipml_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Unbounded ? static_cast(ipml()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IPML_TYPE) && + VerifyOffsetRequired(verifier, VT_IPML) && + VerifyConcreteBoundImpl(verifier, ipml(), ipml_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Expression *Preceding::ipml_as() const { + return ipml_as_Expression(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Unbounded *Preceding::ipml_as() const { + return ipml_as_Unbounded(); +} + +struct PrecedingBuilder { + typedef Preceding Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_ipml_type(org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl ipml_type) { + fbb_.AddElement(Preceding::VT_IPML_TYPE, static_cast(ipml_type), 0); + } + void add_ipml(flatbuffers::Offset ipml) { + fbb_.AddOffset(Preceding::VT_IPML, ipml); + } + explicit PrecedingBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + PrecedingBuilder &operator=(const PrecedingBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Preceding::VT_IPML); + return o; + } +}; + +inline flatbuffers::Offset CreatePreceding( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl ipml_type = org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::NONE, + flatbuffers::Offset ipml = 0) { + PrecedingBuilder builder_(_fbb); + builder_.add_ipml(ipml); + builder_.add_ipml_type(ipml_type); + return builder_.Finish(); +} + +/// Boundary is following rows, determined by the contained expression +struct Following FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FollowingBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IMPL_TYPE = 4, + VT_IMPL = 6 + }; + org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::computeir::flatbuf::Expression *impl_as_Expression() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Expression ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Unbounded *impl_as_Unbounded() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Unbounded ? static_cast(impl()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyConcreteBoundImpl(verifier, impl(), impl_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Expression *Following::impl_as() const { + return impl_as_Expression(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Unbounded *Following::impl_as() const { + return impl_as_Unbounded(); +} + +struct FollowingBuilder { + typedef Following Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_impl_type(org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl impl_type) { + fbb_.AddElement(Following::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(Following::VT_IMPL, impl); + } + explicit FollowingBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FollowingBuilder &operator=(const FollowingBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Following::VT_IMPL); + return o; + } +}; + +inline flatbuffers::Offset CreateFollowing( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl impl_type = org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::NONE, + flatbuffers::Offset impl = 0) { + FollowingBuilder builder_(_fbb); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); + return builder_.Finish(); +} + +/// Boundary is the current row +struct CurrentRow FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CurrentRowBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct CurrentRowBuilder { + typedef CurrentRow Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit CurrentRowBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CurrentRowBuilder &operator=(const CurrentRowBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCurrentRow( + flatbuffers::FlatBufferBuilder &_fbb) { + CurrentRowBuilder builder_(_fbb); + return builder_.Finish(); +} + +/// Boundary of a window +struct Bound FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef BoundBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IMPL_TYPE = 4, + VT_IMPL = 6 + }; + org::apache::arrow::computeir::flatbuf::BoundImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::computeir::flatbuf::Preceding *impl_as_Preceding() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::BoundImpl::Preceding ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Following *impl_as_Following() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::BoundImpl::Following ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::CurrentRow *impl_as_CurrentRow() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::BoundImpl::CurrentRow ? static_cast(impl()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyBoundImpl(verifier, impl(), impl_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Preceding *Bound::impl_as() const { + return impl_as_Preceding(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Following *Bound::impl_as() const { + return impl_as_Following(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::CurrentRow *Bound::impl_as() const { + return impl_as_CurrentRow(); +} + +struct BoundBuilder { + typedef Bound Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_impl_type(org::apache::arrow::computeir::flatbuf::BoundImpl impl_type) { + fbb_.AddElement(Bound::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(Bound::VT_IMPL, impl); + } + explicit BoundBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + BoundBuilder &operator=(const BoundBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Bound::VT_IMPL); + return o; + } +}; + +inline flatbuffers::Offset CreateBound( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::BoundImpl impl_type = org::apache::arrow::computeir::flatbuf::BoundImpl::NONE, + flatbuffers::Offset impl = 0) { + BoundBuilder builder_(_fbb); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); + return builder_.Finish(); +} + +/// An expression representing a window function call. +struct WindowCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef WindowCallBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_KIND = 4, + VT_EXPRESSION = 6, + VT_PARTITIONS = 8, + VT_ORDERINGS = 10, + VT_LOWER_BOUND = 12, + VT_UPPER_BOUND = 14 + }; + /// The kind of window frame + org::apache::arrow::computeir::flatbuf::Frame kind() const { + return static_cast(GetField(VT_KIND, 0)); + } + /// The expression to operate over + const org::apache::arrow::computeir::flatbuf::Expression *expression() const { + return GetPointer(VT_EXPRESSION); + } + /// Partition keys + const flatbuffers::Vector> *partitions() const { + return GetPointer> *>(VT_PARTITIONS); + } + /// Sort keys + const flatbuffers::Vector> *orderings() const { + return GetPointer> *>(VT_ORDERINGS); + } + /// Lower window bound + const org::apache::arrow::computeir::flatbuf::Bound *lower_bound() const { + return GetPointer(VT_LOWER_BOUND); + } + /// Upper window bound + const org::apache::arrow::computeir::flatbuf::Bound *upper_bound() const { + return GetPointer(VT_UPPER_BOUND); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_KIND) && + VerifyOffsetRequired(verifier, VT_EXPRESSION) && + verifier.VerifyTable(expression()) && + VerifyOffsetRequired(verifier, VT_PARTITIONS) && + verifier.VerifyVector(partitions()) && + verifier.VerifyVectorOfTables(partitions()) && + VerifyOffsetRequired(verifier, VT_ORDERINGS) && + verifier.VerifyVector(orderings()) && + verifier.VerifyVectorOfTables(orderings()) && + VerifyOffsetRequired(verifier, VT_LOWER_BOUND) && + verifier.VerifyTable(lower_bound()) && + VerifyOffsetRequired(verifier, VT_UPPER_BOUND) && + verifier.VerifyTable(upper_bound()) && + verifier.EndTable(); + } +}; + +struct WindowCallBuilder { + typedef WindowCall Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_kind(org::apache::arrow::computeir::flatbuf::Frame kind) { + fbb_.AddElement(WindowCall::VT_KIND, static_cast(kind), 0); + } + void add_expression(flatbuffers::Offset expression) { + fbb_.AddOffset(WindowCall::VT_EXPRESSION, expression); + } + void add_partitions(flatbuffers::Offset>> partitions) { + fbb_.AddOffset(WindowCall::VT_PARTITIONS, partitions); + } + void add_orderings(flatbuffers::Offset>> orderings) { + fbb_.AddOffset(WindowCall::VT_ORDERINGS, orderings); + } + void add_lower_bound(flatbuffers::Offset lower_bound) { + fbb_.AddOffset(WindowCall::VT_LOWER_BOUND, lower_bound); + } + void add_upper_bound(flatbuffers::Offset upper_bound) { + fbb_.AddOffset(WindowCall::VT_UPPER_BOUND, upper_bound); + } + explicit WindowCallBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + WindowCallBuilder &operator=(const WindowCallBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, WindowCall::VT_EXPRESSION); + fbb_.Required(o, WindowCall::VT_PARTITIONS); + fbb_.Required(o, WindowCall::VT_ORDERINGS); + fbb_.Required(o, WindowCall::VT_LOWER_BOUND); + fbb_.Required(o, WindowCall::VT_UPPER_BOUND); + return o; + } +}; + +inline flatbuffers::Offset CreateWindowCall( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::Frame kind = org::apache::arrow::computeir::flatbuf::Frame::Rows, + flatbuffers::Offset expression = 0, + flatbuffers::Offset>> partitions = 0, + flatbuffers::Offset>> orderings = 0, + flatbuffers::Offset lower_bound = 0, + flatbuffers::Offset upper_bound = 0) { + WindowCallBuilder builder_(_fbb); + builder_.add_upper_bound(upper_bound); + builder_.add_lower_bound(lower_bound); + builder_.add_orderings(orderings); + builder_.add_partitions(partitions); + builder_.add_expression(expression); + builder_.add_kind(kind); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateWindowCallDirect( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::Frame kind = org::apache::arrow::computeir::flatbuf::Frame::Rows, + flatbuffers::Offset expression = 0, + const std::vector> *partitions = nullptr, + const std::vector> *orderings = nullptr, + flatbuffers::Offset lower_bound = 0, + flatbuffers::Offset upper_bound = 0) { + auto partitions__ = partitions ? _fbb.CreateVector>(*partitions) : 0; + auto orderings__ = orderings ? _fbb.CreateVector>(*orderings) : 0; + return org::apache::arrow::computeir::flatbuf::CreateWindowCall( + _fbb, + kind, + expression, + partitions__, + orderings__, + lower_bound, + upper_bound); +} + +struct CanonicalAggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalAggregateBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::computeir::flatbuf::CanonicalAggregateId id() const { + return static_cast(GetField(VT_ID, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && + verifier.EndTable(); + } +}; + +struct CanonicalAggregateBuilder { + typedef CanonicalAggregate Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_id(org::apache::arrow::computeir::flatbuf::CanonicalAggregateId id) { + fbb_.AddElement(CanonicalAggregate::VT_ID, static_cast(id), 0); + } + explicit CanonicalAggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CanonicalAggregateBuilder &operator=(const CanonicalAggregateBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCanonicalAggregate( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::CanonicalAggregateId id = org::apache::arrow::computeir::flatbuf::CanonicalAggregateId::All) { + CanonicalAggregateBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalAggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalAggregateBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalAggregateBuilder { + typedef NonCanonicalAggregate Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalAggregate::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalAggregate::VT_NAME, name); + } + explicit NonCanonicalAggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalAggregateBuilder &operator=(const NonCanonicalAggregateBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalAggregate::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalAggregate( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalAggregateBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateNonCanonicalAggregateDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalAggregate( + _fbb, + name_space__, + name__); +} + +struct AggregateCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef AggregateCallBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_KIND_TYPE = 4, + VT_KIND = 6, + VT_ARGUMENTS = 8, + VT_ORDERINGS = 10, + VT_PREDICATE = 12 + }; + org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type() const { + return static_cast(GetField(VT_KIND_TYPE, 0)); + } + /// The kind of aggregate function being executed + const void *kind() const { + return GetPointer(VT_KIND); + } + template const T *kind_as() const; + const org::apache::arrow::computeir::flatbuf::CanonicalAggregate *kind_as_CanonicalAggregate() const { + return kind_type() == org::apache::arrow::computeir::flatbuf::AggregateImpl::CanonicalAggregate ? static_cast(kind()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::NonCanonicalAggregate *kind_as_NonCanonicalAggregate() const { + return kind_type() == org::apache::arrow::computeir::flatbuf::AggregateImpl::NonCanonicalAggregate ? static_cast(kind()) : nullptr; + } + /// Aggregate expression arguments + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); + } + /// Possible ordering. + const flatbuffers::Vector> *orderings() const { + return GetPointer> *>(VT_ORDERINGS); + } + /// optional per-aggregate filtering + const org::apache::arrow::computeir::flatbuf::Expression *predicate() const { + return GetPointer(VT_PREDICATE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_KIND_TYPE) && + VerifyOffsetRequired(verifier, VT_KIND) && + VerifyAggregateImpl(verifier, kind(), kind_type()) && + VerifyOffsetRequired(verifier, VT_ARGUMENTS) && + verifier.VerifyVector(arguments()) && + verifier.VerifyVectorOfTables(arguments()) && + VerifyOffset(verifier, VT_ORDERINGS) && + verifier.VerifyVector(orderings()) && + verifier.VerifyVectorOfTables(orderings()) && + VerifyOffset(verifier, VT_PREDICATE) && + verifier.VerifyTable(predicate()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalAggregate *AggregateCall::kind_as() const { + return kind_as_CanonicalAggregate(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalAggregate *AggregateCall::kind_as() const { + return kind_as_NonCanonicalAggregate(); +} + +struct AggregateCallBuilder { + typedef AggregateCall Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_kind_type(org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type) { + fbb_.AddElement(AggregateCall::VT_KIND_TYPE, static_cast(kind_type), 0); + } + void add_kind(flatbuffers::Offset kind) { + fbb_.AddOffset(AggregateCall::VT_KIND, kind); + } + void add_arguments(flatbuffers::Offset>> arguments) { + fbb_.AddOffset(AggregateCall::VT_ARGUMENTS, arguments); + } + void add_orderings(flatbuffers::Offset>> orderings) { + fbb_.AddOffset(AggregateCall::VT_ORDERINGS, orderings); + } + void add_predicate(flatbuffers::Offset predicate) { + fbb_.AddOffset(AggregateCall::VT_PREDICATE, predicate); + } + explicit AggregateCallBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + AggregateCallBuilder &operator=(const AggregateCallBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, AggregateCall::VT_KIND); + fbb_.Required(o, AggregateCall::VT_ARGUMENTS); + return o; + } +}; + +inline flatbuffers::Offset CreateAggregateCall( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type = org::apache::arrow::computeir::flatbuf::AggregateImpl::NONE, + flatbuffers::Offset kind = 0, + flatbuffers::Offset>> arguments = 0, + flatbuffers::Offset>> orderings = 0, + flatbuffers::Offset predicate = 0) { + AggregateCallBuilder builder_(_fbb); + builder_.add_predicate(predicate); + builder_.add_orderings(orderings); + builder_.add_arguments(arguments); + builder_.add_kind(kind); + builder_.add_kind_type(kind_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateAggregateCallDirect( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type = org::apache::arrow::computeir::flatbuf::AggregateImpl::NONE, + flatbuffers::Offset kind = 0, + const std::vector> *arguments = nullptr, + const std::vector> *orderings = nullptr, + flatbuffers::Offset predicate = 0) { + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + auto orderings__ = orderings ? _fbb.CreateVector>(*orderings) : 0; + return org::apache::arrow::computeir::flatbuf::CreateAggregateCall( + _fbb, + kind_type, + kind, + arguments__, + orderings__, + predicate); +} + +/// Expression types +/// +/// Expressions have a concrete `impl` value, which is a specific operation +/// They also have a `type` field, which is the output type of the expression, +/// regardless of operation type. +/// +/// The only exception so far is Cast, which has a type as input argument, which +/// is equal to output type. +struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ExpressionBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IMPL_TYPE = 4, + VT_IMPL = 6, + VT_TYPE = 8 + }; + org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::computeir::flatbuf::Literal *impl_as_Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::FieldRef *impl_as_FieldRef() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::FieldRef ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Call *impl_as_Call() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Call ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Case *impl_as_Case() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Case ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Cast *impl_as_Cast() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Cast ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Extract *impl_as_Extract() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Extract ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::WindowCall *impl_as_WindowCall() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::WindowCall ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::AggregateCall *impl_as_AggregateCall() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::AggregateCall ? static_cast(impl()) : nullptr; + } + /// The type of the expression. + /// + /// This is a field, because the Type union in Schema.fbs + /// isn't self-contained: Fields are necessary to describe complex types + /// and there's currently no reason to optimize the storage of this. + const org::apache::arrow::flatbuf::Field *type() const { + return GetPointer(VT_TYPE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyExpressionImpl(verifier, impl(), impl_type()) && + VerifyOffset(verifier, VT_TYPE) && + verifier.VerifyTable(type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Literal *Expression::impl_as() const { + return impl_as_Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::FieldRef *Expression::impl_as() const { + return impl_as_FieldRef(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Call *Expression::impl_as() const { + return impl_as_Call(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Case *Expression::impl_as() const { + return impl_as_Case(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Cast *Expression::impl_as() const { + return impl_as_Cast(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Extract *Expression::impl_as() const { + return impl_as_Extract(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::WindowCall *Expression::impl_as() const { + return impl_as_WindowCall(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::AggregateCall *Expression::impl_as() const { + return impl_as_AggregateCall(); +} + +struct ExpressionBuilder { + typedef Expression Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_impl_type(org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type) { + fbb_.AddElement(Expression::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(Expression::VT_IMPL, impl); + } + void add_type(flatbuffers::Offset type) { + fbb_.AddOffset(Expression::VT_TYPE, type); + } + explicit ExpressionBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ExpressionBuilder &operator=(const ExpressionBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Expression::VT_IMPL); + return o; + } +}; + +inline flatbuffers::Offset CreateExpression( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type = org::apache::arrow::computeir::flatbuf::ExpressionImpl::NONE, + flatbuffers::Offset impl = 0, + flatbuffers::Offset type = 0) { + ExpressionBuilder builder_(_fbb); + builder_.add_type(type); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); + return builder_.Finish(); +} + +inline bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type) { + switch (type) { + case Deref::NONE: { + return true; + } + case Deref::MapKey: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::StructField: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::ArraySubscript: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::ArraySlice: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Deref::FieldName: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyDeref( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type) { + switch (type) { + case FunctionImpl::NONE: { + return true; + } + case FunctionImpl::CanonicalFunction: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case FunctionImpl::NonCanonicalFunction: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyFunctionImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyConcreteBoundImpl(flatbuffers::Verifier &verifier, const void *obj, ConcreteBoundImpl type) { + switch (type) { + case ConcreteBoundImpl::NONE: { + return true; + } + case ConcreteBoundImpl::Expression: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ConcreteBoundImpl::Unbounded: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyConcreteBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyConcreteBoundImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyBoundImpl(flatbuffers::Verifier &verifier, const void *obj, BoundImpl type) { + switch (type) { + case BoundImpl::NONE: { + return true; + } + case BoundImpl::Preceding: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case BoundImpl::Following: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case BoundImpl::CurrentRow: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyBoundImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyAggregateImpl(flatbuffers::Verifier &verifier, const void *obj, AggregateImpl type) { + switch (type) { + case AggregateImpl::NONE: { + return true; + } + case AggregateImpl::CanonicalAggregate: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case AggregateImpl::NonCanonicalAggregate: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyAggregateImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyAggregateImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type) { + switch (type) { + case ExpressionImpl::NONE: { + return true; + } + case ExpressionImpl::Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ExpressionImpl::FieldRef: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ExpressionImpl::Call: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ExpressionImpl::Case: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ExpressionImpl::Cast: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ExpressionImpl::Extract: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ExpressionImpl::WindowCall: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case ExpressionImpl::AggregateCall: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyExpressionImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const org::apache::arrow::computeir::flatbuf::Expression *GetExpression(const void *buf) { + return flatbuffers::GetRoot(buf); +} + +inline const org::apache::arrow::computeir::flatbuf::Expression *GetSizePrefixedExpression(const void *buf) { + return flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyExpressionBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedExpressionBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishExpressionBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedExpressionBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace flatbuf +} // namespace computeir +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_EXPRESSION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/InlineBuffer_generated.h b/cpp/src/generated/InlineBuffer_generated.h new file mode 100644 index 0000000000000..ad7da86aad674 --- /dev/null +++ b/cpp/src/generated/InlineBuffer_generated.h @@ -0,0 +1,957 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_INLINEBUFFER_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ +#define FLATBUFFERS_GENERATED_INLINEBUFFER_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ + +#include "flatbuffers/flatbuffers.h" + +namespace org { +namespace apache { +namespace arrow { +namespace computeir { +namespace flatbuf { + +struct Int8Buffer; +struct Int8BufferBuilder; + +struct Int16Buffer; +struct Int16BufferBuilder; + +struct Int32Buffer; +struct Int32BufferBuilder; + +struct Int64Buffer; +struct Int64BufferBuilder; + +struct UInt8Buffer; +struct UInt8BufferBuilder; + +struct UInt16Buffer; +struct UInt16BufferBuilder; + +struct UInt32Buffer; +struct UInt32BufferBuilder; + +struct UInt64Buffer; +struct UInt64BufferBuilder; + +struct Float32Buffer; +struct Float32BufferBuilder; + +struct Float64Buffer; +struct Float64BufferBuilder; + +struct TableBuffer; +struct TableBufferBuilder; + +struct InlineBuffer; +struct InlineBufferBuilder; + +enum class InlineBufferImpl : uint8_t { + NONE = 0, + Int8Buffer = 1, + Int16Buffer = 2, + Int32Buffer = 3, + Int64Buffer = 4, + UInt8Buffer = 5, + UInt16Buffer = 6, + UInt32Buffer = 7, + UInt64Buffer = 8, + Float32Buffer = 9, + Float64Buffer = 10, + TableBuffer = 11, + MIN = NONE, + MAX = TableBuffer +}; + +inline const InlineBufferImpl (&EnumValuesInlineBufferImpl())[12] { + static const InlineBufferImpl values[] = { + InlineBufferImpl::NONE, + InlineBufferImpl::Int8Buffer, + InlineBufferImpl::Int16Buffer, + InlineBufferImpl::Int32Buffer, + InlineBufferImpl::Int64Buffer, + InlineBufferImpl::UInt8Buffer, + InlineBufferImpl::UInt16Buffer, + InlineBufferImpl::UInt32Buffer, + InlineBufferImpl::UInt64Buffer, + InlineBufferImpl::Float32Buffer, + InlineBufferImpl::Float64Buffer, + InlineBufferImpl::TableBuffer + }; + return values; +} + +inline const char * const *EnumNamesInlineBufferImpl() { + static const char * const names[13] = { + "NONE", + "Int8Buffer", + "Int16Buffer", + "Int32Buffer", + "Int64Buffer", + "UInt8Buffer", + "UInt16Buffer", + "UInt32Buffer", + "UInt64Buffer", + "Float32Buffer", + "Float64Buffer", + "TableBuffer", + nullptr + }; + return names; +} + +inline const char *EnumNameInlineBufferImpl(InlineBufferImpl e) { + if (flatbuffers::IsOutRange(e, InlineBufferImpl::NONE, InlineBufferImpl::TableBuffer)) return ""; + const size_t index = static_cast(e); + return EnumNamesInlineBufferImpl()[index]; +} + +template struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::NONE; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int8Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int16Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int32Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Int64Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt8Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt16Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt32Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::UInt64Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Float32Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::Float64Buffer; +}; + +template<> struct InlineBufferImplTraits { + static const InlineBufferImpl enum_value = InlineBufferImpl::TableBuffer; +}; + +bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type); +bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +struct Int8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int8BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int8BufferBuilder { + typedef Int8Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int8Buffer::VT_ITEMS, items); + } + explicit Int8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int8BufferBuilder &operator=(const Int8BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int8Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt8Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int8BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt8BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateInt8Buffer( + _fbb, + items__); +} + +struct Int16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int16BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int16BufferBuilder { + typedef Int16Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int16Buffer::VT_ITEMS, items); + } + explicit Int16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int16BufferBuilder &operator=(const Int16BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int16Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt16Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int16BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt16BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateInt16Buffer( + _fbb, + items__); +} + +struct Int32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int32BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int32BufferBuilder { + typedef Int32Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int32Buffer::VT_ITEMS, items); + } + explicit Int32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int32BufferBuilder &operator=(const Int32BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int32Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt32Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int32BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt32BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateInt32Buffer( + _fbb, + items__); +} + +struct Int64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int64BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Int64BufferBuilder { + typedef Int64Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Int64Buffer::VT_ITEMS, items); + } + explicit Int64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int64BufferBuilder &operator=(const Int64BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Int64Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateInt64Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Int64BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateInt64BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateInt64Buffer( + _fbb, + items__); +} + +struct UInt8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt8BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt8BufferBuilder { + typedef UInt8Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt8Buffer::VT_ITEMS, items); + } + explicit UInt8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt8BufferBuilder &operator=(const UInt8BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt8Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt8Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt8BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt8BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateUInt8Buffer( + _fbb, + items__); +} + +struct UInt16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt16BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt16BufferBuilder { + typedef UInt16Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt16Buffer::VT_ITEMS, items); + } + explicit UInt16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt16BufferBuilder &operator=(const UInt16BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt16Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt16Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt16BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt16BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateUInt16Buffer( + _fbb, + items__); +} + +struct UInt32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt32BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt32BufferBuilder { + typedef UInt32Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt32Buffer::VT_ITEMS, items); + } + explicit UInt32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt32BufferBuilder &operator=(const UInt32BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt32Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt32Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt32BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt32BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateUInt32Buffer( + _fbb, + items__); +} + +struct UInt64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt64BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct UInt64BufferBuilder { + typedef UInt64Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(UInt64Buffer::VT_ITEMS, items); + } + explicit UInt64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt64BufferBuilder &operator=(const UInt64BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, UInt64Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt64Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + UInt64BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateUInt64BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateUInt64Buffer( + _fbb, + items__); +} + +struct Float32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Float32BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Float32BufferBuilder { + typedef Float32Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Float32Buffer::VT_ITEMS, items); + } + explicit Float32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Float32BufferBuilder &operator=(const Float32BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Float32Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateFloat32Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Float32BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateFloat32BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateFloat32Buffer( + _fbb, + items__); +} + +struct Float64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Float64BufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct Float64BufferBuilder { + typedef Float64Buffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(Float64Buffer::VT_ITEMS, items); + } + explicit Float64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Float64BufferBuilder &operator=(const Float64BufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Float64Buffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateFloat64Buffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + Float64BufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateFloat64BufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateFloat64Buffer( + _fbb, + items__); +} + +struct TableBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef TableBufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ITEMS = 4 + }; + const flatbuffers::Vector *items() const { + return GetPointer *>(VT_ITEMS); + } + const org::apache::arrow::computeir::flatbuf::InlineBuffer *items_nested_root() const { + return flatbuffers::GetRoot(items()->Data()); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ITEMS) && + verifier.VerifyVector(items()) && + verifier.EndTable(); + } +}; + +struct TableBufferBuilder { + typedef TableBuffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_items(flatbuffers::Offset> items) { + fbb_.AddOffset(TableBuffer::VT_ITEMS, items); + } + explicit TableBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + TableBufferBuilder &operator=(const TableBufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, TableBuffer::VT_ITEMS); + return o; + } +}; + +inline flatbuffers::Offset CreateTableBuffer( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> items = 0) { + TableBufferBuilder builder_(_fbb); + builder_.add_items(items); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateTableBufferDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *items = nullptr) { + auto items__ = items ? _fbb.CreateVector(*items) : 0; + return org::apache::arrow::computeir::flatbuf::CreateTableBuffer( + _fbb, + items__); +} + +/// An inline replacement for org.apache.arrow.Buffer because that +/// requires a sidecar block of bytes into which offsets can point. +/// A union of buffers of each primitive type is provided to avoid +/// the need for reinterpret_cast, std::mem::transmute, ... +/// The final member of the union is a bytes buffer aligned suitably +/// to hold any flatbuffer Table. +struct InlineBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef InlineBufferBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IMPL_TYPE = 4, + VT_IMPL = 6 + }; + org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::computeir::flatbuf::Int8Buffer *impl_as_Int8Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int8Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Int16Buffer *impl_as_Int16Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int16Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Int32Buffer *impl_as_Int32Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int32Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Int64Buffer *impl_as_Int64Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int64Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt8Buffer *impl_as_UInt8Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt8Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt16Buffer *impl_as_UInt16Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt16Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt32Buffer *impl_as_UInt32Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt32Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt64Buffer *impl_as_UInt64Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt64Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Float32Buffer *impl_as_Float32Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float32Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Float64Buffer *impl_as_Float64Buffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float64Buffer ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::TableBuffer *impl_as_TableBuffer() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::TableBuffer ? static_cast(impl()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyInlineBufferImpl(verifier, impl(), impl_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Int8Buffer *InlineBuffer::impl_as() const { + return impl_as_Int8Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Int16Buffer *InlineBuffer::impl_as() const { + return impl_as_Int16Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Int32Buffer *InlineBuffer::impl_as() const { + return impl_as_Int32Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Int64Buffer *InlineBuffer::impl_as() const { + return impl_as_Int64Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt8Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt8Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt16Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt16Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt32Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt32Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt64Buffer *InlineBuffer::impl_as() const { + return impl_as_UInt64Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Float32Buffer *InlineBuffer::impl_as() const { + return impl_as_Float32Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Float64Buffer *InlineBuffer::impl_as() const { + return impl_as_Float64Buffer(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::TableBuffer *InlineBuffer::impl_as() const { + return impl_as_TableBuffer(); +} + +struct InlineBufferBuilder { + typedef InlineBuffer Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_impl_type(org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type) { + fbb_.AddElement(InlineBuffer::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(InlineBuffer::VT_IMPL, impl); + } + explicit InlineBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + InlineBufferBuilder &operator=(const InlineBufferBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, InlineBuffer::VT_IMPL); + return o; + } +}; + +inline flatbuffers::Offset CreateInlineBuffer( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type = org::apache::arrow::computeir::flatbuf::InlineBufferImpl::NONE, + flatbuffers::Offset impl = 0) { + InlineBufferBuilder builder_(_fbb); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); + return builder_.Finish(); +} + +inline bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type) { + switch (type) { + case InlineBufferImpl::NONE: { + return true; + } + case InlineBufferImpl::Int8Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Int16Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Int32Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Int64Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt8Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt16Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt32Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::UInt64Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Float32Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::Float64Buffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case InlineBufferImpl::TableBuffer: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyInlineBufferImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +} // namespace flatbuf +} // namespace computeir +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_INLINEBUFFER_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/Literal_generated.h b/cpp/src/generated/Literal_generated.h new file mode 100644 index 0000000000000..f5627f6361256 --- /dev/null +++ b/cpp/src/generated/Literal_generated.h @@ -0,0 +1,1981 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_LITERAL_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ +#define FLATBUFFERS_GENERATED_LITERAL_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ + +#include "flatbuffers/flatbuffers.h" + +namespace org { +namespace apache { +namespace arrow { +namespace computeir { +namespace flatbuf { + +struct ArrayLiteral; +struct ArrayLiteralBuilder; + +struct StructLiteral; +struct StructLiteralBuilder; + +struct KeyValue; +struct KeyValueBuilder; + +struct MapLiteral; +struct MapLiteralBuilder; + +struct Int8Literal; +struct Int8LiteralBuilder; + +struct Int16Literal; +struct Int16LiteralBuilder; + +struct Int32Literal; +struct Int32LiteralBuilder; + +struct Int64Literal; +struct Int64LiteralBuilder; + +struct UInt8Literal; +struct UInt8LiteralBuilder; + +struct UInt16Literal; +struct UInt16LiteralBuilder; + +struct UInt32Literal; +struct UInt32LiteralBuilder; + +struct UInt64Literal; +struct UInt64LiteralBuilder; + +struct Float16Literal; +struct Float16LiteralBuilder; + +struct Float32Literal; +struct Float32LiteralBuilder; + +struct Float64Literal; +struct Float64LiteralBuilder; + +struct DecimalLiteral; +struct DecimalLiteralBuilder; + +struct BooleanLiteral; +struct BooleanLiteralBuilder; + +struct NullLiteral; +struct NullLiteralBuilder; + +struct DateLiteral; +struct DateLiteralBuilder; + +struct TimeLiteral; +struct TimeLiteralBuilder; + +struct TimestampLiteral; +struct TimestampLiteralBuilder; + +struct IntervalLiteralMonths; +struct IntervalLiteralMonthsBuilder; + +struct IntervalLiteralDaysMilliseconds; +struct IntervalLiteralDaysMillisecondsBuilder; + +struct IntervalLiteral; +struct IntervalLiteralBuilder; + +struct BinaryLiteral; +struct BinaryLiteralBuilder; + +struct StringLiteral; +struct StringLiteralBuilder; + +struct Literal; +struct LiteralBuilder; + +enum class IntervalLiteralImpl : uint8_t { + NONE = 0, + IntervalLiteralMonths = 1, + IntervalLiteralDaysMilliseconds = 2, + MIN = NONE, + MAX = IntervalLiteralDaysMilliseconds +}; + +inline const IntervalLiteralImpl (&EnumValuesIntervalLiteralImpl())[3] { + static const IntervalLiteralImpl values[] = { + IntervalLiteralImpl::NONE, + IntervalLiteralImpl::IntervalLiteralMonths, + IntervalLiteralImpl::IntervalLiteralDaysMilliseconds + }; + return values; +} + +inline const char * const *EnumNamesIntervalLiteralImpl() { + static const char * const names[4] = { + "NONE", + "IntervalLiteralMonths", + "IntervalLiteralDaysMilliseconds", + nullptr + }; + return names; +} + +inline const char *EnumNameIntervalLiteralImpl(IntervalLiteralImpl e) { + if (flatbuffers::IsOutRange(e, IntervalLiteralImpl::NONE, IntervalLiteralImpl::IntervalLiteralDaysMilliseconds)) return ""; + const size_t index = static_cast(e); + return EnumNamesIntervalLiteralImpl()[index]; +} + +template struct IntervalLiteralImplTraits { + static const IntervalLiteralImpl enum_value = IntervalLiteralImpl::NONE; +}; + +template<> struct IntervalLiteralImplTraits { + static const IntervalLiteralImpl enum_value = IntervalLiteralImpl::IntervalLiteralMonths; +}; + +template<> struct IntervalLiteralImplTraits { + static const IntervalLiteralImpl enum_value = IntervalLiteralImpl::IntervalLiteralDaysMilliseconds; +}; + +bool VerifyIntervalLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, IntervalLiteralImpl type); +bool VerifyIntervalLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class LiteralImpl : uint8_t { + NONE = 0, + NullLiteral = 1, + BooleanLiteral = 2, + Int8Literal = 3, + Int16Literal = 4, + Int32Literal = 5, + Int64Literal = 6, + UInt8Literal = 7, + UInt16Literal = 8, + UInt32Literal = 9, + UInt64Literal = 10, + DateLiteral = 11, + TimeLiteral = 12, + TimestampLiteral = 13, + IntervalLiteral = 14, + DecimalLiteral = 15, + Float16Literal = 16, + Float32Literal = 17, + Float64Literal = 18, + ArrayLiteral = 19, + StructLiteral = 20, + MapLiteral = 21, + StringLiteral = 22, + BinaryLiteral = 23, + MIN = NONE, + MAX = BinaryLiteral +}; + +inline const LiteralImpl (&EnumValuesLiteralImpl())[24] { + static const LiteralImpl values[] = { + LiteralImpl::NONE, + LiteralImpl::NullLiteral, + LiteralImpl::BooleanLiteral, + LiteralImpl::Int8Literal, + LiteralImpl::Int16Literal, + LiteralImpl::Int32Literal, + LiteralImpl::Int64Literal, + LiteralImpl::UInt8Literal, + LiteralImpl::UInt16Literal, + LiteralImpl::UInt32Literal, + LiteralImpl::UInt64Literal, + LiteralImpl::DateLiteral, + LiteralImpl::TimeLiteral, + LiteralImpl::TimestampLiteral, + LiteralImpl::IntervalLiteral, + LiteralImpl::DecimalLiteral, + LiteralImpl::Float16Literal, + LiteralImpl::Float32Literal, + LiteralImpl::Float64Literal, + LiteralImpl::ArrayLiteral, + LiteralImpl::StructLiteral, + LiteralImpl::MapLiteral, + LiteralImpl::StringLiteral, + LiteralImpl::BinaryLiteral + }; + return values; +} + +inline const char * const *EnumNamesLiteralImpl() { + static const char * const names[25] = { + "NONE", + "NullLiteral", + "BooleanLiteral", + "Int8Literal", + "Int16Literal", + "Int32Literal", + "Int64Literal", + "UInt8Literal", + "UInt16Literal", + "UInt32Literal", + "UInt64Literal", + "DateLiteral", + "TimeLiteral", + "TimestampLiteral", + "IntervalLiteral", + "DecimalLiteral", + "Float16Literal", + "Float32Literal", + "Float64Literal", + "ArrayLiteral", + "StructLiteral", + "MapLiteral", + "StringLiteral", + "BinaryLiteral", + nullptr + }; + return names; +} + +inline const char *EnumNameLiteralImpl(LiteralImpl e) { + if (flatbuffers::IsOutRange(e, LiteralImpl::NONE, LiteralImpl::BinaryLiteral)) return ""; + const size_t index = static_cast(e); + return EnumNamesLiteralImpl()[index]; +} + +template struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::NONE; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::NullLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::BooleanLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::Int8Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::Int16Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::Int32Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::Int64Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::UInt8Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::UInt16Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::UInt32Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::UInt64Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::DateLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::TimeLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::TimestampLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::IntervalLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::DecimalLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::Float16Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::Float32Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::Float64Literal; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::ArrayLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::StructLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::MapLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::StringLiteral; +}; + +template<> struct LiteralImplTraits { + static const LiteralImpl enum_value = LiteralImpl::BinaryLiteral; +}; + +bool VerifyLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, LiteralImpl type); +bool VerifyLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +struct ArrayLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ArrayLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUES = 4 + }; + const flatbuffers::Vector> *values() const { + return GetPointer> *>(VT_VALUES); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_VALUES) && + verifier.VerifyVector(values()) && + verifier.VerifyVectorOfTables(values()) && + verifier.EndTable(); + } +}; + +struct ArrayLiteralBuilder { + typedef ArrayLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_values(flatbuffers::Offset>> values) { + fbb_.AddOffset(ArrayLiteral::VT_VALUES, values); + } + explicit ArrayLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ArrayLiteralBuilder &operator=(const ArrayLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateArrayLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> values = 0) { + ArrayLiteralBuilder builder_(_fbb); + builder_.add_values(values); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateArrayLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *values = nullptr) { + auto values__ = values ? _fbb.CreateVector>(*values) : 0; + return org::apache::arrow::computeir::flatbuf::CreateArrayLiteral( + _fbb, + values__); +} + +struct StructLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef StructLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUES = 4 + }; + const flatbuffers::Vector> *values() const { + return GetPointer> *>(VT_VALUES); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_VALUES) && + verifier.VerifyVector(values()) && + verifier.VerifyVectorOfTables(values()) && + verifier.EndTable(); + } +}; + +struct StructLiteralBuilder { + typedef StructLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_values(flatbuffers::Offset>> values) { + fbb_.AddOffset(StructLiteral::VT_VALUES, values); + } + explicit StructLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + StructLiteralBuilder &operator=(const StructLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateStructLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> values = 0) { + StructLiteralBuilder builder_(_fbb); + builder_.add_values(values); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateStructLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *values = nullptr) { + auto values__ = values ? _fbb.CreateVector>(*values) : 0; + return org::apache::arrow::computeir::flatbuf::CreateStructLiteral( + _fbb, + values__); +} + +struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef KeyValueBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_KEY = 4, + VT_VALUE = 6 + }; + const flatbuffers::String *key() const { + return GetPointer(VT_KEY); + } + const org::apache::arrow::computeir::flatbuf::Literal *value() const { + return GetPointer(VT_VALUE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_KEY) && + verifier.VerifyString(key()) && + VerifyOffset(verifier, VT_VALUE) && + verifier.VerifyTable(value()) && + verifier.EndTable(); + } +}; + +struct KeyValueBuilder { + typedef KeyValue Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_key(flatbuffers::Offset key) { + fbb_.AddOffset(KeyValue::VT_KEY, key); + } + void add_value(flatbuffers::Offset value) { + fbb_.AddOffset(KeyValue::VT_VALUE, value); + } + explicit KeyValueBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + KeyValueBuilder &operator=(const KeyValueBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateKeyValue( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset key = 0, + flatbuffers::Offset value = 0) { + KeyValueBuilder builder_(_fbb); + builder_.add_value(value); + builder_.add_key(key); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateKeyValueDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *key = nullptr, + flatbuffers::Offset value = 0) { + auto key__ = key ? _fbb.CreateString(key) : 0; + return org::apache::arrow::computeir::flatbuf::CreateKeyValue( + _fbb, + key__, + value); +} + +struct MapLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef MapLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUES = 4 + }; + const flatbuffers::Vector> *values() const { + return GetPointer> *>(VT_VALUES); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_VALUES) && + verifier.VerifyVector(values()) && + verifier.VerifyVectorOfTables(values()) && + verifier.EndTable(); + } +}; + +struct MapLiteralBuilder { + typedef MapLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_values(flatbuffers::Offset>> values) { + fbb_.AddOffset(MapLiteral::VT_VALUES, values); + } + explicit MapLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + MapLiteralBuilder &operator=(const MapLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateMapLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> values = 0) { + MapLiteralBuilder builder_(_fbb); + builder_.add_values(values); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateMapLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *values = nullptr) { + auto values__ = values ? _fbb.CreateVector>(*values) : 0; + return org::apache::arrow::computeir::flatbuf::CreateMapLiteral( + _fbb, + values__); +} + +struct Int8Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int8LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + int8_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct Int8LiteralBuilder { + typedef Int8Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(int8_t value) { + fbb_.AddElement(Int8Literal::VT_VALUE, value, 0); + } + explicit Int8LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int8LiteralBuilder &operator=(const Int8LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateInt8Literal( + flatbuffers::FlatBufferBuilder &_fbb, + int8_t value = 0) { + Int8LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct Int16Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int16LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + int16_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct Int16LiteralBuilder { + typedef Int16Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(int16_t value) { + fbb_.AddElement(Int16Literal::VT_VALUE, value, 0); + } + explicit Int16LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int16LiteralBuilder &operator=(const Int16LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateInt16Literal( + flatbuffers::FlatBufferBuilder &_fbb, + int16_t value = 0) { + Int16LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct Int32Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int32LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + int32_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct Int32LiteralBuilder { + typedef Int32Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(int32_t value) { + fbb_.AddElement(Int32Literal::VT_VALUE, value, 0); + } + explicit Int32LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int32LiteralBuilder &operator=(const Int32LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateInt32Literal( + flatbuffers::FlatBufferBuilder &_fbb, + int32_t value = 0) { + Int32LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct Int64Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Int64LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + int64_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct Int64LiteralBuilder { + typedef Int64Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(int64_t value) { + fbb_.AddElement(Int64Literal::VT_VALUE, value, 0); + } + explicit Int64LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Int64LiteralBuilder &operator=(const Int64LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateInt64Literal( + flatbuffers::FlatBufferBuilder &_fbb, + int64_t value = 0) { + Int64LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct UInt8Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt8LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + uint8_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct UInt8LiteralBuilder { + typedef UInt8Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(uint8_t value) { + fbb_.AddElement(UInt8Literal::VT_VALUE, value, 0); + } + explicit UInt8LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt8LiteralBuilder &operator=(const UInt8LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt8Literal( + flatbuffers::FlatBufferBuilder &_fbb, + uint8_t value = 0) { + UInt8LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct UInt16Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt16LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + uint16_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct UInt16LiteralBuilder { + typedef UInt16Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(uint16_t value) { + fbb_.AddElement(UInt16Literal::VT_VALUE, value, 0); + } + explicit UInt16LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt16LiteralBuilder &operator=(const UInt16LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt16Literal( + flatbuffers::FlatBufferBuilder &_fbb, + uint16_t value = 0) { + UInt16LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct UInt32Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt32LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + uint32_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct UInt32LiteralBuilder { + typedef UInt32Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(uint32_t value) { + fbb_.AddElement(UInt32Literal::VT_VALUE, value, 0); + } + explicit UInt32LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt32LiteralBuilder &operator=(const UInt32LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt32Literal( + flatbuffers::FlatBufferBuilder &_fbb, + uint32_t value = 0) { + UInt32LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct UInt64Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef UInt64LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + uint64_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct UInt64LiteralBuilder { + typedef UInt64Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(uint64_t value) { + fbb_.AddElement(UInt64Literal::VT_VALUE, value, 0); + } + explicit UInt64LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + UInt64LiteralBuilder &operator=(const UInt64LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateUInt64Literal( + flatbuffers::FlatBufferBuilder &_fbb, + uint64_t value = 0) { + UInt64LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct Float16Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Float16LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + uint16_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct Float16LiteralBuilder { + typedef Float16Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(uint16_t value) { + fbb_.AddElement(Float16Literal::VT_VALUE, value, 0); + } + explicit Float16LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Float16LiteralBuilder &operator=(const Float16LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateFloat16Literal( + flatbuffers::FlatBufferBuilder &_fbb, + uint16_t value = 0) { + Float16LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct Float32Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Float32LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + float value() const { + return GetField(VT_VALUE, 0.0f); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct Float32LiteralBuilder { + typedef Float32Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(float value) { + fbb_.AddElement(Float32Literal::VT_VALUE, value, 0.0f); + } + explicit Float32LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Float32LiteralBuilder &operator=(const Float32LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateFloat32Literal( + flatbuffers::FlatBufferBuilder &_fbb, + float value = 0.0f) { + Float32LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct Float64Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef Float64LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + double value() const { + return GetField(VT_VALUE, 0.0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct Float64LiteralBuilder { + typedef Float64Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(double value) { + fbb_.AddElement(Float64Literal::VT_VALUE, value, 0.0); + } + explicit Float64LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + Float64LiteralBuilder &operator=(const Float64LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateFloat64Literal( + flatbuffers::FlatBufferBuilder &_fbb, + double value = 0.0) { + Float64LiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct DecimalLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef DecimalLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4, + VT_SCALE = 6, + VT_PRECISION = 8 + }; + const flatbuffers::Vector *value() const { + return GetPointer *>(VT_VALUE); + } + uint8_t scale() const { + return GetField(VT_SCALE, 0); + } + uint8_t precision() const { + return GetField(VT_PRECISION, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_VALUE) && + verifier.VerifyVector(value()) && + VerifyField(verifier, VT_SCALE) && + VerifyField(verifier, VT_PRECISION) && + verifier.EndTable(); + } +}; + +struct DecimalLiteralBuilder { + typedef DecimalLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(flatbuffers::Offset> value) { + fbb_.AddOffset(DecimalLiteral::VT_VALUE, value); + } + void add_scale(uint8_t scale) { + fbb_.AddElement(DecimalLiteral::VT_SCALE, scale, 0); + } + void add_precision(uint8_t precision) { + fbb_.AddElement(DecimalLiteral::VT_PRECISION, precision, 0); + } + explicit DecimalLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + DecimalLiteralBuilder &operator=(const DecimalLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateDecimalLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> value = 0, + uint8_t scale = 0, + uint8_t precision = 0) { + DecimalLiteralBuilder builder_(_fbb); + builder_.add_value(value); + builder_.add_precision(precision); + builder_.add_scale(scale); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateDecimalLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *value = nullptr, + uint8_t scale = 0, + uint8_t precision = 0) { + auto value__ = value ? _fbb.CreateVector(*value) : 0; + return org::apache::arrow::computeir::flatbuf::CreateDecimalLiteral( + _fbb, + value__, + scale, + precision); +} + +struct BooleanLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef BooleanLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + bool value() const { + return GetField(VT_VALUE, 0) != 0; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct BooleanLiteralBuilder { + typedef BooleanLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(bool value) { + fbb_.AddElement(BooleanLiteral::VT_VALUE, static_cast(value), 0); + } + explicit BooleanLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + BooleanLiteralBuilder &operator=(const BooleanLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateBooleanLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + bool value = false) { + BooleanLiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct NullLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NullLiteralBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct NullLiteralBuilder { + typedef NullLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit NullLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NullLiteralBuilder &operator=(const NullLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateNullLiteral( + flatbuffers::FlatBufferBuilder &_fbb) { + NullLiteralBuilder builder_(_fbb); + return builder_.Finish(); +} + +struct DateLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef DateLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + int64_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct DateLiteralBuilder { + typedef DateLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(int64_t value) { + fbb_.AddElement(DateLiteral::VT_VALUE, value, 0); + } + explicit DateLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + DateLiteralBuilder &operator=(const DateLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateDateLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + int64_t value = 0) { + DateLiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct TimeLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef TimeLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + int64_t value() const { + return GetField(VT_VALUE, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + verifier.EndTable(); + } +}; + +struct TimeLiteralBuilder { + typedef TimeLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(int64_t value) { + fbb_.AddElement(TimeLiteral::VT_VALUE, value, 0); + } + explicit TimeLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + TimeLiteralBuilder &operator=(const TimeLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateTimeLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + int64_t value = 0) { + TimeLiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +struct TimestampLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef TimestampLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4, + VT_TIMEZONE = 6 + }; + int64_t value() const { + return GetField(VT_VALUE, 0); + } + const flatbuffers::String *timezone() const { + return GetPointer(VT_TIMEZONE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE) && + VerifyOffset(verifier, VT_TIMEZONE) && + verifier.VerifyString(timezone()) && + verifier.EndTable(); + } +}; + +struct TimestampLiteralBuilder { + typedef TimestampLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(int64_t value) { + fbb_.AddElement(TimestampLiteral::VT_VALUE, value, 0); + } + void add_timezone(flatbuffers::Offset timezone) { + fbb_.AddOffset(TimestampLiteral::VT_TIMEZONE, timezone); + } + explicit TimestampLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + TimestampLiteralBuilder &operator=(const TimestampLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateTimestampLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + int64_t value = 0, + flatbuffers::Offset timezone = 0) { + TimestampLiteralBuilder builder_(_fbb); + builder_.add_value(value); + builder_.add_timezone(timezone); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateTimestampLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + int64_t value = 0, + const char *timezone = nullptr) { + auto timezone__ = timezone ? _fbb.CreateString(timezone) : 0; + return org::apache::arrow::computeir::flatbuf::CreateTimestampLiteral( + _fbb, + value, + timezone__); +} + +struct IntervalLiteralMonths FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef IntervalLiteralMonthsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_MONTHS = 4 + }; + int32_t months() const { + return GetField(VT_MONTHS, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_MONTHS) && + verifier.EndTable(); + } +}; + +struct IntervalLiteralMonthsBuilder { + typedef IntervalLiteralMonths Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_months(int32_t months) { + fbb_.AddElement(IntervalLiteralMonths::VT_MONTHS, months, 0); + } + explicit IntervalLiteralMonthsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + IntervalLiteralMonthsBuilder &operator=(const IntervalLiteralMonthsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateIntervalLiteralMonths( + flatbuffers::FlatBufferBuilder &_fbb, + int32_t months = 0) { + IntervalLiteralMonthsBuilder builder_(_fbb); + builder_.add_months(months); + return builder_.Finish(); +} + +struct IntervalLiteralDaysMilliseconds FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef IntervalLiteralDaysMillisecondsBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_DAYS = 4, + VT_MILLISECONDS = 6 + }; + int32_t days() const { + return GetField(VT_DAYS, 0); + } + int32_t milliseconds() const { + return GetField(VT_MILLISECONDS, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_DAYS) && + VerifyField(verifier, VT_MILLISECONDS) && + verifier.EndTable(); + } +}; + +struct IntervalLiteralDaysMillisecondsBuilder { + typedef IntervalLiteralDaysMilliseconds Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_days(int32_t days) { + fbb_.AddElement(IntervalLiteralDaysMilliseconds::VT_DAYS, days, 0); + } + void add_milliseconds(int32_t milliseconds) { + fbb_.AddElement(IntervalLiteralDaysMilliseconds::VT_MILLISECONDS, milliseconds, 0); + } + explicit IntervalLiteralDaysMillisecondsBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + IntervalLiteralDaysMillisecondsBuilder &operator=(const IntervalLiteralDaysMillisecondsBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateIntervalLiteralDaysMilliseconds( + flatbuffers::FlatBufferBuilder &_fbb, + int32_t days = 0, + int32_t milliseconds = 0) { + IntervalLiteralDaysMillisecondsBuilder builder_(_fbb); + builder_.add_milliseconds(milliseconds); + builder_.add_days(days); + return builder_.Finish(); +} + +struct IntervalLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef IntervalLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE_TYPE = 4, + VT_VALUE = 6 + }; + org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl value_type() const { + return static_cast(GetField(VT_VALUE_TYPE, 0)); + } + const void *value() const { + return GetPointer(VT_VALUE); + } + template const T *value_as() const; + const org::apache::arrow::computeir::flatbuf::IntervalLiteralMonths *value_as_IntervalLiteralMonths() const { + return value_type() == org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl::IntervalLiteralMonths ? static_cast(value()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::IntervalLiteralDaysMilliseconds *value_as_IntervalLiteralDaysMilliseconds() const { + return value_type() == org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl::IntervalLiteralDaysMilliseconds ? static_cast(value()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_VALUE_TYPE) && + VerifyOffset(verifier, VT_VALUE) && + VerifyIntervalLiteralImpl(verifier, value(), value_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::IntervalLiteralMonths *IntervalLiteral::value_as() const { + return value_as_IntervalLiteralMonths(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::IntervalLiteralDaysMilliseconds *IntervalLiteral::value_as() const { + return value_as_IntervalLiteralDaysMilliseconds(); +} + +struct IntervalLiteralBuilder { + typedef IntervalLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value_type(org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl value_type) { + fbb_.AddElement(IntervalLiteral::VT_VALUE_TYPE, static_cast(value_type), 0); + } + void add_value(flatbuffers::Offset value) { + fbb_.AddOffset(IntervalLiteral::VT_VALUE, value); + } + explicit IntervalLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + IntervalLiteralBuilder &operator=(const IntervalLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateIntervalLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl value_type = org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl::NONE, + flatbuffers::Offset value = 0) { + IntervalLiteralBuilder builder_(_fbb); + builder_.add_value(value); + builder_.add_value_type(value_type); + return builder_.Finish(); +} + +struct BinaryLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef BinaryLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + const flatbuffers::Vector *value() const { + return GetPointer *>(VT_VALUE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_VALUE) && + verifier.VerifyVector(value()) && + verifier.EndTable(); + } +}; + +struct BinaryLiteralBuilder { + typedef BinaryLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(flatbuffers::Offset> value) { + fbb_.AddOffset(BinaryLiteral::VT_VALUE, value); + } + explicit BinaryLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + BinaryLiteralBuilder &operator=(const BinaryLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateBinaryLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> value = 0) { + BinaryLiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateBinaryLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *value = nullptr) { + auto value__ = value ? _fbb.CreateVector(*value) : 0; + return org::apache::arrow::computeir::flatbuf::CreateBinaryLiteral( + _fbb, + value__); +} + +struct StringLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef StringLiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_VALUE = 4 + }; + const flatbuffers::String *value() const { + return GetPointer(VT_VALUE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_VALUE) && + verifier.VerifyString(value()) && + verifier.EndTable(); + } +}; + +struct StringLiteralBuilder { + typedef StringLiteral Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_value(flatbuffers::Offset value) { + fbb_.AddOffset(StringLiteral::VT_VALUE, value); + } + explicit StringLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + StringLiteralBuilder &operator=(const StringLiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateStringLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset value = 0) { + StringLiteralBuilder builder_(_fbb); + builder_.add_value(value); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateStringLiteralDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *value = nullptr) { + auto value__ = value ? _fbb.CreateString(value) : 0; + return org::apache::arrow::computeir::flatbuf::CreateStringLiteral( + _fbb, + value__); +} + +struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LiteralBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IMPL_TYPE = 4, + VT_IMPL = 6 + }; + org::apache::arrow::computeir::flatbuf::LiteralImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::computeir::flatbuf::NullLiteral *impl_as_NullLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::NullLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::BooleanLiteral *impl_as_BooleanLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::BooleanLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Int8Literal *impl_as_Int8Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int8Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Int16Literal *impl_as_Int16Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int16Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Int32Literal *impl_as_Int32Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int32Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Int64Literal *impl_as_Int64Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int64Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt8Literal *impl_as_UInt8Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt8Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt16Literal *impl_as_UInt16Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt16Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt32Literal *impl_as_UInt32Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt32Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::UInt64Literal *impl_as_UInt64Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt64Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::DateLiteral *impl_as_DateLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::DateLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::TimeLiteral *impl_as_TimeLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::TimeLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::TimestampLiteral *impl_as_TimestampLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::TimestampLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::IntervalLiteral *impl_as_IntervalLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::IntervalLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::DecimalLiteral *impl_as_DecimalLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::DecimalLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Float16Literal *impl_as_Float16Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Float16Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Float32Literal *impl_as_Float32Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Float32Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Float64Literal *impl_as_Float64Literal() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Float64Literal ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::ArrayLiteral *impl_as_ArrayLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::ArrayLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::StructLiteral *impl_as_StructLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::StructLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::MapLiteral *impl_as_MapLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::MapLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::StringLiteral *impl_as_StringLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::StringLiteral ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::BinaryLiteral *impl_as_BinaryLiteral() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::BinaryLiteral ? static_cast(impl()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyLiteralImpl(verifier, impl(), impl_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::NullLiteral *Literal::impl_as() const { + return impl_as_NullLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::BooleanLiteral *Literal::impl_as() const { + return impl_as_BooleanLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Int8Literal *Literal::impl_as() const { + return impl_as_Int8Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Int16Literal *Literal::impl_as() const { + return impl_as_Int16Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Int32Literal *Literal::impl_as() const { + return impl_as_Int32Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Int64Literal *Literal::impl_as() const { + return impl_as_Int64Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt8Literal *Literal::impl_as() const { + return impl_as_UInt8Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt16Literal *Literal::impl_as() const { + return impl_as_UInt16Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt32Literal *Literal::impl_as() const { + return impl_as_UInt32Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::UInt64Literal *Literal::impl_as() const { + return impl_as_UInt64Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::DateLiteral *Literal::impl_as() const { + return impl_as_DateLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::TimeLiteral *Literal::impl_as() const { + return impl_as_TimeLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::TimestampLiteral *Literal::impl_as() const { + return impl_as_TimestampLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::IntervalLiteral *Literal::impl_as() const { + return impl_as_IntervalLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::DecimalLiteral *Literal::impl_as() const { + return impl_as_DecimalLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Float16Literal *Literal::impl_as() const { + return impl_as_Float16Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Float32Literal *Literal::impl_as() const { + return impl_as_Float32Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Float64Literal *Literal::impl_as() const { + return impl_as_Float64Literal(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::ArrayLiteral *Literal::impl_as() const { + return impl_as_ArrayLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::StructLiteral *Literal::impl_as() const { + return impl_as_StructLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::MapLiteral *Literal::impl_as() const { + return impl_as_MapLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::StringLiteral *Literal::impl_as() const { + return impl_as_StringLiteral(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::BinaryLiteral *Literal::impl_as() const { + return impl_as_BinaryLiteral(); +} + +struct LiteralBuilder { + typedef Literal Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_impl_type(org::apache::arrow::computeir::flatbuf::LiteralImpl impl_type) { + fbb_.AddElement(Literal::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(Literal::VT_IMPL, impl); + } + explicit LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + LiteralBuilder &operator=(const LiteralBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Literal::VT_IMPL); + return o; + } +}; + +inline flatbuffers::Offset CreateLiteral( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::LiteralImpl impl_type = org::apache::arrow::computeir::flatbuf::LiteralImpl::NONE, + flatbuffers::Offset impl = 0) { + LiteralBuilder builder_(_fbb); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); + return builder_.Finish(); +} + +inline bool VerifyIntervalLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, IntervalLiteralImpl type) { + switch (type) { + case IntervalLiteralImpl::NONE: { + return true; + } + case IntervalLiteralImpl::IntervalLiteralMonths: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case IntervalLiteralImpl::IntervalLiteralDaysMilliseconds: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyIntervalLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyIntervalLiteralImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, LiteralImpl type) { + switch (type) { + case LiteralImpl::NONE: { + return true; + } + case LiteralImpl::NullLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::BooleanLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::Int8Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::Int16Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::Int32Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::Int64Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::UInt8Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::UInt16Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::UInt32Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::UInt64Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::DateLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::TimeLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::TimestampLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::IntervalLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::DecimalLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::Float16Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::Float32Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::Float64Literal: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::ArrayLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::StructLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::MapLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::StringLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case LiteralImpl::BinaryLiteral: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyLiteralImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const org::apache::arrow::computeir::flatbuf::Literal *GetLiteral(const void *buf) { + return flatbuffers::GetRoot(buf); +} + +inline const org::apache::arrow::computeir::flatbuf::Literal *GetSizePrefixedLiteral(const void *buf) { + return flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyLiteralBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedLiteralBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishLiteralBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedLiteralBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace flatbuf +} // namespace computeir +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_LITERAL_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/Plan_generated.h b/cpp/src/generated/Plan_generated.h new file mode 100644 index 0000000000000..fddd4830c4220 --- /dev/null +++ b/cpp/src/generated/Plan_generated.h @@ -0,0 +1,132 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_PLAN_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ +#define FLATBUFFERS_GENERATED_PLAN_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ + +#include "flatbuffers/flatbuffers.h" + +#include "Schema_generated.h" +#include "Expression_generated.h" +#include "InlineBuffer_generated.h" +#include "Literal_generated.h" +#include "Relation_generated.h" + +namespace org { +namespace apache { +namespace arrow { +namespace computeir { +namespace flatbuf { + +struct Plan; +struct PlanBuilder; + +/// A specification of a query. +struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef PlanBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_SINKS = 4, + VT_DERIVED_FROM = 6 + }; + /// One or more output relations. + const flatbuffers::Vector> *sinks() const { + return GetPointer> *>(VT_SINKS); + } + /// If this Plan was derived from another (for example by running + /// an optimization pass), that plan may be included here to + /// provide a backtrace of derivations. + const org::apache::arrow::computeir::flatbuf::Plan *derived_from() const { + return GetPointer(VT_DERIVED_FROM); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_SINKS) && + verifier.VerifyVector(sinks()) && + verifier.VerifyVectorOfTables(sinks()) && + VerifyOffset(verifier, VT_DERIVED_FROM) && + verifier.VerifyTable(derived_from()) && + verifier.EndTable(); + } +}; + +struct PlanBuilder { + typedef Plan Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_sinks(flatbuffers::Offset>> sinks) { + fbb_.AddOffset(Plan::VT_SINKS, sinks); + } + void add_derived_from(flatbuffers::Offset derived_from) { + fbb_.AddOffset(Plan::VT_DERIVED_FROM, derived_from); + } + explicit PlanBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + PlanBuilder &operator=(const PlanBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Plan::VT_SINKS); + return o; + } +}; + +inline flatbuffers::Offset CreatePlan( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> sinks = 0, + flatbuffers::Offset derived_from = 0) { + PlanBuilder builder_(_fbb); + builder_.add_derived_from(derived_from); + builder_.add_sinks(sinks); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreatePlanDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *sinks = nullptr, + flatbuffers::Offset derived_from = 0) { + auto sinks__ = sinks ? _fbb.CreateVector>(*sinks) : 0; + return org::apache::arrow::computeir::flatbuf::CreatePlan( + _fbb, + sinks__, + derived_from); +} + +inline const org::apache::arrow::computeir::flatbuf::Plan *GetPlan(const void *buf) { + return flatbuffers::GetRoot(buf); +} + +inline const org::apache::arrow::computeir::flatbuf::Plan *GetSizePrefixedPlan(const void *buf) { + return flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyPlanBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedPlanBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishPlanBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedPlanBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace flatbuf +} // namespace computeir +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_PLAN_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/Relation_generated.h b/cpp/src/generated/Relation_generated.h new file mode 100644 index 0000000000000..bf6a878a662b2 --- /dev/null +++ b/cpp/src/generated/Relation_generated.h @@ -0,0 +1,2049 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_RELATION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ +#define FLATBUFFERS_GENERATED_RELATION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ + +#include "flatbuffers/flatbuffers.h" + +#include "Schema_generated.h" +#include "Expression_generated.h" +#include "InlineBuffer_generated.h" +#include "Literal_generated.h" + +namespace org { +namespace apache { +namespace arrow { +namespace computeir { +namespace flatbuf { + +struct Remap; +struct RemapBuilder; + +struct PassThrough; +struct PassThroughBuilder; + +struct RelBase; +struct RelBaseBuilder; + +struct Filter; +struct FilterBuilder; + +struct Project; +struct ProjectBuilder; + +struct Aggregate; +struct AggregateBuilder; + +struct CanonicalJoinKind; +struct CanonicalJoinKindBuilder; + +struct NonCanonicalJoinKind; +struct NonCanonicalJoinKindBuilder; + +struct Join; +struct JoinBuilder; + +struct OrderBy; +struct OrderByBuilder; + +struct Limit; +struct LimitBuilder; + +struct Common; +struct CommonBuilder; + +struct CanonicalSetOpKind; +struct CanonicalSetOpKindBuilder; + +struct NonCanonicalSetOpKind; +struct NonCanonicalSetOpKindBuilder; + +struct SetOperation; +struct SetOperationBuilder; + +struct LiteralRelation; +struct LiteralRelationBuilder; + +struct Custom; +struct CustomBuilder; + +struct Read; +struct ReadBuilder; + +struct Write; +struct WriteBuilder; + +struct Relation; +struct RelationBuilder; + +/// A union for the different colum remapping variants +enum class Emit : uint8_t { + NONE = 0, + Remap = 1, + PassThrough = 2, + MIN = NONE, + MAX = PassThrough +}; + +inline const Emit (&EnumValuesEmit())[3] { + static const Emit values[] = { + Emit::NONE, + Emit::Remap, + Emit::PassThrough + }; + return values; +} + +inline const char * const *EnumNamesEmit() { + static const char * const names[4] = { + "NONE", + "Remap", + "PassThrough", + nullptr + }; + return names; +} + +inline const char *EnumNameEmit(Emit e) { + if (flatbuffers::IsOutRange(e, Emit::NONE, Emit::PassThrough)) return ""; + const size_t index = static_cast(e); + return EnumNamesEmit()[index]; +} + +template struct EmitTraits { + static const Emit enum_value = Emit::NONE; +}; + +template<> struct EmitTraits { + static const Emit enum_value = Emit::Remap; +}; + +template<> struct EmitTraits { + static const Emit enum_value = Emit::PassThrough; +}; + +bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type); +bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +enum class CanonicalJoinKindId : uint8_t { + Anti = 0, + Cross = 1, + FullOuter = 2, + Inner = 3, + LeftOuter = 4, + LeftSemi = 5, + RightOuter = 6, + MIN = Anti, + MAX = RightOuter +}; + +inline const CanonicalJoinKindId (&EnumValuesCanonicalJoinKindId())[7] { + static const CanonicalJoinKindId values[] = { + CanonicalJoinKindId::Anti, + CanonicalJoinKindId::Cross, + CanonicalJoinKindId::FullOuter, + CanonicalJoinKindId::Inner, + CanonicalJoinKindId::LeftOuter, + CanonicalJoinKindId::LeftSemi, + CanonicalJoinKindId::RightOuter + }; + return values; +} + +inline const char * const *EnumNamesCanonicalJoinKindId() { + static const char * const names[8] = { + "Anti", + "Cross", + "FullOuter", + "Inner", + "LeftOuter", + "LeftSemi", + "RightOuter", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalJoinKindId(CanonicalJoinKindId e) { + if (flatbuffers::IsOutRange(e, CanonicalJoinKindId::Anti, CanonicalJoinKindId::RightOuter)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalJoinKindId()[index]; +} + +enum class JoinKind : uint8_t { + NONE = 0, + CanonicalJoinKind = 1, + NonCanonicalJoinKind = 2, + MIN = NONE, + MAX = NonCanonicalJoinKind +}; + +inline const JoinKind (&EnumValuesJoinKind())[3] { + static const JoinKind values[] = { + JoinKind::NONE, + JoinKind::CanonicalJoinKind, + JoinKind::NonCanonicalJoinKind + }; + return values; +} + +inline const char * const *EnumNamesJoinKind() { + static const char * const names[4] = { + "NONE", + "CanonicalJoinKind", + "NonCanonicalJoinKind", + nullptr + }; + return names; +} + +inline const char *EnumNameJoinKind(JoinKind e) { + if (flatbuffers::IsOutRange(e, JoinKind::NONE, JoinKind::NonCanonicalJoinKind)) return ""; + const size_t index = static_cast(e); + return EnumNamesJoinKind()[index]; +} + +template struct JoinKindTraits { + static const JoinKind enum_value = JoinKind::NONE; +}; + +template<> struct JoinKindTraits { + static const JoinKind enum_value = JoinKind::CanonicalJoinKind; +}; + +template<> struct JoinKindTraits { + static const JoinKind enum_value = JoinKind::NonCanonicalJoinKind; +}; + +bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type); +bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// The kind of set operation being performed. +enum class CanonicalSetOpKindId : uint8_t { + Union = 0, + Intersection = 1, + Difference = 2, + MIN = Union, + MAX = Difference +}; + +inline const CanonicalSetOpKindId (&EnumValuesCanonicalSetOpKindId())[3] { + static const CanonicalSetOpKindId values[] = { + CanonicalSetOpKindId::Union, + CanonicalSetOpKindId::Intersection, + CanonicalSetOpKindId::Difference + }; + return values; +} + +inline const char * const *EnumNamesCanonicalSetOpKindId() { + static const char * const names[4] = { + "Union", + "Intersection", + "Difference", + nullptr + }; + return names; +} + +inline const char *EnumNameCanonicalSetOpKindId(CanonicalSetOpKindId e) { + if (flatbuffers::IsOutRange(e, CanonicalSetOpKindId::Union, CanonicalSetOpKindId::Difference)) return ""; + const size_t index = static_cast(e); + return EnumNamesCanonicalSetOpKindId()[index]; +} + +/// The kind of set operation +enum class SetOpKind : uint8_t { + NONE = 0, + CanonicalSetOpKind = 1, + NonCanonicalSetOpKind = 2, + MIN = NONE, + MAX = NonCanonicalSetOpKind +}; + +inline const SetOpKind (&EnumValuesSetOpKind())[3] { + static const SetOpKind values[] = { + SetOpKind::NONE, + SetOpKind::CanonicalSetOpKind, + SetOpKind::NonCanonicalSetOpKind + }; + return values; +} + +inline const char * const *EnumNamesSetOpKind() { + static const char * const names[4] = { + "NONE", + "CanonicalSetOpKind", + "NonCanonicalSetOpKind", + nullptr + }; + return names; +} + +inline const char *EnumNameSetOpKind(SetOpKind e) { + if (flatbuffers::IsOutRange(e, SetOpKind::NONE, SetOpKind::NonCanonicalSetOpKind)) return ""; + const size_t index = static_cast(e); + return EnumNamesSetOpKind()[index]; +} + +template struct SetOpKindTraits { + static const SetOpKind enum_value = SetOpKind::NONE; +}; + +template<> struct SetOpKindTraits { + static const SetOpKind enum_value = SetOpKind::CanonicalSetOpKind; +}; + +template<> struct SetOpKindTraits { + static const SetOpKind enum_value = SetOpKind::NonCanonicalSetOpKind; +}; + +bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type); +bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// The varieties of relations +enum class RelationImpl : uint8_t { + NONE = 0, + Aggregate = 1, + Common = 2, + Custom = 3, + SetOperation = 4, + Filter = 5, + Limit = 6, + LiteralRelation = 7, + OrderBy = 8, + Project = 9, + Read = 10, + Write = 11, + MIN = NONE, + MAX = Write +}; + +inline const RelationImpl (&EnumValuesRelationImpl())[12] { + static const RelationImpl values[] = { + RelationImpl::NONE, + RelationImpl::Aggregate, + RelationImpl::Common, + RelationImpl::Custom, + RelationImpl::SetOperation, + RelationImpl::Filter, + RelationImpl::Limit, + RelationImpl::LiteralRelation, + RelationImpl::OrderBy, + RelationImpl::Project, + RelationImpl::Read, + RelationImpl::Write + }; + return values; +} + +inline const char * const *EnumNamesRelationImpl() { + static const char * const names[13] = { + "NONE", + "Aggregate", + "Common", + "Custom", + "SetOperation", + "Filter", + "Limit", + "LiteralRelation", + "OrderBy", + "Project", + "Read", + "Write", + nullptr + }; + return names; +} + +inline const char *EnumNameRelationImpl(RelationImpl e) { + if (flatbuffers::IsOutRange(e, RelationImpl::NONE, RelationImpl::Write)) return ""; + const size_t index = static_cast(e); + return EnumNamesRelationImpl()[index]; +} + +template struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::NONE; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Aggregate; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Common; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Custom; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::SetOperation; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Filter; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Limit; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::LiteralRelation; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::OrderBy; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Project; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Read; +}; + +template<> struct RelationImplTraits { + static const RelationImpl enum_value = RelationImpl::Write; +}; + +bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type); +bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); + +/// A data type indicating a different mapping of columns +/// should occur in the output. +/// +/// For example: +/// +/// Given a query `SELECT a, b FROM t` where `t` has columns a, b, c +/// the mapping value for the projection would equal [0, 1]. +struct Remap FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef RemapBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_MAPPING = 4 + }; + const flatbuffers::Vector *mapping() const { + return GetPointer *>(VT_MAPPING); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_MAPPING) && + verifier.VerifyVector(mapping()) && + verifier.EndTable(); + } +}; + +struct RemapBuilder { + typedef Remap Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_mapping(flatbuffers::Offset> mapping) { + fbb_.AddOffset(Remap::VT_MAPPING, mapping); + } + explicit RemapBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + RemapBuilder &operator=(const RemapBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Remap::VT_MAPPING); + return o; + } +}; + +inline flatbuffers::Offset CreateRemap( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset> mapping = 0) { + RemapBuilder builder_(_fbb); + builder_.add_mapping(mapping); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateRemapDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector *mapping = nullptr) { + auto mapping__ = mapping ? _fbb.CreateVector(*mapping) : 0; + return org::apache::arrow::computeir::flatbuf::CreateRemap( + _fbb, + mapping__); +} + +struct PassThrough FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef PassThroughBuilder Builder; + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + verifier.EndTable(); + } +}; + +struct PassThroughBuilder { + typedef PassThrough Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + explicit PassThroughBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + PassThroughBuilder &operator=(const PassThroughBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreatePassThrough( + flatbuffers::FlatBufferBuilder &_fbb) { + PassThroughBuilder builder_(_fbb); + return builder_.Finish(); +} + +/// Fields common to every relational operator +struct RelBase FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef RelBaseBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ARGUMENTS = 4, + VT_OUTPUT_MAPPING_TYPE = 6, + VT_OUTPUT_MAPPING = 8, + VT_OPTIONS = 10 + }; + /// The arguments passed to `operation`. + const flatbuffers::Vector> *arguments() const { + return GetPointer> *>(VT_ARGUMENTS); + } + org::apache::arrow::computeir::flatbuf::Emit output_mapping_type() const { + return static_cast(GetField(VT_OUTPUT_MAPPING_TYPE, 0)); + } + /// Output remapping of ordinals for a given operation + const void *output_mapping() const { + return GetPointer(VT_OUTPUT_MAPPING); + } + template const T *output_mapping_as() const; + const org::apache::arrow::computeir::flatbuf::Remap *output_mapping_as_Remap() const { + return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::Remap ? static_cast(output_mapping()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::PassThrough *output_mapping_as_PassThrough() const { + return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::PassThrough ? static_cast(output_mapping()) : nullptr; + } + /// Arguments for custom operations + const org::apache::arrow::computeir::flatbuf::InlineBuffer *options() const { + return GetPointer(VT_OPTIONS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_ARGUMENTS) && + verifier.VerifyVector(arguments()) && + verifier.VerifyVectorOfTables(arguments()) && + VerifyField(verifier, VT_OUTPUT_MAPPING_TYPE) && + VerifyOffsetRequired(verifier, VT_OUTPUT_MAPPING) && + VerifyEmit(verifier, output_mapping(), output_mapping_type()) && + VerifyOffset(verifier, VT_OPTIONS) && + verifier.VerifyTable(options()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Remap *RelBase::output_mapping_as() const { + return output_mapping_as_Remap(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::PassThrough *RelBase::output_mapping_as() const { + return output_mapping_as_PassThrough(); +} + +struct RelBaseBuilder { + typedef RelBase Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_arguments(flatbuffers::Offset>> arguments) { + fbb_.AddOffset(RelBase::VT_ARGUMENTS, arguments); + } + void add_output_mapping_type(org::apache::arrow::computeir::flatbuf::Emit output_mapping_type) { + fbb_.AddElement(RelBase::VT_OUTPUT_MAPPING_TYPE, static_cast(output_mapping_type), 0); + } + void add_output_mapping(flatbuffers::Offset output_mapping) { + fbb_.AddOffset(RelBase::VT_OUTPUT_MAPPING, output_mapping); + } + void add_options(flatbuffers::Offset options) { + fbb_.AddOffset(RelBase::VT_OPTIONS, options); + } + explicit RelBaseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + RelBaseBuilder &operator=(const RelBaseBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, RelBase::VT_ARGUMENTS); + fbb_.Required(o, RelBase::VT_OUTPUT_MAPPING); + return o; + } +}; + +inline flatbuffers::Offset CreateRelBase( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset>> arguments = 0, + org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, + flatbuffers::Offset output_mapping = 0, + flatbuffers::Offset options = 0) { + RelBaseBuilder builder_(_fbb); + builder_.add_options(options); + builder_.add_output_mapping(output_mapping); + builder_.add_arguments(arguments); + builder_.add_output_mapping_type(output_mapping_type); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateRelBaseDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const std::vector> *arguments = nullptr, + org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, + flatbuffers::Offset output_mapping = 0, + flatbuffers::Offset options = 0) { + auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; + return org::apache::arrow::computeir::flatbuf::CreateRelBase( + _fbb, + arguments__, + output_mapping_type, + output_mapping, + options); +} + +/// Filter operation +struct Filter FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef FilterBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_PREDICATE = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// The expression which will be evaluated against input rows + /// to determine whether they should be excluded from the + /// filter relation's output. + const org::apache::arrow::computeir::flatbuf::Expression *predicate() const { + return GetPointer(VT_PREDICATE); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_PREDICATE) && + verifier.VerifyTable(predicate()) && + verifier.EndTable(); + } +}; + +struct FilterBuilder { + typedef Filter Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Filter::VT_BASE, base); + } + void add_predicate(flatbuffers::Offset predicate) { + fbb_.AddOffset(Filter::VT_PREDICATE, predicate); + } + explicit FilterBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + FilterBuilder &operator=(const FilterBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Filter::VT_BASE); + fbb_.Required(o, Filter::VT_PREDICATE); + return o; + } +}; + +inline flatbuffers::Offset CreateFilter( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset predicate = 0) { + FilterBuilder builder_(_fbb); + builder_.add_predicate(predicate); + builder_.add_base(base); + return builder_.Finish(); +} + +/// Projection +struct Project FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ProjectBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_EXPRESSIONS = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// Expressions which will be evaluated to produce to + /// the rows of the project relation's output. + const flatbuffers::Vector> *expressions() const { + return GetPointer> *>(VT_EXPRESSIONS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_EXPRESSIONS) && + verifier.VerifyVector(expressions()) && + verifier.VerifyVectorOfTables(expressions()) && + verifier.EndTable(); + } +}; + +struct ProjectBuilder { + typedef Project Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Project::VT_BASE, base); + } + void add_expressions(flatbuffers::Offset>> expressions) { + fbb_.AddOffset(Project::VT_EXPRESSIONS, expressions); + } + explicit ProjectBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ProjectBuilder &operator=(const ProjectBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Project::VT_BASE); + fbb_.Required(o, Project::VT_EXPRESSIONS); + return o; + } +}; + +inline flatbuffers::Offset CreateProject( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset>> expressions = 0) { + ProjectBuilder builder_(_fbb); + builder_.add_expressions(expressions); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateProjectDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const std::vector> *expressions = nullptr) { + auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; + return org::apache::arrow::computeir::flatbuf::CreateProject( + _fbb, + base, + expressions__); +} + +/// Aggregate operation +struct Aggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef AggregateBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_AGGREGATIONS = 6, + VT_KEYS = 8 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// Expressions which will be evaluated to produce to + /// the rows of the aggregate relation's output. + const flatbuffers::Vector> *aggregations() const { + return GetPointer> *>(VT_AGGREGATIONS); + } + /// Keys by which `aggregations` will be grouped. + const flatbuffers::Vector> *keys() const { + return GetPointer> *>(VT_KEYS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_AGGREGATIONS) && + verifier.VerifyVector(aggregations()) && + verifier.VerifyVectorOfTables(aggregations()) && + VerifyOffsetRequired(verifier, VT_KEYS) && + verifier.VerifyVector(keys()) && + verifier.VerifyVectorOfTables(keys()) && + verifier.EndTable(); + } +}; + +struct AggregateBuilder { + typedef Aggregate Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Aggregate::VT_BASE, base); + } + void add_aggregations(flatbuffers::Offset>> aggregations) { + fbb_.AddOffset(Aggregate::VT_AGGREGATIONS, aggregations); + } + void add_keys(flatbuffers::Offset>> keys) { + fbb_.AddOffset(Aggregate::VT_KEYS, keys); + } + explicit AggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + AggregateBuilder &operator=(const AggregateBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Aggregate::VT_BASE); + fbb_.Required(o, Aggregate::VT_AGGREGATIONS); + fbb_.Required(o, Aggregate::VT_KEYS); + return o; + } +}; + +inline flatbuffers::Offset CreateAggregate( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset>> aggregations = 0, + flatbuffers::Offset>> keys = 0) { + AggregateBuilder builder_(_fbb); + builder_.add_keys(keys); + builder_.add_aggregations(aggregations); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateAggregateDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const std::vector> *aggregations = nullptr, + const std::vector> *keys = nullptr) { + auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; + auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; + return org::apache::arrow::computeir::flatbuf::CreateAggregate( + _fbb, + base, + aggregations__, + keys__); +} + +struct CanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalJoinKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id() const { + return static_cast(GetField(VT_ID, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && + verifier.EndTable(); + } +}; + +struct CanonicalJoinKindBuilder { + typedef CanonicalJoinKind Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_id(org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id) { + fbb_.AddElement(CanonicalJoinKind::VT_ID, static_cast(id), 0); + } + explicit CanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CanonicalJoinKindBuilder &operator=(const CanonicalJoinKindBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCanonicalJoinKind( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id = org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId::Anti) { + CanonicalJoinKindBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalJoinKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalJoinKindBuilder { + typedef NonCanonicalJoinKind Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME, name); + } + explicit NonCanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalJoinKindBuilder &operator=(const NonCanonicalJoinKindBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalJoinKind::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalJoinKind( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalJoinKindBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateNonCanonicalJoinKindDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalJoinKind( + _fbb, + name_space__, + name__); +} + +/// The contents of Relation.options will be JoinOptions +/// if Relation.operation = CanonicalOperation::Join +struct Join FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef JoinBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_ON_EXPRESSION = 6, + VT_JOIN_KIND_TYPE = 8, + VT_JOIN_KIND = 10 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// The expression which will be evaluated against rows from each + /// input to determine whether they should be included in the + /// join relation's output. + const org::apache::arrow::computeir::flatbuf::Expression *on_expression() const { + return GetPointer(VT_ON_EXPRESSION); + } + org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type() const { + return static_cast(GetField(VT_JOIN_KIND_TYPE, 0)); + } + /// The kind of join to use. + const void *join_kind() const { + return GetPointer(VT_JOIN_KIND); + } + template const T *join_kind_as() const; + const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *join_kind_as_CanonicalJoinKind() const { + return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::CanonicalJoinKind ? static_cast(join_kind()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *join_kind_as_NonCanonicalJoinKind() const { + return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::NonCanonicalJoinKind ? static_cast(join_kind()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && + verifier.VerifyTable(on_expression()) && + VerifyField(verifier, VT_JOIN_KIND_TYPE) && + VerifyOffsetRequired(verifier, VT_JOIN_KIND) && + VerifyJoinKind(verifier, join_kind(), join_kind_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *Join::join_kind_as() const { + return join_kind_as_CanonicalJoinKind(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *Join::join_kind_as() const { + return join_kind_as_NonCanonicalJoinKind(); +} + +struct JoinBuilder { + typedef Join Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Join::VT_BASE, base); + } + void add_on_expression(flatbuffers::Offset on_expression) { + fbb_.AddOffset(Join::VT_ON_EXPRESSION, on_expression); + } + void add_join_kind_type(org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type) { + fbb_.AddElement(Join::VT_JOIN_KIND_TYPE, static_cast(join_kind_type), 0); + } + void add_join_kind(flatbuffers::Offset join_kind) { + fbb_.AddOffset(Join::VT_JOIN_KIND, join_kind); + } + explicit JoinBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + JoinBuilder &operator=(const JoinBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Join::VT_BASE); + fbb_.Required(o, Join::VT_ON_EXPRESSION); + fbb_.Required(o, Join::VT_JOIN_KIND); + return o; + } +}; + +inline flatbuffers::Offset CreateJoin( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset on_expression = 0, + org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type = org::apache::arrow::computeir::flatbuf::JoinKind::NONE, + flatbuffers::Offset join_kind = 0) { + JoinBuilder builder_(_fbb); + builder_.add_join_kind(join_kind); + builder_.add_on_expression(on_expression); + builder_.add_base(base); + builder_.add_join_kind_type(join_kind_type); + return builder_.Finish(); +} + +/// Order by relation +struct OrderBy FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef OrderByBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_KEYS = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// Define sort order for rows of output. + /// Keys with higher precedence are ordered ahead of other keys. + const flatbuffers::Vector> *keys() const { + return GetPointer> *>(VT_KEYS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_KEYS) && + verifier.VerifyVector(keys()) && + verifier.VerifyVectorOfTables(keys()) && + verifier.EndTable(); + } +}; + +struct OrderByBuilder { + typedef OrderBy Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(OrderBy::VT_BASE, base); + } + void add_keys(flatbuffers::Offset>> keys) { + fbb_.AddOffset(OrderBy::VT_KEYS, keys); + } + explicit OrderByBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + OrderByBuilder &operator=(const OrderByBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, OrderBy::VT_BASE); + fbb_.Required(o, OrderBy::VT_KEYS); + return o; + } +}; + +inline flatbuffers::Offset CreateOrderBy( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset>> keys = 0) { + OrderByBuilder builder_(_fbb); + builder_.add_keys(keys); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateOrderByDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const std::vector> *keys = nullptr) { + auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; + return org::apache::arrow::computeir::flatbuf::CreateOrderBy( + _fbb, + base, + keys__); +} + +/// Limit operation +struct Limit FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LimitBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_COUNT = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// The maximum number of rows of output. + int64_t count() const { + return GetField(VT_COUNT, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyField(verifier, VT_COUNT) && + verifier.EndTable(); + } +}; + +struct LimitBuilder { + typedef Limit Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Limit::VT_BASE, base); + } + void add_count(int64_t count) { + fbb_.AddElement(Limit::VT_COUNT, count, 0); + } + explicit LimitBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + LimitBuilder &operator=(const LimitBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Limit::VT_BASE); + return o; + } +}; + +inline flatbuffers::Offset CreateLimit( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + int64_t count = 0) { + LimitBuilder builder_(_fbb); + builder_.add_count(count); + builder_.add_base(base); + return builder_.Finish(); +} + +/// Common table expresssion +struct Common FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CommonBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_NAME = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// Commons (CTEs in SQL) allow assigning a name to a stream + /// of data and reusing it, potentially multiple times and + /// potentially recursively. + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct CommonBuilder { + typedef Common Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Common::VT_BASE, base); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(Common::VT_NAME, name); + } + explicit CommonBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CommonBuilder &operator=(const CommonBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Common::VT_BASE); + fbb_.Required(o, Common::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateCommon( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset name = 0) { + CommonBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateCommonDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const char *name = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::CreateCommon( + _fbb, + base, + name__); +} + +struct CanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CanonicalSetOpKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_ID = 4 + }; + org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id() const { + return static_cast(GetField(VT_ID, 0)); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_ID) && + verifier.EndTable(); + } +}; + +struct CanonicalSetOpKindBuilder { + typedef CanonicalSetOpKind Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_id(org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id) { + fbb_.AddElement(CanonicalSetOpKind::VT_ID, static_cast(id), 0); + } + explicit CanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CanonicalSetOpKindBuilder &operator=(const CanonicalSetOpKindBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + return o; + } +}; + +inline flatbuffers::Offset CreateCanonicalSetOpKind( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id = org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId::Union) { + CanonicalSetOpKindBuilder builder_(_fbb); + builder_.add_id(id); + return builder_.Finish(); +} + +struct NonCanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef NonCanonicalSetOpKindBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME_SPACE = 4, + VT_NAME = 6 + }; + const flatbuffers::String *name_space() const { + return GetPointer(VT_NAME_SPACE); + } + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_NAME_SPACE) && + verifier.VerifyString(name_space()) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + verifier.EndTable(); + } +}; + +struct NonCanonicalSetOpKindBuilder { + typedef NonCanonicalSetOpKind Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_name_space(flatbuffers::Offset name_space) { + fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME_SPACE, name_space); + } + void add_name(flatbuffers::Offset name) { + fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME, name); + } + explicit NonCanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + NonCanonicalSetOpKindBuilder &operator=(const NonCanonicalSetOpKindBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, NonCanonicalSetOpKind::VT_NAME); + return o; + } +}; + +inline flatbuffers::Offset CreateNonCanonicalSetOpKind( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name_space = 0, + flatbuffers::Offset name = 0) { + NonCanonicalSetOpKindBuilder builder_(_fbb); + builder_.add_name(name); + builder_.add_name_space(name_space); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateNonCanonicalSetOpKindDirect( + flatbuffers::FlatBufferBuilder &_fbb, + const char *name_space = nullptr, + const char *name = nullptr) { + auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; + auto name__ = name ? _fbb.CreateString(name) : 0; + return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalSetOpKind( + _fbb, + name_space__, + name__); +} + +/// A set operation on two or more relations +struct SetOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef SetOperationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_SET_OP_TYPE = 6, + VT_SET_OP = 8 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type() const { + return static_cast(GetField(VT_SET_OP_TYPE, 0)); + } + /// The kind of set operation + const void *set_op() const { + return GetPointer(VT_SET_OP); + } + template const T *set_op_as() const; + const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *set_op_as_CanonicalSetOpKind() const { + return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::CanonicalSetOpKind ? static_cast(set_op()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *set_op_as_NonCanonicalSetOpKind() const { + return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::NonCanonicalSetOpKind ? static_cast(set_op()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyField(verifier, VT_SET_OP_TYPE) && + VerifyOffsetRequired(verifier, VT_SET_OP) && + VerifySetOpKind(verifier, set_op(), set_op_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *SetOperation::set_op_as() const { + return set_op_as_CanonicalSetOpKind(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *SetOperation::set_op_as() const { + return set_op_as_NonCanonicalSetOpKind(); +} + +struct SetOperationBuilder { + typedef SetOperation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(SetOperation::VT_BASE, base); + } + void add_set_op_type(org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type) { + fbb_.AddElement(SetOperation::VT_SET_OP_TYPE, static_cast(set_op_type), 0); + } + void add_set_op(flatbuffers::Offset set_op) { + fbb_.AddOffset(SetOperation::VT_SET_OP, set_op); + } + explicit SetOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + SetOperationBuilder &operator=(const SetOperationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, SetOperation::VT_BASE); + fbb_.Required(o, SetOperation::VT_SET_OP); + return o; + } +}; + +inline flatbuffers::Offset CreateSetOperation( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type = org::apache::arrow::computeir::flatbuf::SetOpKind::NONE, + flatbuffers::Offset set_op = 0) { + SetOperationBuilder builder_(_fbb); + builder_.add_set_op(set_op); + builder_.add_base(base); + builder_.add_set_op_type(set_op_type); + return builder_.Finish(); +} + +/// Literal relation +struct LiteralRelation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef LiteralRelationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_COLUMNS = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// The columns of this literal relation. + const flatbuffers::Vector> *columns() const { + return GetPointer> *>(VT_COLUMNS); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_COLUMNS) && + verifier.VerifyVector(columns()) && + verifier.VerifyVectorOfTables(columns()) && + verifier.EndTable(); + } +}; + +struct LiteralRelationBuilder { + typedef LiteralRelation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(LiteralRelation::VT_BASE, base); + } + void add_columns(flatbuffers::Offset>> columns) { + fbb_.AddOffset(LiteralRelation::VT_COLUMNS, columns); + } + explicit LiteralRelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + LiteralRelationBuilder &operator=(const LiteralRelationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, LiteralRelation::VT_BASE); + fbb_.Required(o, LiteralRelation::VT_COLUMNS); + return o; + } +}; + +inline flatbuffers::Offset CreateLiteralRelation( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset>> columns = 0) { + LiteralRelationBuilder builder_(_fbb); + builder_.add_columns(columns); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateLiteralRelationDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const std::vector> *columns = nullptr) { + auto columns__ = columns ? _fbb.CreateVector>(*columns) : 0; + return org::apache::arrow::computeir::flatbuf::CreateLiteralRelation( + _fbb, + base, + columns__); +} + +/// A user-defined relation. +struct Custom FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef CustomBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_SCHEMA = 6 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + /// NB: the schema is optional here, since a custom relation + /// may or may not need it. + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffset(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct CustomBuilder { + typedef Custom Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Custom::VT_BASE, base); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Custom::VT_SCHEMA, schema); + } + explicit CustomBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + CustomBuilder &operator=(const CustomBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Custom::VT_BASE); + return o; + } +}; + +inline flatbuffers::Offset CreateCustom( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset schema = 0) { + CustomBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_base(base); + return builder_.Finish(); +} + +/// A table read +struct Read FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef ReadBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_RESOURCE = 6, + VT_SCHEMA = 8 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + const flatbuffers::String *resource() const { + return GetPointer(VT_RESOURCE); + } + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_RESOURCE) && + verifier.VerifyString(resource()) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct ReadBuilder { + typedef Read Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Read::VT_BASE, base); + } + void add_resource(flatbuffers::Offset resource) { + fbb_.AddOffset(Read::VT_RESOURCE, resource); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Read::VT_SCHEMA, schema); + } + explicit ReadBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + ReadBuilder &operator=(const ReadBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Read::VT_BASE); + fbb_.Required(o, Read::VT_RESOURCE); + fbb_.Required(o, Read::VT_SCHEMA); + return o; + } +}; + +inline flatbuffers::Offset CreateRead( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset resource = 0, + flatbuffers::Offset schema = 0) { + ReadBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_resource(resource); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateReadDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const char *resource = nullptr, + flatbuffers::Offset schema = 0) { + auto resource__ = resource ? _fbb.CreateString(resource) : 0; + return org::apache::arrow::computeir::flatbuf::CreateRead( + _fbb, + base, + resource__, + schema); +} + +/// A table write +struct Write FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef WriteBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_BASE = 4, + VT_RESOURCE = 6, + VT_SCHEMA = 8 + }; + const org::apache::arrow::computeir::flatbuf::RelBase *base() const { + return GetPointer(VT_BASE); + } + const flatbuffers::String *resource() const { + return GetPointer(VT_RESOURCE); + } + const org::apache::arrow::flatbuf::Schema *schema() const { + return GetPointer(VT_SCHEMA); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_BASE) && + verifier.VerifyTable(base()) && + VerifyOffsetRequired(verifier, VT_RESOURCE) && + verifier.VerifyString(resource()) && + VerifyOffsetRequired(verifier, VT_SCHEMA) && + verifier.VerifyTable(schema()) && + verifier.EndTable(); + } +}; + +struct WriteBuilder { + typedef Write Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_base(flatbuffers::Offset base) { + fbb_.AddOffset(Write::VT_BASE, base); + } + void add_resource(flatbuffers::Offset resource) { + fbb_.AddOffset(Write::VT_RESOURCE, resource); + } + void add_schema(flatbuffers::Offset schema) { + fbb_.AddOffset(Write::VT_SCHEMA, schema); + } + explicit WriteBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + WriteBuilder &operator=(const WriteBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Write::VT_BASE); + fbb_.Required(o, Write::VT_RESOURCE); + fbb_.Required(o, Write::VT_SCHEMA); + return o; + } +}; + +inline flatbuffers::Offset CreateWrite( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + flatbuffers::Offset resource = 0, + flatbuffers::Offset schema = 0) { + WriteBuilder builder_(_fbb); + builder_.add_schema(schema); + builder_.add_resource(resource); + builder_.add_base(base); + return builder_.Finish(); +} + +inline flatbuffers::Offset CreateWriteDirect( + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset base = 0, + const char *resource = nullptr, + flatbuffers::Offset schema = 0) { + auto resource__ = resource ? _fbb.CreateString(resource) : 0; + return org::apache::arrow::computeir::flatbuf::CreateWrite( + _fbb, + base, + resource__, + schema); +} + +/// A table holding an instance of the possible relation types. +struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef RelationBuilder Builder; + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_IMPL_TYPE = 4, + VT_IMPL = 6 + }; + org::apache::arrow::computeir::flatbuf::RelationImpl impl_type() const { + return static_cast(GetField(VT_IMPL_TYPE, 0)); + } + const void *impl() const { + return GetPointer(VT_IMPL); + } + template const T *impl_as() const; + const org::apache::arrow::computeir::flatbuf::Aggregate *impl_as_Aggregate() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Aggregate ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Common *impl_as_Common() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Common ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Custom *impl_as_Custom() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Custom ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::SetOperation *impl_as_SetOperation() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::SetOperation ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Filter *impl_as_Filter() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Filter ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Limit *impl_as_Limit() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Limit ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::LiteralRelation *impl_as_LiteralRelation() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::LiteralRelation ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::OrderBy *impl_as_OrderBy() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::OrderBy ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Project *impl_as_Project() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Project ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Read *impl_as_Read() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Read ? static_cast(impl()) : nullptr; + } + const org::apache::arrow::computeir::flatbuf::Write *impl_as_Write() const { + return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Write ? static_cast(impl()) : nullptr; + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyField(verifier, VT_IMPL_TYPE) && + VerifyOffsetRequired(verifier, VT_IMPL) && + VerifyRelationImpl(verifier, impl(), impl_type()) && + verifier.EndTable(); + } +}; + +template<> inline const org::apache::arrow::computeir::flatbuf::Aggregate *Relation::impl_as() const { + return impl_as_Aggregate(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Common *Relation::impl_as() const { + return impl_as_Common(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Custom *Relation::impl_as() const { + return impl_as_Custom(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::SetOperation *Relation::impl_as() const { + return impl_as_SetOperation(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Filter *Relation::impl_as() const { + return impl_as_Filter(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Limit *Relation::impl_as() const { + return impl_as_Limit(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::LiteralRelation *Relation::impl_as() const { + return impl_as_LiteralRelation(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::OrderBy *Relation::impl_as() const { + return impl_as_OrderBy(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Project *Relation::impl_as() const { + return impl_as_Project(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Read *Relation::impl_as() const { + return impl_as_Read(); +} + +template<> inline const org::apache::arrow::computeir::flatbuf::Write *Relation::impl_as() const { + return impl_as_Write(); +} + +struct RelationBuilder { + typedef Relation Table; + flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::uoffset_t start_; + void add_impl_type(org::apache::arrow::computeir::flatbuf::RelationImpl impl_type) { + fbb_.AddElement(Relation::VT_IMPL_TYPE, static_cast(impl_type), 0); + } + void add_impl(flatbuffers::Offset impl) { + fbb_.AddOffset(Relation::VT_IMPL, impl); + } + explicit RelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); + } + RelationBuilder &operator=(const RelationBuilder &); + flatbuffers::Offset Finish() { + const auto end = fbb_.EndTable(start_); + auto o = flatbuffers::Offset(end); + fbb_.Required(o, Relation::VT_IMPL); + return o; + } +}; + +inline flatbuffers::Offset CreateRelation( + flatbuffers::FlatBufferBuilder &_fbb, + org::apache::arrow::computeir::flatbuf::RelationImpl impl_type = org::apache::arrow::computeir::flatbuf::RelationImpl::NONE, + flatbuffers::Offset impl = 0) { + RelationBuilder builder_(_fbb); + builder_.add_impl(impl); + builder_.add_impl_type(impl_type); + return builder_.Finish(); +} + +inline bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type) { + switch (type) { + case Emit::NONE: { + return true; + } + case Emit::Remap: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case Emit::PassThrough: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyEmit( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type) { + switch (type) { + case JoinKind::NONE: { + return true; + } + case JoinKind::CanonicalJoinKind: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case JoinKind::NonCanonicalJoinKind: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyJoinKind( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type) { + switch (type) { + case SetOpKind::NONE: { + return true; + } + case SetOpKind::CanonicalSetOpKind: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case SetOpKind::NonCanonicalSetOpKind: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifySetOpKind( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type) { + switch (type) { + case RelationImpl::NONE: { + return true; + } + case RelationImpl::Aggregate: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Common: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Custom: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::SetOperation: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Filter: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Limit: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::LiteralRelation: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::OrderBy: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Project: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Read: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + case RelationImpl::Write: { + auto ptr = reinterpret_cast(obj); + return verifier.VerifyTable(ptr); + } + default: return true; + } +} + +inline bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { + if (!values || !types) return !values && !types; + if (values->size() != types->size()) return false; + for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { + if (!VerifyRelationImpl( + verifier, values->Get(i), types->GetEnum(i))) { + return false; + } + } + return true; +} + +inline const org::apache::arrow::computeir::flatbuf::Relation *GetRelation(const void *buf) { + return flatbuffers::GetRoot(buf); +} + +inline const org::apache::arrow::computeir::flatbuf::Relation *GetSizePrefixedRelation(const void *buf) { + return flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyRelationBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedRelationBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishRelationBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedRelationBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + +} // namespace flatbuf +} // namespace computeir +} // namespace arrow +} // namespace apache +} // namespace org + +#endif // FLATBUFFERS_GENERATED_RELATION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ From f25a2825b1c686a260c2f47b6ff189e876aa0640 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:47:48 -0400 Subject: [PATCH 30/96] Remove generated RPC code --- cpp/src/generated/ComputeIR.grpc.fb.cc | 97 ----------- cpp/src/generated/ComputeIR.grpc.fb.h | 230 ------------------------- 2 files changed, 327 deletions(-) delete mode 100644 cpp/src/generated/ComputeIR.grpc.fb.cc delete mode 100644 cpp/src/generated/ComputeIR.grpc.fb.h diff --git a/cpp/src/generated/ComputeIR.grpc.fb.cc b/cpp/src/generated/ComputeIR.grpc.fb.cc deleted file mode 100644 index ba2ca10e1f947..0000000000000 --- a/cpp/src/generated/ComputeIR.grpc.fb.cc +++ /dev/null @@ -1,97 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: ComputeIR - -#include "ComputeIR_generated.h" -#include "ComputeIR.grpc.fb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -namespace org { -namespace apache { -namespace arrow { -namespace flatbuf { -namespace computeir { - -static const char* Interactive_method_names[] = { - "/org.apache.arrow.flatbuf.computeir.Interactive/explain", - "/org.apache.arrow.flatbuf.computeir.Interactive/execute", -}; - -std::unique_ptr< Interactive::Stub> Interactive::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - std::unique_ptr< Interactive::Stub> stub(new Interactive::Stub(channel)); - return stub; -} - -Interactive::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) - : channel_(channel) , rpcmethod_explain_(Interactive_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_execute_(Interactive_method_names[1], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel) - {} - -::grpc::Status Interactive::Stub::explain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, flatbuffers::grpc::Message* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_explain_, context, request, response); -} - -::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* Interactive::Stub::AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_explain_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* Interactive::Stub::PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_explain_, context, request, false); -} - -::grpc::ClientReader< flatbuffers::grpc::Message>* Interactive::Stub::executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { - return ::grpc::internal::ClientReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), rpcmethod_execute_, context, request); -} - -::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { - return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, true, tag); -} - -::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* Interactive::Stub::PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message>::Create(channel_.get(), cq, rpcmethod_execute_, context, request, false, nullptr); -} - -Interactive::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - Interactive_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Interactive::Service, flatbuffers::grpc::Message, flatbuffers::grpc::Message>( - std::mem_fn(&Interactive::Service::explain), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Interactive_method_names[1], - ::grpc::internal::RpcMethod::SERVER_STREAMING, - new ::grpc::internal::ServerStreamingHandler< Interactive::Service, flatbuffers::grpc::Message, flatbuffers::grpc::Message>( - std::mem_fn(&Interactive::Service::execute), this))); -} - -Interactive::Service::~Service() { -} - -::grpc::Status Interactive::Service::explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Interactive::Service::execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) { - (void) context; - (void) request; - (void) writer; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace org -} // namespace apache -} // namespace arrow -} // namespace flatbuf -} // namespace computeir - diff --git a/cpp/src/generated/ComputeIR.grpc.fb.h b/cpp/src/generated/ComputeIR.grpc.fb.h deleted file mode 100644 index c25039c212787..0000000000000 --- a/cpp/src/generated/ComputeIR.grpc.fb.h +++ /dev/null @@ -1,230 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: ComputeIR -#ifndef GRPC_ComputeIR__INCLUDED -#define GRPC_ComputeIR__INCLUDED - -#include "ComputeIR_generated.h" -#include "flatbuffers/grpc.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc { -class CompletionQueue; -class Channel; -class ServerCompletionQueue; -class ServerContext; -} // namespace grpc - -namespace org { -namespace apache { -namespace arrow { -namespace flatbuf { -namespace computeir { - -class Interactive final { - public: - static constexpr char const* service_full_name() { - return "org.apache.arrow.flatbuf.computeir.Interactive"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - virtual ::grpc::Status explain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, flatbuffers::grpc::Message* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>> Asyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>>(AsyncexplainRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>> PrepareAsyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>>(PrepareAsyncexplainRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { - return std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>>(executeRaw(context, request)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); - } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>* AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::grpc::Message>* PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientReaderInterface< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) = 0; - virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) = 0; - virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); - ::grpc::Status explain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, flatbuffers::grpc::Message* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>> Asyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>>(AsyncexplainRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>> PrepareAsyncexplain(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>>(PrepareAsyncexplainRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>> execute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) { - return std::unique_ptr< ::grpc::ClientReader< flatbuffers::grpc::Message>>(executeRaw(context, request)); - } - std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> Asyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(AsyncexecuteRaw(context, request, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>> PrepareAsyncexecute(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>>(PrepareAsyncexecuteRaw(context, request, cq)); - } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* AsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message>* PrepareAsyncexplainRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientReader< flatbuffers::grpc::Message>* executeRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request) override; - ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* AsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq, void* tag) override; - ::grpc::ClientAsyncReader< flatbuffers::grpc::Message>* PrepareAsyncexecuteRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message& request, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_explain_; - const ::grpc::internal::RpcMethod rpcmethod_execute_; - }; - static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); - - class Service : public ::grpc::Service { - public: - Service(); - virtual ~Service(); - virtual ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response); - virtual ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer); - }; - template - class WithAsyncMethod_explain : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithAsyncMethod_explain() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_explain() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void Requestexplain(::grpc::ServerContext* context, flatbuffers::grpc::Message* request, ::grpc::ServerAsyncResponseWriter< flatbuffers::grpc::Message>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_execute : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithAsyncMethod_execute() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_execute() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void Requestexecute(::grpc::ServerContext* context, flatbuffers::grpc::Message* request, ::grpc::ServerAsyncWriter< flatbuffers::grpc::Message>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); - } - }; - typedef WithAsyncMethod_explain< WithAsyncMethod_execute< Service > > AsyncService; - template - class WithGenericMethod_explain : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithGenericMethod_explain() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_explain() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_execute : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithGenericMethod_execute() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_execute() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithStreamedUnaryMethod_explain : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithStreamedUnaryMethod_explain() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< flatbuffers::grpc::Message, flatbuffers::grpc::Message>(std::bind(&WithStreamedUnaryMethod_explain::Streamedexplain, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_explain() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status explain(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, flatbuffers::grpc::Message* response) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status Streamedexplain(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< flatbuffers::grpc::Message,flatbuffers::grpc::Message>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_explain< Service > StreamedUnaryService; - template - class WithSplitStreamingMethod_execute : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service *service) {} - public: - WithSplitStreamingMethod_execute() { - ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::SplitServerStreamingHandler< flatbuffers::grpc::Message, flatbuffers::grpc::Message>(std::bind(&WithSplitStreamingMethod_execute::Streamedexecute, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithSplitStreamingMethod_execute() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status execute(::grpc::ServerContext* context, const flatbuffers::grpc::Message* request, ::grpc::ServerWriter< flatbuffers::grpc::Message>* writer) final override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with split streamed - virtual ::grpc::Status Streamedexecute(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< flatbuffers::grpc::Message,flatbuffers::grpc::Message>* server_split_streamer) = 0; - }; - typedef WithSplitStreamingMethod_execute< Service > SplitStreamedService; - typedef WithStreamedUnaryMethod_explain< WithSplitStreamingMethod_execute< Service > > StreamedService; -}; - -} // namespace computeir -} // namespace flatbuf -} // namespace arrow -} // namespace apache -} // namespace org - - -#endif // GRPC_ComputeIR__INCLUDED From a603b661c67c44ac8ece1a6ce563c91c4a51e09b Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:49:17 -0400 Subject: [PATCH 31/96] Make sure InlineBuffer buffer is the root_type for it's definition file --- format/experimental/computeir/InlineBuffer.fbs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/format/experimental/computeir/InlineBuffer.fbs b/format/experimental/computeir/InlineBuffer.fbs index a27968a779e41..fe013f279defe 100644 --- a/format/experimental/computeir/InlineBuffer.fbs +++ b/format/experimental/computeir/InlineBuffer.fbs @@ -54,3 +54,5 @@ table InlineBuffer { // indirection to support them. impl: InlineBufferImpl (required); } + +root_type InlineBuffer; From d1be0b3dd62dfc0354dae0010960e8a681b43a4f Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:55:21 -0400 Subject: [PATCH 32/96] Try ignoring generated flatbuffers Python code --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index fac7bf85a77f1..9d4afc8a984eb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,4 +3,4 @@ r/R/arrowExports.R linguist-generated=true r/src/RcppExports.cpp linguist-generated=true r/src/arrowExports.cpp linguist-generated=true r/man/*.Rd linguist-generated=true - +python/generated/**/*.py linguist-generated=true From dfc1e087981c82b32b463e9c68b43213c21975d6 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 14:57:10 -0400 Subject: [PATCH 33/96] Ignore generated C++ in code review --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 9d4afc8a984eb..d8912f3bc75f8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,4 @@ r/src/RcppExports.cpp linguist-generated=true r/src/arrowExports.cpp linguist-generated=true r/man/*.Rd linguist-generated=true python/generated/**/*.py linguist-generated=true +cpp/src/generated/*.h linguist-generated=true From 7800393164022f32a3d72e5c60dc939eee8f7eb2 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 15:50:13 -0400 Subject: [PATCH 34/96] Fix generated C++ code after setting root type for InlineBuffer --- cpp/src/generated/InlineBuffer_generated.h | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cpp/src/generated/InlineBuffer_generated.h b/cpp/src/generated/InlineBuffer_generated.h index ad7da86aad674..d35e5518f084f 100644 --- a/cpp/src/generated/InlineBuffer_generated.h +++ b/cpp/src/generated/InlineBuffer_generated.h @@ -948,6 +948,36 @@ inline bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const return true; } +inline const org::apache::arrow::computeir::flatbuf::InlineBuffer *GetInlineBuffer(const void *buf) { + return flatbuffers::GetRoot(buf); +} + +inline const org::apache::arrow::computeir::flatbuf::InlineBuffer *GetSizePrefixedInlineBuffer(const void *buf) { + return flatbuffers::GetSizePrefixedRoot(buf); +} + +inline bool VerifyInlineBufferBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +} + +inline bool VerifySizePrefixedInlineBufferBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifySizePrefixedBuffer(nullptr); +} + +inline void FinishInlineBufferBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.Finish(root); +} + +inline void FinishSizePrefixedInlineBufferBuffer( + flatbuffers::FlatBufferBuilder &fbb, + flatbuffers::Offset root) { + fbb.FinishSizePrefixed(root); +} + } // namespace flatbuf } // namespace computeir } // namespace arrow From 5fc1e89f74239b139fed39d79d33e291cc25bc42 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 17:45:33 -0400 Subject: [PATCH 35/96] Remove generated code until review is done --- python/generated/org/__init__.py | 0 python/generated/org/apache/__init__.py | 0 python/generated/org/apache/arrow/__init__.py | 0 .../org/apache/arrow/computeir/__init__.py | 0 .../arrow/computeir/flatbuf/Aggregate.py | 94 ------------ .../arrow/computeir/flatbuf/AggregateCall.py | 113 --------------- .../arrow/computeir/flatbuf/AggregateImpl.py | 9 -- .../arrow/computeir/flatbuf/ArrayLiteral.py | 51 ------- .../arrow/computeir/flatbuf/ArraySlice.py | 43 ------ .../arrow/computeir/flatbuf/ArraySubscript.py | 33 ----- .../arrow/computeir/flatbuf/BinaryLiteral.py | 53 ------- .../arrow/computeir/flatbuf/BooleanLiteral.py | 32 ----- .../apache/arrow/computeir/flatbuf/Bound.py | 44 ------ .../arrow/computeir/flatbuf/BoundImpl.py | 10 -- .../apache/arrow/computeir/flatbuf/Call.py | 87 ----------- .../computeir/flatbuf/CanonicalAggregate.py | 32 ----- .../computeir/flatbuf/CanonicalAggregateId.py | 18 --- .../computeir/flatbuf/CanonicalFunction.py | 32 ----- .../computeir/flatbuf/CanonicalFunctionId.py | 33 ----- .../computeir/flatbuf/CanonicalJoinKind.py | 32 ----- .../computeir/flatbuf/CanonicalJoinKindId.py | 13 -- .../computeir/flatbuf/CanonicalSetOpKind.py | 32 ----- .../computeir/flatbuf/CanonicalSetOpKindId.py | 10 -- .../apache/arrow/computeir/flatbuf/Case.py | 82 ----------- .../arrow/computeir/flatbuf/CaseFragment.py | 49 ------- .../apache/arrow/computeir/flatbuf/Cast.py | 64 --------- .../apache/arrow/computeir/flatbuf/Common.py | 48 ------- .../computeir/flatbuf/ConcreteBoundImpl.py | 9 -- .../arrow/computeir/flatbuf/CurrentRow.py | 25 ---- .../apache/arrow/computeir/flatbuf/Custom.py | 51 ------- .../arrow/computeir/flatbuf/DateLiteral.py | 32 ----- .../arrow/computeir/flatbuf/DecimalLiteral.py | 69 --------- .../apache/arrow/computeir/flatbuf/Deref.py | 18 --- .../apache/arrow/computeir/flatbuf/Emit.py | 10 -- .../arrow/computeir/flatbuf/Expression.py | 68 --------- .../arrow/computeir/flatbuf/ExpressionImpl.py | 34 ----- .../apache/arrow/computeir/flatbuf/Extract.py | 60 -------- .../arrow/computeir/flatbuf/FieldName.py | 33 ----- .../arrow/computeir/flatbuf/FieldRef.py | 57 -------- .../apache/arrow/computeir/flatbuf/Filter.py | 52 ------- .../arrow/computeir/flatbuf/Float16Literal.py | 32 ----- .../arrow/computeir/flatbuf/Float32Buffer.py | 53 ------- .../arrow/computeir/flatbuf/Float32Literal.py | 32 ----- .../arrow/computeir/flatbuf/Float64Buffer.py | 53 ------- .../arrow/computeir/flatbuf/Float64Literal.py | 32 ----- .../arrow/computeir/flatbuf/Following.py | 44 ------ .../apache/arrow/computeir/flatbuf/Frame.py | 9 -- .../arrow/computeir/flatbuf/FunctionImpl.py | 9 -- .../arrow/computeir/flatbuf/InlineBuffer.py | 49 ------- .../computeir/flatbuf/InlineBufferImpl.py | 18 --- .../arrow/computeir/flatbuf/Int16Buffer.py | 53 ------- .../arrow/computeir/flatbuf/Int16Literal.py | 32 ----- .../arrow/computeir/flatbuf/Int32Buffer.py | 53 ------- .../arrow/computeir/flatbuf/Int32Literal.py | 32 ----- .../arrow/computeir/flatbuf/Int64Buffer.py | 53 ------- .../arrow/computeir/flatbuf/Int64Literal.py | 32 ----- .../arrow/computeir/flatbuf/Int8Buffer.py | 53 ------- .../arrow/computeir/flatbuf/Int8Literal.py | 32 ----- .../computeir/flatbuf/IntervalLiteral.py | 43 ------ .../IntervalLiteralDaysMilliseconds.py | 40 ------ .../computeir/flatbuf/IntervalLiteralImpl.py | 9 -- .../flatbuf/IntervalLiteralMonths.py | 32 ----- .../apache/arrow/computeir/flatbuf/Join.py | 73 ---------- .../arrow/computeir/flatbuf/JoinKind.py | 9 -- .../arrow/computeir/flatbuf/KeyValue.py | 44 ------ .../apache/arrow/computeir/flatbuf/Limit.py | 46 ------ .../apache/arrow/computeir/flatbuf/Literal.py | 43 ------ .../arrow/computeir/flatbuf/LiteralImpl.py | 30 ---- .../computeir/flatbuf/LiteralRelation.py | 65 --------- .../apache/arrow/computeir/flatbuf/MapKey.py | 33 ----- .../arrow/computeir/flatbuf/MapLiteral.py | 51 ------- .../flatbuf/NonCanonicalAggregate.py | 40 ------ .../computeir/flatbuf/NonCanonicalFunction.py | 40 ------ .../computeir/flatbuf/NonCanonicalJoinKind.py | 40 ------ .../flatbuf/NonCanonicalSetOpKind.py | 40 ------ .../arrow/computeir/flatbuf/NullLiteral.py | 24 ---- .../apache/arrow/computeir/flatbuf/OrderBy.py | 66 --------- .../arrow/computeir/flatbuf/Ordering.py | 12 -- .../arrow/computeir/flatbuf/PassThrough.py | 24 ---- .../apache/arrow/computeir/flatbuf/Plan.py | 68 --------- .../arrow/computeir/flatbuf/Preceding.py | 44 ------ .../apache/arrow/computeir/flatbuf/Project.py | 66 --------- .../apache/arrow/computeir/flatbuf/Read.py | 57 -------- .../apache/arrow/computeir/flatbuf/RelBase.py | 86 ----------- .../arrow/computeir/flatbuf/Relation.py | 44 ------ .../arrow/computeir/flatbuf/RelationImpl.py | 19 --- .../apache/arrow/computeir/flatbuf/Remap.py | 60 -------- .../arrow/computeir/flatbuf/SetOpKind.py | 10 -- .../arrow/computeir/flatbuf/SetOperation.py | 57 -------- .../apache/arrow/computeir/flatbuf/SortKey.py | 45 ------ .../arrow/computeir/flatbuf/StringLiteral.py | 32 ----- .../arrow/computeir/flatbuf/StructField.py | 34 ----- .../arrow/computeir/flatbuf/StructLiteral.py | 51 ------- .../arrow/computeir/flatbuf/TableBuffer.py | 53 ------- .../arrow/computeir/flatbuf/TimeLiteral.py | 32 ----- .../computeir/flatbuf/TimestampLiteral.py | 40 ------ .../arrow/computeir/flatbuf/UInt16Buffer.py | 53 ------- .../arrow/computeir/flatbuf/UInt16Literal.py | 32 ----- .../arrow/computeir/flatbuf/UInt32Buffer.py | 53 ------- .../arrow/computeir/flatbuf/UInt32Literal.py | 32 ----- .../arrow/computeir/flatbuf/UInt64Buffer.py | 53 ------- .../arrow/computeir/flatbuf/UInt64Literal.py | 32 ----- .../arrow/computeir/flatbuf/UInt8Buffer.py | 53 ------- .../arrow/computeir/flatbuf/UInt8Literal.py | 32 ----- .../arrow/computeir/flatbuf/Unbounded.py | 25 ---- .../arrow/computeir/flatbuf/WindowCall.py | 129 ----------------- .../apache/arrow/computeir/flatbuf/Write.py | 57 -------- .../arrow/computeir/flatbuf/__init__.py | 0 .../ext/Arrow_FileSystemDatasetScanOptions.py | 70 --------- .../Arrow_FileSystemDatasetWriteOptions.py | 81 ----------- .../flatbuf/ext/Arrow_StreamOutOptions.py | 42 ------ .../arrow/computeir/flatbuf/ext/FileFormat.py | 45 ------ .../computeir/flatbuf/ext/Partitioning.py | 46 ------ .../computeir/flatbuf/ext/Sql_FromOptions.py | 38 ----- .../computeir/flatbuf/ext/Sql_IntoOptions.py | 50 ------- .../apache/arrow/computeir/flatbuf/ext/Uri.py | 100 ------------- .../arrow/computeir/flatbuf/ext/__init__.py | 0 .../org/apache/arrow/flatbuf/Binary.py | 25 ---- .../org/apache/arrow/flatbuf/Bool.py | 24 ---- .../org/apache/arrow/flatbuf/Buffer.py | 34 ----- .../org/apache/arrow/flatbuf/Date.py | 38 ----- .../org/apache/arrow/flatbuf/DateUnit.py | 8 -- .../org/apache/arrow/flatbuf/Decimal.py | 56 -------- .../arrow/flatbuf/DictionaryEncoding.py | 72 ---------- .../apache/arrow/flatbuf/DictionaryKind.py | 12 -- .../org/apache/arrow/flatbuf/Duration.py | 32 ----- .../org/apache/arrow/flatbuf/Endianness.py | 10 -- .../org/apache/arrow/flatbuf/Feature.py | 32 ----- .../org/apache/arrow/flatbuf/Field.py | 135 ------------------ .../apache/arrow/flatbuf/FixedSizeBinary.py | 33 ----- .../org/apache/arrow/flatbuf/FixedSizeList.py | 33 ----- .../org/apache/arrow/flatbuf/FloatingPoint.py | 32 ----- .../generated/org/apache/arrow/flatbuf/Int.py | 40 ------ .../org/apache/arrow/flatbuf/Interval.py | 32 ----- .../org/apache/arrow/flatbuf/IntervalUnit.py | 8 -- .../org/apache/arrow/flatbuf/KeyValue.py | 43 ------ .../org/apache/arrow/flatbuf/LargeBinary.py | 26 ---- .../org/apache/arrow/flatbuf/LargeList.py | 26 ---- .../org/apache/arrow/flatbuf/LargeUtf8.py | 26 ---- .../org/apache/arrow/flatbuf/List.py | 24 ---- .../generated/org/apache/arrow/flatbuf/Map.py | 58 -------- .../apache/arrow/flatbuf/MetadataVersion.py | 22 --- .../org/apache/arrow/flatbuf/Null.py | 25 ---- .../org/apache/arrow/flatbuf/Precision.py | 9 -- .../org/apache/arrow/flatbuf/Schema.py | 121 ---------------- .../org/apache/arrow/flatbuf/Struct_.py | 27 ---- .../org/apache/arrow/flatbuf/Time.py | 43 ------ .../org/apache/arrow/flatbuf/TimeUnit.py | 10 -- .../org/apache/arrow/flatbuf/Timestamp.py | 89 ------------ .../org/apache/arrow/flatbuf/Type.py | 31 ---- .../org/apache/arrow/flatbuf/Union.py | 65 --------- .../org/apache/arrow/flatbuf/UnionMode.py | 8 -- .../org/apache/arrow/flatbuf/Utf8.py | 25 ---- .../org/apache/arrow/flatbuf/__init__.py | 0 154 files changed, 6162 deletions(-) delete mode 100644 python/generated/org/__init__.py delete mode 100644 python/generated/org/apache/__init__.py delete mode 100644 python/generated/org/apache/arrow/__init__.py delete mode 100644 python/generated/org/apache/arrow/computeir/__init__.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Bound.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Call.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Case.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Cast.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Common.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Custom.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Deref.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Emit.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Expression.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Extract.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Filter.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Following.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Frame.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Join.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Limit.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Plan.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Project.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Read.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Relation.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Remap.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/StructField.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/Write.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/__init__.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py delete mode 100644 python/generated/org/apache/arrow/computeir/flatbuf/ext/__init__.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Binary.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Bool.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Buffer.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Date.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/DateUnit.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Decimal.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/DictionaryKind.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Duration.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Endianness.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Feature.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Field.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/FixedSizeList.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/FloatingPoint.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Int.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Interval.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/IntervalUnit.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/KeyValue.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/LargeBinary.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/LargeList.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/LargeUtf8.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/List.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Map.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/MetadataVersion.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Null.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Precision.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Schema.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Struct_.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Time.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/TimeUnit.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Timestamp.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Type.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Union.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/UnionMode.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/Utf8.py delete mode 100644 python/generated/org/apache/arrow/flatbuf/__init__.py diff --git a/python/generated/org/__init__.py b/python/generated/org/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/python/generated/org/apache/__init__.py b/python/generated/org/apache/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/python/generated/org/apache/arrow/__init__.py b/python/generated/org/apache/arrow/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/python/generated/org/apache/arrow/computeir/__init__.py b/python/generated/org/apache/arrow/computeir/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py b/python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py deleted file mode 100644 index 5f77ab6789c02..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Aggregate.py +++ /dev/null @@ -1,94 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Aggregate operation -class Aggregate(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsAggregate(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Aggregate() - x.Init(buf, n + offset) - return x - - # Aggregate - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Aggregate - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Expressions which will be evaluated to produce to - # the rows of the aggregate relation's output. - # Aggregate - def Aggregations(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Aggregate - def AggregationsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Aggregate - def AggregationsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - return o == 0 - - # Keys by which `aggregations` will be grouped. - # Aggregate - def Keys(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Aggregate - def KeysLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Aggregate - def KeysIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - return o == 0 - -def AggregateStart(builder): builder.StartObject(3) -def AggregateAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def AggregateAddAggregations(builder, aggregations): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(aggregations), 0) -def AggregateStartAggregationsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def AggregateAddKeys(builder, keys): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(keys), 0) -def AggregateStartKeysVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def AggregateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py b/python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py deleted file mode 100644 index 7f47765bce4a5..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/AggregateCall.py +++ /dev/null @@ -1,113 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class AggregateCall(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsAggregateCall(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = AggregateCall() - x.Init(buf, n + offset) - return x - - # AggregateCall - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # AggregateCall - def KindType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # The kind of aggregate function being executed - # AggregateCall - def Kind(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - - # Aggregate expression arguments - # AggregateCall - def Arguments(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # AggregateCall - def ArgumentsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # AggregateCall - def ArgumentsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - return o == 0 - - # Possible ordering. - # AggregateCall - def Orderings(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.SortKey import SortKey - obj = SortKey() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # AggregateCall - def OrderingsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # AggregateCall - def OrderingsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - return o == 0 - - # optional per-aggregate filtering - # AggregateCall - def Predicate(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def AggregateCallStart(builder): builder.StartObject(5) -def AggregateCallAddKindType(builder, kindType): builder.PrependUint8Slot(0, kindType, 0) -def AggregateCallAddKind(builder, kind): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(kind), 0) -def AggregateCallAddArguments(builder, arguments): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(arguments), 0) -def AggregateCallStartArgumentsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def AggregateCallAddOrderings(builder, orderings): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(orderings), 0) -def AggregateCallStartOrderingsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def AggregateCallAddPredicate(builder, predicate): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(predicate), 0) -def AggregateCallEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py deleted file mode 100644 index 87220fa083080..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/AggregateImpl.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class AggregateImpl(object): - NONE = 0 - CanonicalAggregate = 1 - NonCanonicalAggregate = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py deleted file mode 100644 index d7a25e949b04a..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ArrayLiteral.py +++ /dev/null @@ -1,51 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class ArrayLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsArrayLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = ArrayLiteral() - x.Init(buf, n + offset) - return x - - # ArrayLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # ArrayLiteral - def Values(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Literal import Literal - obj = Literal() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # ArrayLiteral - def ValuesLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # ArrayLiteral - def ValuesIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def ArrayLiteralStart(builder): builder.StartObject(1) -def ArrayLiteralAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0) -def ArrayLiteralStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def ArrayLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py b/python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py deleted file mode 100644 index 95a0a03fdeec5..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ArraySlice.py +++ /dev/null @@ -1,43 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Zero-based range of elements in an array -class ArraySlice(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsArraySlice(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = ArraySlice() - x.Init(buf, n + offset) - return x - - # ArraySlice - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The start of an array slice, inclusive - # ArraySlice - def StartInclusive(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - - # The end of an array slice, exclusive - # ArraySlice - def EndExclusive(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - -def ArraySliceStart(builder): builder.StartObject(2) -def ArraySliceAddStartInclusive(builder, startInclusive): builder.PrependUint32Slot(0, startInclusive, 0) -def ArraySliceAddEndExclusive(builder, endExclusive): builder.PrependUint32Slot(1, endExclusive, 0) -def ArraySliceEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py b/python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py deleted file mode 100644 index 7fff316fbdb77..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ArraySubscript.py +++ /dev/null @@ -1,33 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Zero-based array index -class ArraySubscript(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsArraySubscript(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = ArraySubscript() - x.Init(buf, n + offset) - return x - - # ArraySubscript - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # ArraySubscript - def Position(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - -def ArraySubscriptStart(builder): builder.StartObject(1) -def ArraySubscriptAddPosition(builder, position): builder.PrependUint32Slot(0, position, 0) -def ArraySubscriptEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py deleted file mode 100644 index 223892d3931fc..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/BinaryLiteral.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class BinaryLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsBinaryLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = BinaryLiteral() - x.Init(buf, n + offset) - return x - - # BinaryLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # BinaryLiteral - def Value(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Int8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) - return 0 - - # BinaryLiteral - def ValueAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int8Flags, o) - return 0 - - # BinaryLiteral - def ValueLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # BinaryLiteral - def ValueIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def BinaryLiteralStart(builder): builder.StartObject(1) -def BinaryLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) -def BinaryLiteralStartValueVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def BinaryLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py deleted file mode 100644 index 4c71170ece1e7..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/BooleanLiteral.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class BooleanLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsBooleanLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = BooleanLiteral() - x.Init(buf, n + offset) - return x - - # BooleanLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # BooleanLiteral - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) - return False - -def BooleanLiteralStart(builder): builder.StartObject(1) -def BooleanLiteralAddValue(builder, value): builder.PrependBoolSlot(0, value, 0) -def BooleanLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Bound.py b/python/generated/org/apache/arrow/computeir/flatbuf/Bound.py deleted file mode 100644 index 98998a3035161..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Bound.py +++ /dev/null @@ -1,44 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Boundary of a window -class Bound(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsBound(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Bound() - x.Init(buf, n + offset) - return x - - # Bound - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Bound - def ImplType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # Bound - def Impl(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def BoundStart(builder): builder.StartObject(2) -def BoundAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) -def BoundAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) -def BoundEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py deleted file mode 100644 index c21209961c551..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/BoundImpl.py +++ /dev/null @@ -1,10 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class BoundImpl(object): - NONE = 0 - Preceding = 1 - Following = 2 - CurrentRow = 3 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Call.py b/python/generated/org/apache/arrow/computeir/flatbuf/Call.py deleted file mode 100644 index 00bbff28c9912..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Call.py +++ /dev/null @@ -1,87 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A function call expression -class Call(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCall(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Call() - x.Init(buf, n + offset) - return x - - # Call - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Call - def KindType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # The kind of function call this is. - # Call - def Kind(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - - # The arguments passed to `function_name`. - # Call - def Arguments(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Call - def ArgumentsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Call - def ArgumentsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - return o == 0 - - # Parameters for `function_name`; content/format may be unique to each - # value of `function_name`. - # Call - def Metadata(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer - obj = InlineBuffer() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def CallStart(builder): builder.StartObject(4) -def CallAddKindType(builder, kindType): builder.PrependUint8Slot(0, kindType, 0) -def CallAddKind(builder, kind): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(kind), 0) -def CallAddArguments(builder, arguments): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(arguments), 0) -def CallStartArgumentsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def CallAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) -def CallEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py deleted file mode 100644 index b1470a6e569bc..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregate.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class CanonicalAggregate(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCanonicalAggregate(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = CanonicalAggregate() - x.Init(buf, n + offset) - return x - - # CanonicalAggregate - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # CanonicalAggregate - def Id(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - -def CanonicalAggregateStart(builder): builder.StartObject(1) -def CanonicalAggregateAddId(builder, id): builder.PrependUint32Slot(0, id, 0) -def CanonicalAggregateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py deleted file mode 100644 index c0ff31c5db288..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalAggregateId.py +++ /dev/null @@ -1,18 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# A canonical (probably SQL equivalent) function -class CanonicalAggregateId(object): - All = 0 - Any = 1 - Count = 2 - CountTable = 3 - Mean = 4 - Min = 5 - Max = 6 - Product = 7 - Sum = 8 - Variance = 9 - StandardDev = 10 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py deleted file mode 100644 index 8f6b4ccae8609..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunction.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class CanonicalFunction(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCanonicalFunction(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = CanonicalFunction() - x.Init(buf, n + offset) - return x - - # CanonicalFunction - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # CanonicalFunction - def Id(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - -def CanonicalFunctionStart(builder): builder.StartObject(1) -def CanonicalFunctionAddId(builder, id): builder.PrependUint32Slot(0, id, 0) -def CanonicalFunctionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py deleted file mode 100644 index 6c630f37980cd..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalFunctionId.py +++ /dev/null @@ -1,33 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# A canonical (probably SQL equivalent) function -class CanonicalFunctionId(object): - And = 0 - Not = 1 - Or = 2 - Add = 3 - Subtract = 4 - Multiply = 5 - Divide = 6 - Power = 7 - AbsoluteValue = 8 - Negate = 9 - Sign = 10 - DateSub = 11 - DateAdd = 12 - DateDiff = 13 - TimeAdd = 14 - TimeSub = 15 - TimeDiff = 16 - TimestampAdd = 17 - TimestampSub = 18 - TimestampDiff = 19 - Equals = 20 - NotEquals = 21 - Greater = 22 - GreaterEqual = 23 - Less = 24 - LessEqual = 25 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py deleted file mode 100644 index fa44dbe9c2a60..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKind.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class CanonicalJoinKind(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCanonicalJoinKind(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = CanonicalJoinKind() - x.Init(buf, n + offset) - return x - - # CanonicalJoinKind - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # CanonicalJoinKind - def Id(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - -def CanonicalJoinKindStart(builder): builder.StartObject(1) -def CanonicalJoinKindAddId(builder, id): builder.PrependUint8Slot(0, id, 0) -def CanonicalJoinKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py deleted file mode 100644 index 7bf1d2b180d48..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalJoinKindId.py +++ /dev/null @@ -1,13 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class CanonicalJoinKindId(object): - Anti = 0 - Cross = 1 - FullOuter = 2 - Inner = 3 - LeftOuter = 4 - LeftSemi = 5 - RightOuter = 6 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py deleted file mode 100644 index da99170a8e9b1..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKind.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class CanonicalSetOpKind(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCanonicalSetOpKind(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = CanonicalSetOpKind() - x.Init(buf, n + offset) - return x - - # CanonicalSetOpKind - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # CanonicalSetOpKind - def Id(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - -def CanonicalSetOpKindStart(builder): builder.StartObject(1) -def CanonicalSetOpKindAddId(builder, id): builder.PrependUint8Slot(0, id, 0) -def CanonicalSetOpKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py b/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py deleted file mode 100644 index ebd3cba562492..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CanonicalSetOpKindId.py +++ /dev/null @@ -1,10 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# The kind of set operation being performed. -class CanonicalSetOpKindId(object): - Union = 0 - Intersection = 1 - Difference = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Case.py b/python/generated/org/apache/arrow/computeir/flatbuf/Case.py deleted file mode 100644 index bcf258c2115bf..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Case.py +++ /dev/null @@ -1,82 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Case statement-style expression. -class Case(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCase(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Case() - x.Init(buf, n + offset) - return x - - # Case - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Case - def Cases(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.CaseFragment import CaseFragment - obj = CaseFragment() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Case - def CasesLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Case - def CasesIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - - # The default value if no cases match. This is typically NULL in SQL - # - # Defaulting to NULL is a frontend choice, so producers must specify NULL - # if that's their desired behavior. - # Case - def Default(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Parameters for `function_name`; content/format may be unique to each - # value of `function_name`. - # Case - def Metadata(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer - obj = InlineBuffer() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def CaseStart(builder): builder.StartObject(3) -def CaseAddCases(builder, cases): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(cases), 0) -def CaseStartCasesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def CaseAddDefault(builder, default): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(default), 0) -def CaseAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) -def CaseEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py b/python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py deleted file mode 100644 index 346e6ac08cdde..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CaseFragment.py +++ /dev/null @@ -1,49 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A single WHEN x THEN y fragment. -class CaseFragment(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCaseFragment(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = CaseFragment() - x.Init(buf, n + offset) - return x - - # CaseFragment - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # CaseFragment - def When(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # CaseFragment - def Then(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def CaseFragmentStart(builder): builder.StartObject(2) -def CaseFragmentAddWhen(builder, when): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(when), 0) -def CaseFragmentAddThen(builder, then): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(then), 0) -def CaseFragmentEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Cast.py b/python/generated/org/apache/arrow/computeir/flatbuf/Cast.py deleted file mode 100644 index 2d744878ce096..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Cast.py +++ /dev/null @@ -1,64 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Cast(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCast(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Cast() - x.Init(buf, n + offset) - return x - - # Cast - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The expression to cast - # Cast - def Expression(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # The type to cast `argument` to. - # Cast - def Type(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.Field import Field - obj = Field() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Parameters for `function_name`; content/format may be unique to each - # value of `function_name`. - # Cast - def Metadata(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer - obj = InlineBuffer() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def CastStart(builder): builder.StartObject(3) -def CastAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) -def CastAddType(builder, type): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(type), 0) -def CastAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) -def CastEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Common.py b/python/generated/org/apache/arrow/computeir/flatbuf/Common.py deleted file mode 100644 index 3ece357762008..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Common.py +++ /dev/null @@ -1,48 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Common table expresssion -class Common(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCommon(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Common() - x.Init(buf, n + offset) - return x - - # Common - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Common - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Commons (CTEs in SQL) allow assigning a name to a stream - # of data and reusing it, potentially multiple times and - # potentially recursively. - # Common - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def CommonStart(builder): builder.StartObject(2) -def CommonAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def CommonAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def CommonEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py deleted file mode 100644 index f551b0e070787..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ConcreteBoundImpl.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class ConcreteBoundImpl(object): - NONE = 0 - Expression = 1 - Unbounded = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py b/python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py deleted file mode 100644 index 999c88c1f0e46..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/CurrentRow.py +++ /dev/null @@ -1,25 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Boundary is the current row -class CurrentRow(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCurrentRow(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = CurrentRow() - x.Init(buf, n + offset) - return x - - # CurrentRow - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def CurrentRowStart(builder): builder.StartObject(0) -def CurrentRowEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Custom.py b/python/generated/org/apache/arrow/computeir/flatbuf/Custom.py deleted file mode 100644 index 377dd6e3d5224..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Custom.py +++ /dev/null @@ -1,51 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A user-defined relation. -class Custom(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsCustom(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Custom() - x.Init(buf, n + offset) - return x - - # Custom - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Custom - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # NB: the schema is optional here, since a custom relation - # may or may not need it. - # Custom - def Schema(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.Schema import Schema - obj = Schema() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def CustomStart(builder): builder.StartObject(2) -def CustomAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def CustomAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) -def CustomEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py deleted file mode 100644 index c82060aaadddf..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/DateLiteral.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class DateLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsDateLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = DateLiteral() - x.Init(buf, n + offset) - return x - - # DateLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # DateLiteral - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) - return 0 - -def DateLiteralStart(builder): builder.StartObject(1) -def DateLiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) -def DateLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py deleted file mode 100644 index 1cfda7e418751..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/DecimalLiteral.py +++ /dev/null @@ -1,69 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class DecimalLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsDecimalLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = DecimalLiteral() - x.Init(buf, n + offset) - return x - - # DecimalLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # DecimalLiteral - def Value(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) - return 0 - - # DecimalLiteral - def ValueAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) - return 0 - - # DecimalLiteral - def ValueLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # DecimalLiteral - def ValueIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - - # DecimalLiteral - def Scale(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # DecimalLiteral - def Precision(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - -def DecimalLiteralStart(builder): builder.StartObject(3) -def DecimalLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) -def DecimalLiteralStartValueVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def DecimalLiteralAddScale(builder, scale): builder.PrependUint8Slot(1, scale, 0) -def DecimalLiteralAddPrecision(builder, precision): builder.PrependUint8Slot(2, precision, 0) -def DecimalLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Deref.py b/python/generated/org/apache/arrow/computeir/flatbuf/Deref.py deleted file mode 100644 index 45cabb1f2e5b8..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Deref.py +++ /dev/null @@ -1,18 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# A union of possible dereference operations -class Deref(object): - NONE = 0 - # Access a value for a given map key - MapKey = 1 - # Access the value at a struct field - StructField = 2 - # Access the element at a given index in an array - ArraySubscript = 3 - # Access a range of elements in an array - ArraySlice = 4 - # Access a field of a relation - FieldName = 5 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Emit.py b/python/generated/org/apache/arrow/computeir/flatbuf/Emit.py deleted file mode 100644 index 99a317d26f1a1..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Emit.py +++ /dev/null @@ -1,10 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# A union for the different colum remapping variants -class Emit(object): - NONE = 0 - Remap = 1 - PassThrough = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Expression.py b/python/generated/org/apache/arrow/computeir/flatbuf/Expression.py deleted file mode 100644 index b1e494b3ef571..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Expression.py +++ /dev/null @@ -1,68 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Expression types -# -# Expressions have a concrete `impl` value, which is a specific operation -# They also have a `type` field, which is the output type of the expression, -# regardless of operation type. -# -# The only exception so far is Cast, which has a type as input argument, which -# is equal to output type. -class Expression(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsExpression(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Expression() - x.Init(buf, n + offset) - return x - - # Expression - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Expression - def ImplType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # Expression - def Impl(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - - # The type of the expression. - # - # This is a field, because the Type union in Schema.fbs - # isn't self-contained: Fields are necessary to describe complex types - # and there's currently no reason to optimize the storage of this. - # Expression - def Type(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.Field import Field - obj = Field() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def ExpressionStart(builder): builder.StartObject(3) -def ExpressionAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) -def ExpressionAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) -def ExpressionAddType(builder, type): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(type), 0) -def ExpressionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py deleted file mode 100644 index c5e0cfaabe1b3..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ExpressionImpl.py +++ /dev/null @@ -1,34 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# An expression is one of -# - a Literal datum -# - a reference to a field from a Relation -# - a call to a named function -# - a case expression -# - a cast expression -# - an extract operation -# - a window function call -# - an aggregate function call -# -# The expressions here that look like function calls such as -# Cast,Case and Extract are special in that while they might -# fit into a Call, they don't cleanly do so without having -# to pass around non-expression arguments as metadata. -# -# AggregateCall and WindowCall are also separate variants -# due to special options for each that don't apply to generic -# function calls. Again this is done to make it easier -# for consumers to deal with the structure of the operation -class ExpressionImpl(object): - NONE = 0 - Literal = 1 - FieldRef = 2 - Call = 3 - Case = 4 - Cast = 5 - Extract = 6 - WindowCall = 7 - AggregateCall = 8 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Extract.py b/python/generated/org/apache/arrow/computeir/flatbuf/Extract.py deleted file mode 100644 index e69d7799c9b55..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Extract.py +++ /dev/null @@ -1,60 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Extract(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsExtract(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Extract() - x.Init(buf, n + offset) - return x - - # Extract - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Expression from which to extract components. - # Extract - def Expression(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Field to extract from `expression`. - # Extract - def Field(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Parameters for `function_name`; content/format may be unique to each - # value of `function_name`. - # Extract - def Metadata(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer - obj = InlineBuffer() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def ExtractStart(builder): builder.StartObject(3) -def ExtractAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) -def ExtractAddField(builder, field): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(field), 0) -def ExtractAddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0) -def ExtractEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py b/python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py deleted file mode 100644 index e84fa725753cf..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/FieldName.py +++ /dev/null @@ -1,33 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Field name in a relation -class FieldName(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFieldName(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = FieldName() - x.Init(buf, n + offset) - return x - - # FieldName - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # FieldName - def Position(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - -def FieldNameStart(builder): builder.StartObject(1) -def FieldNameAddPosition(builder, position): builder.PrependUint32Slot(0, position, 0) -def FieldNameEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py b/python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py deleted file mode 100644 index 8fed63c7fc2c8..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/FieldRef.py +++ /dev/null @@ -1,57 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Access the data of a field -class FieldRef(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFieldRef(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = FieldRef() - x.Init(buf, n + offset) - return x - - # FieldRef - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # FieldRef - def RefType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # A sequence of field names to allow referencing potentially nested fields - # FieldRef - def Ref(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - - # For Expressions which might reference fields in multiple Relations, - # this index may be provided to indicate which Relation's fields - # `path` points into. For example in the case of a join, - # 0 refers to the left relation and 1 to the right relation. - # FieldRef - def RelationIndex(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - -def FieldRefStart(builder): builder.StartObject(3) -def FieldRefAddRefType(builder, refType): builder.PrependUint8Slot(0, refType, 0) -def FieldRefAddRef(builder, ref): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(ref), 0) -def FieldRefAddRelationIndex(builder, relationIndex): builder.PrependInt32Slot(2, relationIndex, 0) -def FieldRefEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Filter.py b/python/generated/org/apache/arrow/computeir/flatbuf/Filter.py deleted file mode 100644 index 684c7410a841f..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Filter.py +++ /dev/null @@ -1,52 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Filter operation -class Filter(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFilter(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Filter() - x.Init(buf, n + offset) - return x - - # Filter - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Filter - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # The expression which will be evaluated against input rows - # to determine whether they should be excluded from the - # filter relation's output. - # Filter - def Predicate(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def FilterStart(builder): builder.StartObject(2) -def FilterAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def FilterAddPredicate(builder, predicate): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(predicate), 0) -def FilterEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py deleted file mode 100644 index 322ea32384446..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Float16Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Float16Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFloat16Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Float16Literal() - x.Init(buf, n + offset) - return x - - # Float16Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Float16Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) - return 0 - -def Float16LiteralStart(builder): builder.StartObject(1) -def Float16LiteralAddValue(builder, value): builder.PrependUint16Slot(0, value, 0) -def Float16LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py deleted file mode 100644 index c92037b153f2e..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Float32Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Float32Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFloat32Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Float32Buffer() - x.Init(buf, n + offset) - return x - - # Float32Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Float32Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) - return 0 - - # Float32Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o) - return 0 - - # Float32Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Float32Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def Float32BufferStart(builder): builder.StartObject(1) -def Float32BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def Float32BufferStartItemsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def Float32BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py deleted file mode 100644 index 1a4034bc80aa6..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Float32Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Float32Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFloat32Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Float32Literal() - x.Init(buf, n + offset) - return x - - # Float32Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Float32Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) - return 0.0 - -def Float32LiteralStart(builder): builder.StartObject(1) -def Float32LiteralAddValue(builder, value): builder.PrependFloat32Slot(0, value, 0.0) -def Float32LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py deleted file mode 100644 index 68499e6ab2bbe..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Float64Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Float64Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFloat64Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Float64Buffer() - x.Init(buf, n + offset) - return x - - # Float64Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Float64Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) - return 0 - - # Float64Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o) - return 0 - - # Float64Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Float64Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def Float64BufferStart(builder): builder.StartObject(1) -def Float64BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def Float64BufferStartItemsVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def Float64BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py deleted file mode 100644 index ccf161492dd53..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Float64Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Float64Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFloat64Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Float64Literal() - x.Init(buf, n + offset) - return x - - # Float64Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Float64Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos) - return 0.0 - -def Float64LiteralStart(builder): builder.StartObject(1) -def Float64LiteralAddValue(builder, value): builder.PrependFloat64Slot(0, value, 0.0) -def Float64LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Following.py b/python/generated/org/apache/arrow/computeir/flatbuf/Following.py deleted file mode 100644 index ae92ab2ce8818..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Following.py +++ /dev/null @@ -1,44 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Boundary is following rows, determined by the contained expression -class Following(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFollowing(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Following() - x.Init(buf, n + offset) - return x - - # Following - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Following - def ImplType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # Following - def Impl(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def FollowingStart(builder): builder.StartObject(2) -def FollowingAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) -def FollowingAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) -def FollowingEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Frame.py b/python/generated/org/apache/arrow/computeir/flatbuf/Frame.py deleted file mode 100644 index 63de4cd8a672c..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Frame.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# The kind of window function to be executed. -class Frame(object): - Rows = 0 - Range = 1 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py deleted file mode 100644 index a467694bab388..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/FunctionImpl.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class FunctionImpl(object): - NONE = 0 - CanonicalFunction = 1 - NonCanonicalFunction = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py deleted file mode 100644 index da4561e9d7458..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/InlineBuffer.py +++ /dev/null @@ -1,49 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# An inline replacement for org.apache.arrow.Buffer because that -# requires a sidecar block of bytes into which offsets can point. -# A union of buffers of each primitive type is provided to avoid -# the need for reinterpret_cast, std::mem::transmute, ... -# The final member of the union is a bytes buffer aligned suitably -# to hold any flatbuffer Table. -class InlineBuffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInlineBuffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = InlineBuffer() - x.Init(buf, n + offset) - return x - - # InlineBuffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # InlineBuffer - def ImplType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # InlineBuffer - def Impl(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def InlineBufferStart(builder): builder.StartObject(2) -def InlineBufferAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) -def InlineBufferAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) -def InlineBufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py deleted file mode 100644 index b420fb5fa82cf..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/InlineBufferImpl.py +++ /dev/null @@ -1,18 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class InlineBufferImpl(object): - NONE = 0 - Int8Buffer = 1 - Int16Buffer = 2 - Int32Buffer = 3 - Int64Buffer = 4 - UInt8Buffer = 5 - UInt16Buffer = 6 - UInt32Buffer = 7 - UInt64Buffer = 8 - Float32Buffer = 9 - Float64Buffer = 10 - TableBuffer = 11 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py deleted file mode 100644 index 04e97cd2a0cbf..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int16Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int16Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt16Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int16Buffer() - x.Init(buf, n + offset) - return x - - # Int16Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int16Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2)) - return 0 - - # Int16Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint16Flags, o) - return 0 - - # Int16Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Int16Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def Int16BufferStart(builder): builder.StartObject(1) -def Int16BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def Int16BufferStartItemsVector(builder, numElems): return builder.StartVector(2, numElems, 2) -def Int16BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py deleted file mode 100644 index a03cf7594dcff..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int16Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int16Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt16Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int16Literal() - x.Init(buf, n + offset) - return x - - # Int16Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int16Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 0 - -def Int16LiteralStart(builder): builder.StartObject(1) -def Int16LiteralAddValue(builder, value): builder.PrependInt16Slot(0, value, 0) -def Int16LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py deleted file mode 100644 index 6a640ca1f2d5a..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int32Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int32Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt32Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int32Buffer() - x.Init(buf, n + offset) - return x - - # Int32Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int32Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) - return 0 - - # Int32Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o) - return 0 - - # Int32Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Int32Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def Int32BufferStart(builder): builder.StartObject(1) -def Int32BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def Int32BufferStartItemsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def Int32BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py deleted file mode 100644 index 1a1b64702d91f..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int32Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int32Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt32Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int32Literal() - x.Init(buf, n + offset) - return x - - # Int32Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int32Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - -def Int32LiteralStart(builder): builder.StartObject(1) -def Int32LiteralAddValue(builder, value): builder.PrependInt32Slot(0, value, 0) -def Int32LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py deleted file mode 100644 index 921473509b86b..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int64Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int64Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt64Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int64Buffer() - x.Init(buf, n + offset) - return x - - # Int64Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int64Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) - return 0 - - # Int64Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o) - return 0 - - # Int64Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Int64Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def Int64BufferStart(builder): builder.StartObject(1) -def Int64BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def Int64BufferStartItemsVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def Int64BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py deleted file mode 100644 index 1688b8c0223b7..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int64Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int64Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt64Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int64Literal() - x.Init(buf, n + offset) - return x - - # Int64Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int64Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) - return 0 - -def Int64LiteralStart(builder): builder.StartObject(1) -def Int64LiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) -def Int64LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py deleted file mode 100644 index e27ef5b0cbf88..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int8Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int8Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt8Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int8Buffer() - x.Init(buf, n + offset) - return x - - # Int8Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int8Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) - return 0 - - # Int8Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) - return 0 - - # Int8Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Int8Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def Int8BufferStart(builder): builder.StartObject(1) -def Int8BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def Int8BufferStartItemsVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def Int8BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py deleted file mode 100644 index bc891ecc414b3..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Int8Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int8Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt8Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int8Literal() - x.Init(buf, n + offset) - return x - - # Int8Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int8Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) - return 0 - -def Int8LiteralStart(builder): builder.StartObject(1) -def Int8LiteralAddValue(builder, value): builder.PrependInt8Slot(0, value, 0) -def Int8LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py deleted file mode 100644 index 71878783aea6b..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteral.py +++ /dev/null @@ -1,43 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class IntervalLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsIntervalLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = IntervalLiteral() - x.Init(buf, n + offset) - return x - - # IntervalLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # IntervalLiteral - def ValueType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # IntervalLiteral - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def IntervalLiteralStart(builder): builder.StartObject(2) -def IntervalLiteralAddValueType(builder, valueType): builder.PrependUint8Slot(0, valueType, 0) -def IntervalLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) -def IntervalLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py deleted file mode 100644 index a1b71a789e0f5..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralDaysMilliseconds.py +++ /dev/null @@ -1,40 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class IntervalLiteralDaysMilliseconds(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsIntervalLiteralDaysMilliseconds(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = IntervalLiteralDaysMilliseconds() - x.Init(buf, n + offset) - return x - - # IntervalLiteralDaysMilliseconds - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # IntervalLiteralDaysMilliseconds - def Days(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - - # IntervalLiteralDaysMilliseconds - def Milliseconds(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - -def IntervalLiteralDaysMillisecondsStart(builder): builder.StartObject(2) -def IntervalLiteralDaysMillisecondsAddDays(builder, days): builder.PrependInt32Slot(0, days, 0) -def IntervalLiteralDaysMillisecondsAddMilliseconds(builder, milliseconds): builder.PrependInt32Slot(1, milliseconds, 0) -def IntervalLiteralDaysMillisecondsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py deleted file mode 100644 index 1fd11205ea304..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralImpl.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class IntervalLiteralImpl(object): - NONE = 0 - IntervalLiteralMonths = 1 - IntervalLiteralDaysMilliseconds = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py b/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py deleted file mode 100644 index cc5aa6da68c29..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/IntervalLiteralMonths.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class IntervalLiteralMonths(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsIntervalLiteralMonths(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = IntervalLiteralMonths() - x.Init(buf, n + offset) - return x - - # IntervalLiteralMonths - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # IntervalLiteralMonths - def Months(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - -def IntervalLiteralMonthsStart(builder): builder.StartObject(1) -def IntervalLiteralMonthsAddMonths(builder, months): builder.PrependInt32Slot(0, months, 0) -def IntervalLiteralMonthsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Join.py b/python/generated/org/apache/arrow/computeir/flatbuf/Join.py deleted file mode 100644 index 89a93cafd2be6..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Join.py +++ /dev/null @@ -1,73 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# The contents of Relation.options will be JoinOptions -# if Relation.operation = CanonicalOperation::Join -class Join(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsJoin(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Join() - x.Init(buf, n + offset) - return x - - # Join - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Join - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # The expression which will be evaluated against rows from each - # input to determine whether they should be included in the - # join relation's output. - # Join - def OnExpression(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Join - def JoinKindType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # The kind of join to use. - # Join - def JoinKind(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def JoinStart(builder): builder.StartObject(4) -def JoinAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def JoinAddOnExpression(builder, onExpression): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(onExpression), 0) -def JoinAddJoinKindType(builder, joinKindType): builder.PrependUint8Slot(2, joinKindType, 0) -def JoinAddJoinKind(builder, joinKind): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(joinKind), 0) -def JoinEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py deleted file mode 100644 index 707e8249675ac..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/JoinKind.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class JoinKind(object): - NONE = 0 - CanonicalJoinKind = 1 - NonCanonicalJoinKind = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py b/python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py deleted file mode 100644 index 9168e6545c5b1..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/KeyValue.py +++ /dev/null @@ -1,44 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class KeyValue(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsKeyValue(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = KeyValue() - x.Init(buf, n + offset) - return x - - # KeyValue - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # KeyValue - def Key(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # KeyValue - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Literal import Literal - obj = Literal() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def KeyValueStart(builder): builder.StartObject(2) -def KeyValueAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0) -def KeyValueAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) -def KeyValueEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Limit.py b/python/generated/org/apache/arrow/computeir/flatbuf/Limit.py deleted file mode 100644 index 3e46154e9500a..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Limit.py +++ /dev/null @@ -1,46 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Limit operation -class Limit(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsLimit(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Limit() - x.Init(buf, n + offset) - return x - - # Limit - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Limit - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # The maximum number of rows of output. - # Limit - def Count(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) - return 0 - -def LimitStart(builder): builder.StartObject(2) -def LimitAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def LimitAddCount(builder, count): builder.PrependInt64Slot(1, count, 0) -def LimitEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/Literal.py deleted file mode 100644 index 2750449fff497..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Literal.py +++ /dev/null @@ -1,43 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Literal() - x.Init(buf, n + offset) - return x - - # Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Literal - def ImplType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # Literal - def Impl(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def LiteralStart(builder): builder.StartObject(2) -def LiteralAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) -def LiteralAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) -def LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py deleted file mode 100644 index c634d80791401..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/LiteralImpl.py +++ /dev/null @@ -1,30 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class LiteralImpl(object): - NONE = 0 - NullLiteral = 1 - BooleanLiteral = 2 - Int8Literal = 3 - Int16Literal = 4 - Int32Literal = 5 - Int64Literal = 6 - UInt8Literal = 7 - UInt16Literal = 8 - UInt32Literal = 9 - UInt64Literal = 10 - DateLiteral = 11 - TimeLiteral = 12 - TimestampLiteral = 13 - IntervalLiteral = 14 - DecimalLiteral = 15 - Float16Literal = 16 - Float32Literal = 17 - Float64Literal = 18 - ArrayLiteral = 19 - StructLiteral = 20 - MapLiteral = 21 - StringLiteral = 22 - BinaryLiteral = 23 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py b/python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py deleted file mode 100644 index df7e9cc9087d8..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/LiteralRelation.py +++ /dev/null @@ -1,65 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Literal relation -class LiteralRelation(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsLiteralRelation(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = LiteralRelation() - x.Init(buf, n + offset) - return x - - # LiteralRelation - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # LiteralRelation - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # The columns of this literal relation. - # LiteralRelation - def Columns(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Literal import Literal - obj = Literal() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # LiteralRelation - def ColumnsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # LiteralRelation - def ColumnsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - return o == 0 - -def LiteralRelationStart(builder): builder.StartObject(2) -def LiteralRelationAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def LiteralRelationAddColumns(builder, columns): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(columns), 0) -def LiteralRelationStartColumnsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def LiteralRelationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py b/python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py deleted file mode 100644 index 92805c73fbf47..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/MapKey.py +++ /dev/null @@ -1,33 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Access a value for a given map key -class MapKey(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsMapKey(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = MapKey() - x.Init(buf, n + offset) - return x - - # MapKey - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # MapKey - def Key(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def MapKeyStart(builder): builder.StartObject(1) -def MapKeyAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0) -def MapKeyEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py deleted file mode 100644 index 29072657b49ba..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/MapLiteral.py +++ /dev/null @@ -1,51 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class MapLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsMapLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = MapLiteral() - x.Init(buf, n + offset) - return x - - # MapLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # MapLiteral - def Values(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.KeyValue import KeyValue - obj = KeyValue() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # MapLiteral - def ValuesLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # MapLiteral - def ValuesIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def MapLiteralStart(builder): builder.StartObject(1) -def MapLiteralAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0) -def MapLiteralStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def MapLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py deleted file mode 100644 index 36e2348111900..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalAggregate.py +++ /dev/null @@ -1,40 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class NonCanonicalAggregate(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsNonCanonicalAggregate(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = NonCanonicalAggregate() - x.Init(buf, n + offset) - return x - - # NonCanonicalAggregate - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # NonCanonicalAggregate - def NameSpace(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # NonCanonicalAggregate - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def NonCanonicalAggregateStart(builder): builder.StartObject(2) -def NonCanonicalAggregateAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) -def NonCanonicalAggregateAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def NonCanonicalAggregateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py deleted file mode 100644 index b913579b111f3..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalFunction.py +++ /dev/null @@ -1,40 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class NonCanonicalFunction(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsNonCanonicalFunction(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = NonCanonicalFunction() - x.Init(buf, n + offset) - return x - - # NonCanonicalFunction - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # NonCanonicalFunction - def NameSpace(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # NonCanonicalFunction - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def NonCanonicalFunctionStart(builder): builder.StartObject(2) -def NonCanonicalFunctionAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) -def NonCanonicalFunctionAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def NonCanonicalFunctionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py deleted file mode 100644 index 5fc46d685b920..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalJoinKind.py +++ /dev/null @@ -1,40 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class NonCanonicalJoinKind(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsNonCanonicalJoinKind(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = NonCanonicalJoinKind() - x.Init(buf, n + offset) - return x - - # NonCanonicalJoinKind - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # NonCanonicalJoinKind - def NameSpace(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # NonCanonicalJoinKind - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def NonCanonicalJoinKindStart(builder): builder.StartObject(2) -def NonCanonicalJoinKindAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) -def NonCanonicalJoinKindAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def NonCanonicalJoinKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py deleted file mode 100644 index 08258c543dadb..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/NonCanonicalSetOpKind.py +++ /dev/null @@ -1,40 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class NonCanonicalSetOpKind(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsNonCanonicalSetOpKind(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = NonCanonicalSetOpKind() - x.Init(buf, n + offset) - return x - - # NonCanonicalSetOpKind - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # NonCanonicalSetOpKind - def NameSpace(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # NonCanonicalSetOpKind - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def NonCanonicalSetOpKindStart(builder): builder.StartObject(2) -def NonCanonicalSetOpKindAddNameSpace(builder, nameSpace): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(nameSpace), 0) -def NonCanonicalSetOpKindAddName(builder, name): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def NonCanonicalSetOpKindEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py deleted file mode 100644 index c0c834ea00a5e..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/NullLiteral.py +++ /dev/null @@ -1,24 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class NullLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsNullLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = NullLiteral() - x.Init(buf, n + offset) - return x - - # NullLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def NullLiteralStart(builder): builder.StartObject(0) -def NullLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py b/python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py deleted file mode 100644 index 31e38e3bd6d2b..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/OrderBy.py +++ /dev/null @@ -1,66 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Order by relation -class OrderBy(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsOrderBy(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = OrderBy() - x.Init(buf, n + offset) - return x - - # OrderBy - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # OrderBy - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Define sort order for rows of output. - # Keys with higher precedence are ordered ahead of other keys. - # OrderBy - def Keys(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.SortKey import SortKey - obj = SortKey() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # OrderBy - def KeysLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # OrderBy - def KeysIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - return o == 0 - -def OrderByStart(builder): builder.StartObject(2) -def OrderByAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def OrderByAddKeys(builder, keys): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(keys), 0) -def OrderByStartKeysVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def OrderByEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py b/python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py deleted file mode 100644 index 23ee831f8095c..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Ordering.py +++ /dev/null @@ -1,12 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# Whether lesser values should precede greater or vice versa, -# also whether nulls should preced or follow values. -class Ordering(object): - ASCENDING_THEN_NULLS = 0 - DESCENDING_THEN_NULLS = 1 - NULLS_THEN_ASCENDING = 2 - NULLS_THEN_DESCENDING = 3 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py b/python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py deleted file mode 100644 index ed73f216148a7..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/PassThrough.py +++ /dev/null @@ -1,24 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class PassThrough(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsPassThrough(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = PassThrough() - x.Init(buf, n + offset) - return x - - # PassThrough - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def PassThroughStart(builder): builder.StartObject(0) -def PassThroughEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Plan.py b/python/generated/org/apache/arrow/computeir/flatbuf/Plan.py deleted file mode 100644 index 4d751fd63ec80..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Plan.py +++ /dev/null @@ -1,68 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A specification of a query. -class Plan(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsPlan(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Plan() - x.Init(buf, n + offset) - return x - - # Plan - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # One or more output relations. - # Plan - def Sinks(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Relation import Relation - obj = Relation() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Plan - def SinksLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Plan - def SinksIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - - # If this Plan was derived from another (for example by running - # an optimization pass), that plan may be included here to - # provide a backtrace of derivations. - # Plan - def DerivedFrom(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Plan import Plan - obj = Plan() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def PlanStart(builder): builder.StartObject(2) -def PlanAddSinks(builder, sinks): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(sinks), 0) -def PlanStartSinksVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def PlanAddDerivedFrom(builder, derivedFrom): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(derivedFrom), 0) -def PlanEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py b/python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py deleted file mode 100644 index c6e1c243d7555..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Preceding.py +++ /dev/null @@ -1,44 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Boundary is preceding rows, determined by the contained expression -class Preceding(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsPreceding(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Preceding() - x.Init(buf, n + offset) - return x - - # Preceding - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Preceding - def IpmlType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # Preceding - def Ipml(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def PrecedingStart(builder): builder.StartObject(2) -def PrecedingAddIpmlType(builder, ipmlType): builder.PrependUint8Slot(0, ipmlType, 0) -def PrecedingAddIpml(builder, ipml): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(ipml), 0) -def PrecedingEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Project.py b/python/generated/org/apache/arrow/computeir/flatbuf/Project.py deleted file mode 100644 index 5dab18d0ee1e7..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Project.py +++ /dev/null @@ -1,66 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Projection -class Project(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsProject(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Project() - x.Init(buf, n + offset) - return x - - # Project - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Project - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Expressions which will be evaluated to produce to - # the rows of the project relation's output. - # Project - def Expressions(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Project - def ExpressionsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Project - def ExpressionsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - return o == 0 - -def ProjectStart(builder): builder.StartObject(2) -def ProjectAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def ProjectAddExpressions(builder, expressions): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(expressions), 0) -def ProjectStartExpressionsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def ProjectEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Read.py b/python/generated/org/apache/arrow/computeir/flatbuf/Read.py deleted file mode 100644 index fa068f5a05dc0..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Read.py +++ /dev/null @@ -1,57 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A table read -class Read(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsRead(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Read() - x.Init(buf, n + offset) - return x - - # Read - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Read - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Read - def Resource(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Read - def Schema(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.Schema import Schema - obj = Schema() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def ReadStart(builder): builder.StartObject(3) -def ReadAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def ReadAddResource(builder, resource): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(resource), 0) -def ReadAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) -def ReadEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py b/python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py deleted file mode 100644 index 3c4c34a664800..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/RelBase.py +++ /dev/null @@ -1,86 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Fields common to every relational operator -class RelBase(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsRelBase(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = RelBase() - x.Init(buf, n + offset) - return x - - # RelBase - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The arguments passed to `operation`. - # RelBase - def Arguments(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Relation import Relation - obj = Relation() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # RelBase - def ArgumentsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # RelBase - def ArgumentsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - - # RelBase - def OutputMappingType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # Output remapping of ordinals for a given operation - # RelBase - def OutputMapping(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - - # Arguments for custom operations - # RelBase - def Options(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.InlineBuffer import InlineBuffer - obj = InlineBuffer() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def RelBaseStart(builder): builder.StartObject(4) -def RelBaseAddArguments(builder, arguments): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(arguments), 0) -def RelBaseStartArgumentsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def RelBaseAddOutputMappingType(builder, outputMappingType): builder.PrependUint8Slot(1, outputMappingType, 0) -def RelBaseAddOutputMapping(builder, outputMapping): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(outputMapping), 0) -def RelBaseAddOptions(builder, options): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(options), 0) -def RelBaseEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Relation.py b/python/generated/org/apache/arrow/computeir/flatbuf/Relation.py deleted file mode 100644 index 22188fb82bfa7..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Relation.py +++ /dev/null @@ -1,44 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A table holding an instance of the possible relation types. -class Relation(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsRelation(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Relation() - x.Init(buf, n + offset) - return x - - # Relation - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Relation - def ImplType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # Relation - def Impl(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def RelationStart(builder): builder.StartObject(2) -def RelationAddImplType(builder, implType): builder.PrependUint8Slot(0, implType, 0) -def RelationAddImpl(builder, impl): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(impl), 0) -def RelationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py b/python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py deleted file mode 100644 index e7fd090c0a025..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/RelationImpl.py +++ /dev/null @@ -1,19 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# The varieties of relations -class RelationImpl(object): - NONE = 0 - Aggregate = 1 - Common = 2 - Custom = 3 - SetOperation = 4 - Filter = 5 - Limit = 6 - LiteralRelation = 7 - OrderBy = 8 - Project = 9 - Read = 10 - Write = 11 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Remap.py b/python/generated/org/apache/arrow/computeir/flatbuf/Remap.py deleted file mode 100644 index d30060d0a33d4..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Remap.py +++ /dev/null @@ -1,60 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A data type indicating a different mapping of columns -# should occur in the output. -# -# For example: -# -# Given a query `SELECT a, b FROM t` where `t` has columns a, b, c -# the mapping value for the projection would equal [0, 1]. -class Remap(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsRemap(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Remap() - x.Init(buf, n + offset) - return x - - # Remap - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Remap - def Mapping(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) - return 0 - - # Remap - def MappingAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o) - return 0 - - # Remap - def MappingLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Remap - def MappingIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def RemapStart(builder): builder.StartObject(1) -def RemapAddMapping(builder, mapping): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(mapping), 0) -def RemapStartMappingVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def RemapEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py b/python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py deleted file mode 100644 index 464d53c36a371..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/SetOpKind.py +++ /dev/null @@ -1,10 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# The kind of set operation -class SetOpKind(object): - NONE = 0 - CanonicalSetOpKind = 1 - NonCanonicalSetOpKind = 2 - diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py b/python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py deleted file mode 100644 index 0f5dd4a464379..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/SetOperation.py +++ /dev/null @@ -1,57 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A set operation on two or more relations -class SetOperation(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsSetOperation(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = SetOperation() - x.Init(buf, n + offset) - return x - - # SetOperation - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # SetOperation - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # SetOperation - def SetOpType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # The kind of set operation - # SetOperation - def SetOp(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - -def SetOperationStart(builder): builder.StartObject(3) -def SetOperationAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def SetOperationAddSetOpType(builder, setOpType): builder.PrependUint8Slot(1, setOpType, 0) -def SetOperationAddSetOp(builder, setOp): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(setOp), 0) -def SetOperationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py b/python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py deleted file mode 100644 index e4d2bc89355a8..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/SortKey.py +++ /dev/null @@ -1,45 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# An expression with an order -class SortKey(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsSortKey(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = SortKey() - x.Init(buf, n + offset) - return x - - # SortKey - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # SortKey - def Expression(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # SortKey - def Ordering(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - -def SortKeyStart(builder): builder.StartObject(2) -def SortKeyAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) -def SortKeyAddOrdering(builder, ordering): builder.PrependUint8Slot(1, ordering, 0) -def SortKeyEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py deleted file mode 100644 index 42b79086e3cda..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/StringLiteral.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class StringLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsStringLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = StringLiteral() - x.Init(buf, n + offset) - return x - - # StringLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # StringLiteral - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def StringLiteralStart(builder): builder.StartObject(1) -def StringLiteralAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) -def StringLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/StructField.py b/python/generated/org/apache/arrow/computeir/flatbuf/StructField.py deleted file mode 100644 index bde4f0443c263..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/StructField.py +++ /dev/null @@ -1,34 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Struct field access -class StructField(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsStructField(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = StructField() - x.Init(buf, n + offset) - return x - - # StructField - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The position of the field in the struct schema - # StructField - def Position(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - -def StructFieldStart(builder): builder.StartObject(1) -def StructFieldAddPosition(builder, position): builder.PrependUint32Slot(0, position, 0) -def StructFieldEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py deleted file mode 100644 index 89fbbcbf98866..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/StructLiteral.py +++ /dev/null @@ -1,51 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class StructLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsStructLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = StructLiteral() - x.Init(buf, n + offset) - return x - - # StructLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # StructLiteral - def Values(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.KeyValue import KeyValue - obj = KeyValue() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # StructLiteral - def ValuesLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # StructLiteral - def ValuesIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def StructLiteralStart(builder): builder.StartObject(1) -def StructLiteralAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0) -def StructLiteralStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StructLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py deleted file mode 100644 index c2718b6e52f05..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/TableBuffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class TableBuffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsTableBuffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = TableBuffer() - x.Init(buf, n + offset) - return x - - # TableBuffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # TableBuffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) - return 0 - - # TableBuffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) - return 0 - - # TableBuffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # TableBuffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def TableBufferStart(builder): builder.StartObject(1) -def TableBufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def TableBufferStartItemsVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def TableBufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py deleted file mode 100644 index 73f6eb8afd31b..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/TimeLiteral.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class TimeLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsTimeLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = TimeLiteral() - x.Init(buf, n + offset) - return x - - # TimeLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # TimeLiteral - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) - return 0 - -def TimeLiteralStart(builder): builder.StartObject(1) -def TimeLiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) -def TimeLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py b/python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py deleted file mode 100644 index 284bab1f58d3b..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/TimestampLiteral.py +++ /dev/null @@ -1,40 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class TimestampLiteral(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsTimestampLiteral(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = TimestampLiteral() - x.Init(buf, n + offset) - return x - - # TimestampLiteral - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # TimestampLiteral - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) - return 0 - - # TimestampLiteral - def Timezone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def TimestampLiteralStart(builder): builder.StartObject(2) -def TimestampLiteralAddValue(builder, value): builder.PrependInt64Slot(0, value, 0) -def TimestampLiteralAddTimezone(builder, timezone): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(timezone), 0) -def TimestampLiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py deleted file mode 100644 index 8acf00b0ccfa5..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt16Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt16Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt16Buffer() - x.Init(buf, n + offset) - return x - - # UInt16Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt16Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2)) - return 0 - - # UInt16Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint16Flags, o) - return 0 - - # UInt16Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # UInt16Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def UInt16BufferStart(builder): builder.StartObject(1) -def UInt16BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def UInt16BufferStartItemsVector(builder, numElems): return builder.StartVector(2, numElems, 2) -def UInt16BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py deleted file mode 100644 index 291b249920a46..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt16Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt16Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt16Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt16Literal() - x.Init(buf, n + offset) - return x - - # UInt16Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt16Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) - return 0 - -def UInt16LiteralStart(builder): builder.StartObject(1) -def UInt16LiteralAddValue(builder, value): builder.PrependUint16Slot(0, value, 0) -def UInt16LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py deleted file mode 100644 index 2249c0c0c196c..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt32Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt32Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt32Buffer() - x.Init(buf, n + offset) - return x - - # UInt32Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt32Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) - return 0 - - # UInt32Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o) - return 0 - - # UInt32Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # UInt32Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def UInt32BufferStart(builder): builder.StartObject(1) -def UInt32BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def UInt32BufferStartItemsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def UInt32BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py deleted file mode 100644 index deaba6cf7eb8d..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt32Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt32Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt32Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt32Literal() - x.Init(buf, n + offset) - return x - - # UInt32Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt32Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) - return 0 - -def UInt32LiteralStart(builder): builder.StartObject(1) -def UInt32LiteralAddValue(builder, value): builder.PrependUint32Slot(0, value, 0) -def UInt32LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py deleted file mode 100644 index dc7342e825660..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt64Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt64Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt64Buffer() - x.Init(buf, n + offset) - return x - - # UInt64Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt64Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) - return 0 - - # UInt64Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o) - return 0 - - # UInt64Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # UInt64Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def UInt64BufferStart(builder): builder.StartObject(1) -def UInt64BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def UInt64BufferStartItemsVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def UInt64BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py deleted file mode 100644 index 75aa49ae98ead..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt64Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt64Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt64Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt64Literal() - x.Init(buf, n + offset) - return x - - # UInt64Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt64Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos) - return 0 - -def UInt64LiteralStart(builder): builder.StartObject(1) -def UInt64LiteralAddValue(builder, value): builder.PrependUint64Slot(0, value, 0) -def UInt64LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py deleted file mode 100644 index 2e2b59e82e372..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Buffer.py +++ /dev/null @@ -1,53 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt8Buffer(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt8Buffer(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt8Buffer() - x.Init(buf, n + offset) - return x - - # UInt8Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt8Buffer - def Items(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) - return 0 - - # UInt8Buffer - def ItemsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) - return 0 - - # UInt8Buffer - def ItemsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # UInt8Buffer - def ItemsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - return o == 0 - -def UInt8BufferStart(builder): builder.StartObject(1) -def UInt8BufferAddItems(builder, items): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0) -def UInt8BufferStartItemsVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def UInt8BufferEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py b/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py deleted file mode 100644 index a380230434d0e..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/UInt8Literal.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class UInt8Literal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUInt8Literal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = UInt8Literal() - x.Init(buf, n + offset) - return x - - # UInt8Literal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # UInt8Literal - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - -def UInt8LiteralStart(builder): builder.StartObject(1) -def UInt8LiteralAddValue(builder, value): builder.PrependUint8Slot(0, value, 0) -def UInt8LiteralEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py b/python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py deleted file mode 100644 index 4eac29bc3d855..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Unbounded.py +++ /dev/null @@ -1,25 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Boundary is unbounded -class Unbounded(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUnbounded(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Unbounded() - x.Init(buf, n + offset) - return x - - # Unbounded - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def UnboundedStart(builder): builder.StartObject(0) -def UnboundedEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py b/python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py deleted file mode 100644 index b753f08b20cf6..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/WindowCall.py +++ /dev/null @@ -1,129 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# An expression representing a window function call. -class WindowCall(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsWindowCall(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = WindowCall() - x.Init(buf, n + offset) - return x - - # WindowCall - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The kind of window frame - # WindowCall - def Kind(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # The expression to operate over - # WindowCall - def Expression(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Partition keys - # WindowCall - def Partitions(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.Expression import Expression - obj = Expression() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # WindowCall - def PartitionsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # WindowCall - def PartitionsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - return o == 0 - - # Sort keys - # WindowCall - def Orderings(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.computeir.flatbuf.SortKey import SortKey - obj = SortKey() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # WindowCall - def OrderingsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # WindowCall - def OrderingsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - return o == 0 - - # Lower window bound - # WindowCall - def LowerBound(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Bound import Bound - obj = Bound() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Upper window bound - # WindowCall - def UpperBound(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.Bound import Bound - obj = Bound() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def WindowCallStart(builder): builder.StartObject(6) -def WindowCallAddKind(builder, kind): builder.PrependUint8Slot(0, kind, 0) -def WindowCallAddExpression(builder, expression): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(expression), 0) -def WindowCallAddPartitions(builder, partitions): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(partitions), 0) -def WindowCallStartPartitionsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def WindowCallAddOrderings(builder, orderings): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(orderings), 0) -def WindowCallStartOrderingsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def WindowCallAddLowerBound(builder, lowerBound): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(lowerBound), 0) -def WindowCallAddUpperBound(builder, upperBound): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(upperBound), 0) -def WindowCallEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/Write.py b/python/generated/org/apache/arrow/computeir/flatbuf/Write.py deleted file mode 100644 index 6245493cf8cd1..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/Write.py +++ /dev/null @@ -1,57 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A table write -class Write(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsWrite(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Write() - x.Init(buf, n + offset) - return x - - # Write - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Write - def Base(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.RelBase import RelBase - obj = RelBase() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Write - def Resource(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Write - def Schema(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.Schema import Schema - obj = Schema() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def WriteStart(builder): builder.StartObject(3) -def WriteAddBase(builder, base): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(base), 0) -def WriteAddResource(builder, resource): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(resource), 0) -def WriteAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) -def WriteEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/__init__.py b/python/generated/org/apache/arrow/computeir/flatbuf/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py deleted file mode 100644 index 8d3736e608e15..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetScanOptions.py +++ /dev/null @@ -1,70 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions -# if Relation.operation = NonCanonicalOperation{ -# .name_space = "arrow", -# .name = "filesystem_dataset_scan", -# } -class Arrow_FileSystemDatasetScanOptions(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsArrow_FileSystemDatasetScanOptions(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Arrow_FileSystemDatasetScanOptions() - x.Init(buf, n + offset) - return x - - # Arrow_FileSystemDatasetScanOptions - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The base directory of a dataset which should be scanned - # as a source relation. A URI is used to accommodate potentially - # remote file systems. - # Arrow_FileSystemDatasetScanOptions - def BaseDir(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.ext.Uri import Uri - obj = Uri() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # The format of files in this dataset. - # Arrow_FileSystemDatasetScanOptions - def Format(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.ext.FileFormat import FileFormat - obj = FileFormat() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # A partitioning scheme in use in this dataset. - # Arrow_FileSystemDatasetScanOptions - def Partitioning(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.ext.Partitioning import Partitioning - obj = Partitioning() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def Arrow_FileSystemDatasetScanOptionsStart(builder): builder.StartObject(3) -def Arrow_FileSystemDatasetScanOptionsAddBaseDir(builder, baseDir): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(baseDir), 0) -def Arrow_FileSystemDatasetScanOptionsAddFormat(builder, format): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(format), 0) -def Arrow_FileSystemDatasetScanOptionsAddPartitioning(builder, partitioning): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(partitioning), 0) -def Arrow_FileSystemDatasetScanOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py deleted file mode 100644 index da5f1f9972a4d..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_FileSystemDatasetWriteOptions.py +++ /dev/null @@ -1,81 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions -# if Relation.operation = NonCanonicalOperation{ -# .name_space = "arrow", -# .name = "filesystem_dataset_write", -# } -class Arrow_FileSystemDatasetWriteOptions(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsArrow_FileSystemDatasetWriteOptions(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Arrow_FileSystemDatasetWriteOptions() - x.Init(buf, n + offset) - return x - - # Arrow_FileSystemDatasetWriteOptions - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The base directory of a dataset into which output batches should be - # written. A URI is used to accommodate potentially remote file systems. - # Files present in this directory will not be explicitly deleted, though - # they may be overwritten. - # Arrow_FileSystemDatasetWriteOptions - def BaseDir(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.ext.Uri import Uri - obj = Uri() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # The format in which to write files. - # Arrow_FileSystemDatasetWriteOptions - def Format(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.ext.FileFormat import FileFormat - obj = FileFormat() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # A partitioning scheme which should be used when writing this dataset. - # Arrow_FileSystemDatasetWriteOptions - def Partitioning(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.ext.Partitioning import Partitioning - obj = Partitioning() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Template string used to generate written files' basenames. - # {i} will be replaced by an auto incremented integer. - # Arrow_FileSystemDatasetWriteOptions - def BasenameTemplate(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def Arrow_FileSystemDatasetWriteOptionsStart(builder): builder.StartObject(4) -def Arrow_FileSystemDatasetWriteOptionsAddBaseDir(builder, baseDir): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(baseDir), 0) -def Arrow_FileSystemDatasetWriteOptionsAddFormat(builder, format): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(format), 0) -def Arrow_FileSystemDatasetWriteOptionsAddPartitioning(builder, partitioning): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(partitioning), 0) -def Arrow_FileSystemDatasetWriteOptionsAddBasenameTemplate(builder, basenameTemplate): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(basenameTemplate), 0) -def Arrow_FileSystemDatasetWriteOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py deleted file mode 100644 index e795d3a292e16..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Arrow_StreamOutOptions.py +++ /dev/null @@ -1,42 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# The contents of Relation.options will be Arrow_StreamOutOptions -# if Relation.operation = NonCanonicalOperation{ -# .name_space = "arrow", -# .name = "stream_out", -# } -class Arrow_StreamOutOptions(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsArrow_StreamOutOptions(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Arrow_StreamOutOptions() - x.Init(buf, n + offset) - return x - - # Arrow_StreamOutOptions - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The URI to which RecordBatches of output should be streamed. - # Arrow_StreamOutOptions - def Destination(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.computeir.flatbuf.ext.Uri import Uri - obj = Uri() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def Arrow_StreamOutOptionsStart(builder): builder.StartObject(1) -def Arrow_StreamOutOptionsAddDestination(builder, destination): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(destination), 0) -def Arrow_StreamOutOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py deleted file mode 100644 index 2e366c4d8f2ad..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/FileFormat.py +++ /dev/null @@ -1,45 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class FileFormat(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFileFormat(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = FileFormat() - x.Init(buf, n + offset) - return x - - # FileFormat - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # E.g. "parquet", "csv", ... - # FileFormat - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # FileFormat - def Options(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = o + self._tab.Pos - from org.apache.arrow.flatbuf.Buffer import Buffer - obj = Buffer() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def FileFormatStart(builder): builder.StartObject(2) -def FileFormatAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def FileFormatAddOptions(builder, options): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(options), 0) -def FileFormatEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py deleted file mode 100644 index 4d363f5bf61ea..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Partitioning.py +++ /dev/null @@ -1,46 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Partitioning(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsPartitioning(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Partitioning() - x.Init(buf, n + offset) - return x - - # Partitioning - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Currently supported: "hive", "directory" - # Partitioning - def Flavor(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Fields on which data is partitioned - # Partitioning - def Schema(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.Schema import Schema - obj = Schema() - obj.Init(self._tab.Bytes, x) - return obj - return None - -def PartitioningStart(builder): builder.StartObject(2) -def PartitioningAddFlavor(builder, flavor): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(flavor), 0) -def PartitioningAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) -def PartitioningEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py deleted file mode 100644 index acd8cc75edb1f..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_FromOptions.py +++ /dev/null @@ -1,38 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# The contents of Relation.options will be Sql_FromOptions -# if Relation.operation = NonCanonicalOperation{ -# .name_space = "sql", -# .name = "from", -# } -class Sql_FromOptions(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsSql_FromOptions(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Sql_FromOptions() - x.Init(buf, n + offset) - return x - - # Sql_FromOptions - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The name of a table referenced as a source relation. - # Sql_FromOptions - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def Sql_FromOptionsStart(builder): builder.StartObject(1) -def Sql_FromOptionsAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def Sql_FromOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py deleted file mode 100644 index 8df5b7c324ccb..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Sql_IntoOptions.py +++ /dev/null @@ -1,50 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -#////////////////////////////////////////////////////////// -# The contents of Relation.options will be Sql_IntoOptions -# if Relation.operation = NonCanonicalOperation{ -# .name_space = "sql", -# .name = "into", -# } -class Sql_IntoOptions(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsSql_IntoOptions(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Sql_IntoOptions() - x.Init(buf, n + offset) - return x - - # Sql_IntoOptions - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The name of a table into which rows will be inserted. - # Sql_IntoOptions - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Whether rows written into the table should be appended - # to the table's current rows (INSERT INTO). - # If false, the table will be overwritten (INTO). - # Sql_IntoOptions - def Append(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) - return True - -def Sql_IntoOptionsStart(builder): builder.StartObject(2) -def Sql_IntoOptionsAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def Sql_IntoOptionsAddAppend(builder, append): builder.PrependBoolSlot(1, append, 1) -def Sql_IntoOptionsEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py deleted file mode 100644 index ece6db1eff778..0000000000000 --- a/python/generated/org/apache/arrow/computeir/flatbuf/ext/Uri.py +++ /dev/null @@ -1,100 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: ext - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -#////////////////////////////////////////////////////////// -class Uri(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUri(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Uri() - x.Init(buf, n + offset) - return x - - # Uri - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Uri - def Schema(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Uri - def Userinfo(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Uri - def Host(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Uri - def Port(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) - return 0 - - # Uri - def Path(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Uri - def Query(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.flatbuf.KeyValue import KeyValue - obj = KeyValue() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Uri - def QueryLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Uri - def QueryIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) - return o == 0 - - # Uri - def Fragment(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def UriStart(builder): builder.StartObject(7) -def UriAddSchema(builder, schema): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(schema), 0) -def UriAddUserinfo(builder, userinfo): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(userinfo), 0) -def UriAddHost(builder, host): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(host), 0) -def UriAddPort(builder, port): builder.PrependUint16Slot(3, port, 0) -def UriAddPath(builder, path): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(path), 0) -def UriAddQuery(builder, query): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(query), 0) -def UriStartQueryVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def UriAddFragment(builder, fragment): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(fragment), 0) -def UriEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/computeir/flatbuf/ext/__init__.py b/python/generated/org/apache/arrow/computeir/flatbuf/ext/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/python/generated/org/apache/arrow/flatbuf/Binary.py b/python/generated/org/apache/arrow/flatbuf/Binary.py deleted file mode 100644 index 714ce9edf7306..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Binary.py +++ /dev/null @@ -1,25 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Opaque binary data -class Binary(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsBinary(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Binary() - x.Init(buf, n + offset) - return x - - # Binary - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def BinaryStart(builder): builder.StartObject(0) -def BinaryEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Bool.py b/python/generated/org/apache/arrow/flatbuf/Bool.py deleted file mode 100644 index b3992459594a5..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Bool.py +++ /dev/null @@ -1,24 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Bool(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsBool(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Bool() - x.Init(buf, n + offset) - return x - - # Bool - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def BoolStart(builder): builder.StartObject(0) -def BoolEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Buffer.py b/python/generated/org/apache/arrow/flatbuf/Buffer.py deleted file mode 100644 index 70772254c0c62..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Buffer.py +++ /dev/null @@ -1,34 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# ---------------------------------------------------------------------- -# A Buffer represents a single contiguous memory segment -class Buffer(object): - __slots__ = ['_tab'] - - # Buffer - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The relative offset into the shared memory page where the bytes for this - # buffer starts - # Buffer - def Offset(self): return self._tab.Get(flatbuffers.number_types.Int64Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0)) - # The absolute length (in bytes) of the memory buffer. The memory is found - # from offset (inclusive) to offset + length (non-inclusive). When building - # messages using the encapsulated IPC message, padding bytes may be written - # after a buffer, but such padding bytes do not need to be accounted for in - # the size here. - # Buffer - def Length(self): return self._tab.Get(flatbuffers.number_types.Int64Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(8)) - -def CreateBuffer(builder, offset, length): - builder.Prep(8, 16) - builder.PrependInt64(length) - builder.PrependInt64(offset) - return builder.Offset() diff --git a/python/generated/org/apache/arrow/flatbuf/Date.py b/python/generated/org/apache/arrow/flatbuf/Date.py deleted file mode 100644 index 460f7ef026cde..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Date.py +++ /dev/null @@ -1,38 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Date is either a 32-bit or 64-bit type representing elapsed time since UNIX -# epoch (1970-01-01), stored in either of two units: -# -# * Milliseconds (64 bits) indicating UNIX time elapsed since the epoch (no -# leap seconds), where the values are evenly divisible by 86400000 -# * Days (32 bits) since the UNIX epoch -class Date(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsDate(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Date() - x.Init(buf, n + offset) - return x - - # Date - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Date - def Unit(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 1 - -def DateStart(builder): builder.StartObject(1) -def DateAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 1) -def DateEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/DateUnit.py b/python/generated/org/apache/arrow/flatbuf/DateUnit.py deleted file mode 100644 index 882d6b4fc4f07..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/DateUnit.py +++ /dev/null @@ -1,8 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class DateUnit(object): - DAY = 0 - MILLISECOND = 1 - diff --git a/python/generated/org/apache/arrow/flatbuf/Decimal.py b/python/generated/org/apache/arrow/flatbuf/Decimal.py deleted file mode 100644 index 083b254238f7e..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Decimal.py +++ /dev/null @@ -1,56 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Exact decimal value represented as an integer value in two's -# complement. Currently only 128-bit (16-byte) and 256-bit (32-byte) integers -# are used. The representation uses the endianness indicated -# in the Schema. -class Decimal(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsDecimal(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Decimal() - x.Init(buf, n + offset) - return x - - # Decimal - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Total number of decimal digits - # Decimal - def Precision(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - - # Number of digits after the decimal point "." - # Decimal - def Scale(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - - # Number of bits per value. The only accepted widths are 128 and 256. - # We use bitWidth for consistency with Int::bitWidth. - # Decimal - def BitWidth(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 128 - -def DecimalStart(builder): builder.StartObject(3) -def DecimalAddPrecision(builder, precision): builder.PrependInt32Slot(0, precision, 0) -def DecimalAddScale(builder, scale): builder.PrependInt32Slot(1, scale, 0) -def DecimalAddBitWidth(builder, bitWidth): builder.PrependInt32Slot(2, bitWidth, 128) -def DecimalEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py b/python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py deleted file mode 100644 index 86a8122b4a707..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/DictionaryEncoding.py +++ /dev/null @@ -1,72 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class DictionaryEncoding(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsDictionaryEncoding(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = DictionaryEncoding() - x.Init(buf, n + offset) - return x - - # DictionaryEncoding - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # The known dictionary id in the application where this data is used. In - # the file or streaming formats, the dictionary ids are found in the - # DictionaryBatch messages - # DictionaryEncoding - def Id(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) - return 0 - - # The dictionary indices are constrained to be non-negative integers. If - # this field is null, the indices must be signed int32. To maximize - # cross-language compatibility and performance, implementations are - # recommended to prefer signed integer types over unsigned integer types - # and to avoid uint64 indices unless they are required by an application. - # DictionaryEncoding - def IndexType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.Int import Int - obj = Int() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # By default, dictionaries are not ordered, or the order does not have - # semantic meaning. In some statistical, applications, dictionary-encoding - # is used to represent ordered categorical data, and we provide a way to - # preserve that metadata here - # DictionaryEncoding - def IsOrdered(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) - return False - - # DictionaryEncoding - def DictionaryKind(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 0 - -def DictionaryEncodingStart(builder): builder.StartObject(4) -def DictionaryEncodingAddId(builder, id): builder.PrependInt64Slot(0, id, 0) -def DictionaryEncodingAddIndexType(builder, indexType): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(indexType), 0) -def DictionaryEncodingAddIsOrdered(builder, isOrdered): builder.PrependBoolSlot(2, isOrdered, 0) -def DictionaryEncodingAddDictionaryKind(builder, dictionaryKind): builder.PrependInt16Slot(3, dictionaryKind, 0) -def DictionaryEncodingEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/DictionaryKind.py b/python/generated/org/apache/arrow/flatbuf/DictionaryKind.py deleted file mode 100644 index 6a78b442fa8e0..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/DictionaryKind.py +++ /dev/null @@ -1,12 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# ---------------------------------------------------------------------- -# Dictionary encoding metadata -# Maintained for forwards compatibility, in the future -# Dictionaries might be explicit maps between integers and values -# allowing for non-contiguous index values -class DictionaryKind(object): - DenseArray = 0 - diff --git a/python/generated/org/apache/arrow/flatbuf/Duration.py b/python/generated/org/apache/arrow/flatbuf/Duration.py deleted file mode 100644 index 6478ad973cb9e..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Duration.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Duration(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsDuration(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Duration() - x.Init(buf, n + offset) - return x - - # Duration - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Duration - def Unit(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 1 - -def DurationStart(builder): builder.StartObject(1) -def DurationAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 1) -def DurationEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Endianness.py b/python/generated/org/apache/arrow/flatbuf/Endianness.py deleted file mode 100644 index 8f93354fd1e7e..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Endianness.py +++ /dev/null @@ -1,10 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# ---------------------------------------------------------------------- -# Endianness of the platform producing the data -class Endianness(object): - Little = 0 - Big = 1 - diff --git a/python/generated/org/apache/arrow/flatbuf/Feature.py b/python/generated/org/apache/arrow/flatbuf/Feature.py deleted file mode 100644 index 42661cc65ddef..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Feature.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# Represents Arrow Features that might not have full support -# within implementations. This is intended to be used in -# two scenarios: -# 1. A mechanism for readers of Arrow Streams -# and files to understand that the stream or file makes -# use of a feature that isn't supported or unknown to -# the implementation (and therefore can meet the Arrow -# forward compatibility guarantees). -# 2. A means of negotiating between a client and server -# what features a stream is allowed to use. The enums -# values here are intented to represent higher level -# features, additional details maybe negotiated -# with key-value pairs specific to the protocol. -# -# Enums added to this list should be assigned power-of-two values -# to facilitate exchanging and comparing bitmaps for supported -# features. -class Feature(object): - # Needed to make flatbuffers happy. - UNUSED = 0 - # The stream makes use of multiple full dictionaries with the - # same ID and assumes clients implement dictionary replacement - # correctly. - DICTIONARY_REPLACEMENT = 1 - # The stream makes use of compressed bodies as described - # in Message.fbs. - COMPRESSED_BODY = 2 - diff --git a/python/generated/org/apache/arrow/flatbuf/Field.py b/python/generated/org/apache/arrow/flatbuf/Field.py deleted file mode 100644 index cae8ce2faadae..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Field.py +++ /dev/null @@ -1,135 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# ---------------------------------------------------------------------- -# A field represents a named column in a record / row batch or child of a -# nested type. -class Field(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsField(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Field() - x.Init(buf, n + offset) - return x - - # Field - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Name is not required, in i.e. a List - # Field - def Name(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # Whether or not this field can contain nulls. Should be true in general. - # Field - def Nullable(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) - return False - - # Field - def TypeType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos) - return 0 - - # This is the type of the decoded value if the field is dictionary encoded. - # Field - def Type(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - from flatbuffers.table import Table - obj = Table(bytearray(), 0) - self._tab.Union(obj, o) - return obj - return None - - # Present only if the field is dictionary encoded. - # Field - def Dictionary(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) - if o != 0: - x = self._tab.Indirect(o + self._tab.Pos) - from org.apache.arrow.flatbuf.DictionaryEncoding import DictionaryEncoding - obj = DictionaryEncoding() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # children apply only to nested data types like Struct, List and Union. For - # primitive types children will have length 0. - # Field - def Children(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.flatbuf.Field import Field - obj = Field() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Field - def ChildrenLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Field - def ChildrenIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) - return o == 0 - - # User-defined metadata - # Field - def CustomMetadata(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.flatbuf.KeyValue import KeyValue - obj = KeyValue() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Field - def CustomMetadataLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Field - def CustomMetadataIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) - return o == 0 - -def FieldStart(builder): builder.StartObject(7) -def FieldAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) -def FieldAddNullable(builder, nullable): builder.PrependBoolSlot(1, nullable, 0) -def FieldAddTypeType(builder, typeType): builder.PrependUint8Slot(2, typeType, 0) -def FieldAddType(builder, type): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(type), 0) -def FieldAddDictionary(builder, dictionary): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(dictionary), 0) -def FieldAddChildren(builder, children): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(children), 0) -def FieldStartChildrenVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def FieldAddCustomMetadata(builder, customMetadata): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(customMetadata), 0) -def FieldStartCustomMetadataVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def FieldEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py b/python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py deleted file mode 100644 index 374b3e0302212..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/FixedSizeBinary.py +++ /dev/null @@ -1,33 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class FixedSizeBinary(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFixedSizeBinary(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = FixedSizeBinary() - x.Init(buf, n + offset) - return x - - # FixedSizeBinary - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Number of bytes per value - # FixedSizeBinary - def ByteWidth(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - -def FixedSizeBinaryStart(builder): builder.StartObject(1) -def FixedSizeBinaryAddByteWidth(builder, byteWidth): builder.PrependInt32Slot(0, byteWidth, 0) -def FixedSizeBinaryEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/FixedSizeList.py b/python/generated/org/apache/arrow/flatbuf/FixedSizeList.py deleted file mode 100644 index 0d64595c9ba50..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/FixedSizeList.py +++ /dev/null @@ -1,33 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class FixedSizeList(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFixedSizeList(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = FixedSizeList() - x.Init(buf, n + offset) - return x - - # FixedSizeList - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Number of list items per value - # FixedSizeList - def ListSize(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - -def FixedSizeListStart(builder): builder.StartObject(1) -def FixedSizeListAddListSize(builder, listSize): builder.PrependInt32Slot(0, listSize, 0) -def FixedSizeListEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/FloatingPoint.py b/python/generated/org/apache/arrow/flatbuf/FloatingPoint.py deleted file mode 100644 index 77f9d1291e966..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/FloatingPoint.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class FloatingPoint(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsFloatingPoint(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = FloatingPoint() - x.Init(buf, n + offset) - return x - - # FloatingPoint - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # FloatingPoint - def Precision(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 0 - -def FloatingPointStart(builder): builder.StartObject(1) -def FloatingPointAddPrecision(builder, precision): builder.PrependInt16Slot(0, precision, 0) -def FloatingPointEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Int.py b/python/generated/org/apache/arrow/flatbuf/Int.py deleted file mode 100644 index cdd4ffe6d2ee6..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Int.py +++ /dev/null @@ -1,40 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Int(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInt(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Int() - x.Init(buf, n + offset) - return x - - # Int - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Int - def BitWidth(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - - # Int - def IsSigned(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) - return False - -def IntStart(builder): builder.StartObject(2) -def IntAddBitWidth(builder, bitWidth): builder.PrependInt32Slot(0, bitWidth, 0) -def IntAddIsSigned(builder, isSigned): builder.PrependBoolSlot(1, isSigned, 0) -def IntEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Interval.py b/python/generated/org/apache/arrow/flatbuf/Interval.py deleted file mode 100644 index 7752c14b65996..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Interval.py +++ /dev/null @@ -1,32 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class Interval(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsInterval(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Interval() - x.Init(buf, n + offset) - return x - - # Interval - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Interval - def Unit(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 0 - -def IntervalStart(builder): builder.StartObject(1) -def IntervalAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 0) -def IntervalEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/IntervalUnit.py b/python/generated/org/apache/arrow/flatbuf/IntervalUnit.py deleted file mode 100644 index f5abddb0e6419..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/IntervalUnit.py +++ /dev/null @@ -1,8 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class IntervalUnit(object): - YEAR_MONTH = 0 - DAY_TIME = 1 - diff --git a/python/generated/org/apache/arrow/flatbuf/KeyValue.py b/python/generated/org/apache/arrow/flatbuf/KeyValue.py deleted file mode 100644 index 8b70825f6ec53..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/KeyValue.py +++ /dev/null @@ -1,43 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# ---------------------------------------------------------------------- -# user defined key value pairs to add custom metadata to arrow -# key namespacing is the responsibility of the user -class KeyValue(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsKeyValue(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = KeyValue() - x.Init(buf, n + offset) - return x - - # KeyValue - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # KeyValue - def Key(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - - # KeyValue - def Value(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def KeyValueStart(builder): builder.StartObject(2) -def KeyValueAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0) -def KeyValueAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) -def KeyValueEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/LargeBinary.py b/python/generated/org/apache/arrow/flatbuf/LargeBinary.py deleted file mode 100644 index 3e8db74ab220e..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/LargeBinary.py +++ /dev/null @@ -1,26 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Same as Binary, but with 64-bit offsets, allowing to represent -# extremely large data values. -class LargeBinary(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsLargeBinary(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = LargeBinary() - x.Init(buf, n + offset) - return x - - # LargeBinary - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def LargeBinaryStart(builder): builder.StartObject(0) -def LargeBinaryEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/LargeList.py b/python/generated/org/apache/arrow/flatbuf/LargeList.py deleted file mode 100644 index 43419f07f9157..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/LargeList.py +++ /dev/null @@ -1,26 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Same as List, but with 64-bit offsets, allowing to represent -# extremely large data values. -class LargeList(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsLargeList(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = LargeList() - x.Init(buf, n + offset) - return x - - # LargeList - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def LargeListStart(builder): builder.StartObject(0) -def LargeListEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/LargeUtf8.py b/python/generated/org/apache/arrow/flatbuf/LargeUtf8.py deleted file mode 100644 index 744d73183bb6b..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/LargeUtf8.py +++ /dev/null @@ -1,26 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Same as Utf8, but with 64-bit offsets, allowing to represent -# extremely large data values. -class LargeUtf8(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsLargeUtf8(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = LargeUtf8() - x.Init(buf, n + offset) - return x - - # LargeUtf8 - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def LargeUtf8Start(builder): builder.StartObject(0) -def LargeUtf8End(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/List.py b/python/generated/org/apache/arrow/flatbuf/List.py deleted file mode 100644 index 84e3cdd015fd1..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/List.py +++ /dev/null @@ -1,24 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -class List(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsList(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = List() - x.Init(buf, n + offset) - return x - - # List - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def ListStart(builder): builder.StartObject(0) -def ListEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Map.py b/python/generated/org/apache/arrow/flatbuf/Map.py deleted file mode 100644 index d3187bff1fb9c..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Map.py +++ /dev/null @@ -1,58 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A Map is a logical nested type that is represented as -# -# List> -# -# In this layout, the keys and values are each respectively contiguous. We do -# not constrain the key and value types, so the application is responsible -# for ensuring that the keys are hashable and unique. Whether the keys are sorted -# may be set in the metadata for this field. -# -# In a field with Map type, the field has a child Struct field, which then -# has two children: key type and the second the value type. The names of the -# child fields may be respectively "entries", "key", and "value", but this is -# not enforced. -# -# Map -# ```text -# - child[0] entries: Struct -# - child[0] key: K -# - child[1] value: V -# ``` -# Neither the "entries" field nor the "key" field may be nullable. -# -# The metadata is structured so that Arrow systems without special handling -# for Map can make Map an alias for List. The "layout" attribute for the Map -# field must have the same contents as a List. -class Map(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsMap(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Map() - x.Init(buf, n + offset) - return x - - # Map - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Set to true if the keys within each value are sorted - # Map - def KeysSorted(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) - return False - -def MapStart(builder): builder.StartObject(1) -def MapAddKeysSorted(builder, keysSorted): builder.PrependBoolSlot(0, keysSorted, 0) -def MapEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/MetadataVersion.py b/python/generated/org/apache/arrow/flatbuf/MetadataVersion.py deleted file mode 100644 index 5a3bd806c9e11..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/MetadataVersion.py +++ /dev/null @@ -1,22 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class MetadataVersion(object): - # 0.1.0 (October 2016). - V1 = 0 - # 0.2.0 (February 2017). Non-backwards compatible with V1. - V2 = 1 - # 0.3.0 -> 0.7.1 (May - December 2017). Non-backwards compatible with V2. - V3 = 2 - # >= 0.8.0 (December 2017). Non-backwards compatible with V3. - V4 = 3 - # >= 1.0.0 (July 2020. Backwards compatible with V4 (V5 readers can read V4 - # metadata and IPC messages). Implementations are recommended to provide a - # V4 compatibility mode with V5 format changes disabled. - # - # Incompatible changes between V4 and V5: - # - Union buffer layout has changed. In V5, Unions don't have a validity - # bitmap buffer. - V5 = 4 - diff --git a/python/generated/org/apache/arrow/flatbuf/Null.py b/python/generated/org/apache/arrow/flatbuf/Null.py deleted file mode 100644 index a6dcc0f7559fd..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Null.py +++ /dev/null @@ -1,25 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# These are stored in the flatbuffer in the Type union below -class Null(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsNull(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Null() - x.Init(buf, n + offset) - return x - - # Null - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def NullStart(builder): builder.StartObject(0) -def NullEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Precision.py b/python/generated/org/apache/arrow/flatbuf/Precision.py deleted file mode 100644 index 655d0f5ea4f59..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Precision.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class Precision(object): - HALF = 0 - SINGLE = 1 - DOUBLE = 2 - diff --git a/python/generated/org/apache/arrow/flatbuf/Schema.py b/python/generated/org/apache/arrow/flatbuf/Schema.py deleted file mode 100644 index 394e784979071..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Schema.py +++ /dev/null @@ -1,121 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# ---------------------------------------------------------------------- -# A Schema describes the columns in a row batch -class Schema(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsSchema(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Schema() - x.Init(buf, n + offset) - return x - - # Schema - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # endianness of the buffer - # it is Little Endian by default - # if endianness doesn't match the underlying system then the vectors need to be converted - # Schema - def Endianness(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 0 - - # Schema - def Fields(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.flatbuf.Field import Field - obj = Field() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Schema - def FieldsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Schema - def FieldsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - return o == 0 - - # Schema - def CustomMetadata(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - x = self._tab.Vector(o) - x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 - x = self._tab.Indirect(x) - from org.apache.arrow.flatbuf.KeyValue import KeyValue - obj = KeyValue() - obj.Init(self._tab.Bytes, x) - return obj - return None - - # Schema - def CustomMetadataLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Schema - def CustomMetadataIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - return o == 0 - - # Features used in the stream/file. - # Schema - def Features(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) - return 0 - - # Schema - def FeaturesAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o) - return 0 - - # Schema - def FeaturesLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Schema - def FeaturesIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - return o == 0 - -def SchemaStart(builder): builder.StartObject(4) -def SchemaAddEndianness(builder, endianness): builder.PrependInt16Slot(0, endianness, 0) -def SchemaAddFields(builder, fields): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(fields), 0) -def SchemaStartFieldsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def SchemaAddCustomMetadata(builder, customMetadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(customMetadata), 0) -def SchemaStartCustomMetadataVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def SchemaAddFeatures(builder, features): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(features), 0) -def SchemaStartFeaturesVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def SchemaEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Struct_.py b/python/generated/org/apache/arrow/flatbuf/Struct_.py deleted file mode 100644 index 889b171bf40f5..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Struct_.py +++ /dev/null @@ -1,27 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A Struct_ in the flatbuffer metadata is the same as an Arrow Struct -# (according to the physical memory layout). We used Struct_ here as -# Struct is a reserved word in Flatbuffers -class Struct_(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsStruct_(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Struct_() - x.Init(buf, n + offset) - return x - - # Struct_ - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def Struct_Start(builder): builder.StartObject(0) -def Struct_End(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Time.py b/python/generated/org/apache/arrow/flatbuf/Time.py deleted file mode 100644 index 5f9a663aa9291..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Time.py +++ /dev/null @@ -1,43 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Time type. The physical storage type depends on the unit -# - SECOND and MILLISECOND: 32 bits -# - MICROSECOND and NANOSECOND: 64 bits -class Time(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsTime(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Time() - x.Init(buf, n + offset) - return x - - # Time - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Time - def Unit(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 1 - - # Time - def BitWidth(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 32 - -def TimeStart(builder): builder.StartObject(2) -def TimeAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 1) -def TimeAddBitWidth(builder, bitWidth): builder.PrependInt32Slot(1, bitWidth, 32) -def TimeEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/TimeUnit.py b/python/generated/org/apache/arrow/flatbuf/TimeUnit.py deleted file mode 100644 index 1ebf9b72f3e37..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/TimeUnit.py +++ /dev/null @@ -1,10 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class TimeUnit(object): - SECOND = 0 - MILLISECOND = 1 - MICROSECOND = 2 - NANOSECOND = 3 - diff --git a/python/generated/org/apache/arrow/flatbuf/Timestamp.py b/python/generated/org/apache/arrow/flatbuf/Timestamp.py deleted file mode 100644 index 606594abfff2b..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Timestamp.py +++ /dev/null @@ -1,89 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Time elapsed from the Unix epoch, 00:00:00.000 on 1 January 1970, excluding -# leap seconds, as a 64-bit integer. Note that UNIX time does not include -# leap seconds. -# -# Date & time libraries often have multiple different data types for temporal -# data. In order to ease interoperability between different implementations the -# Arrow project has some recommendations for encoding these types into a Timestamp -# column. -# -# An "instant" represents a single moment in time that has no meaningful time zone -# or the time zone is unknown. A column of instants can also contain values from -# multiple time zones. To encode an instant set the timezone string to "UTC". -# -# A "zoned date-time" represents a single moment in time that has a meaningful -# reference time zone. To encode a zoned date-time as a Timestamp set the timezone -# string to the name of the timezone. There is some ambiguity between an instant -# and a zoned date-time with the UTC time zone. Both of these are stored the same. -# Typically, this distinction does not matter. If it does, then an application should -# use custom metadata or an extension type to distinguish between the two cases. -# -# An "offset date-time" represents a single moment in time combined with a meaningful -# offset from UTC. To encode an offset date-time as a Timestamp set the timezone string -# to the numeric time zone offset string (e.g. "+03:00"). -# -# A "local date-time" does not represent a single moment in time. It represents a wall -# clock time combined with a date. Because of daylight savings time there may multiple -# instants that correspond to a single local date-time in any given time zone. A -# local date-time is often stored as a struct or a Date32/Time64 pair. However, it can -# also be encoded into a Timestamp column. To do so the value should be the the time -# elapsed from the Unix epoch so that a wall clock in UTC would display the desired time. -# The timezone string should be set to null or the empty string. -class Timestamp(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsTimestamp(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Timestamp() - x.Init(buf, n + offset) - return x - - # Timestamp - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Timestamp - def Unit(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 0 - - # The time zone is a string indicating the name of a time zone, one of: - # - # * As used in the Olson time zone database (the "tz database" or - # "tzdata"), such as "America/New_York" - # * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30 - # - # Whether a timezone string is present indicates different semantics about - # the data: - # - # * If the time zone is null or an empty string, the data is a local date-time - # and does not represent a single moment in time. Instead it represents a wall clock - # time and care should be taken to avoid interpreting it semantically as an instant. - # - # * If the time zone is set to a valid value, values can be displayed as - # "localized" to that time zone, even though the underlying 64-bit - # integers are identical to the same data stored in UTC. Converting - # between time zones is a metadata-only operation and does not change the - # underlying values - # Timestamp - def Timezone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def TimestampStart(builder): builder.StartObject(2) -def TimestampAddUnit(builder, unit): builder.PrependInt16Slot(0, unit, 0) -def TimestampAddTimezone(builder, timezone): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(timezone), 0) -def TimestampEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/Type.py b/python/generated/org/apache/arrow/flatbuf/Type.py deleted file mode 100644 index 4057739760a73..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Type.py +++ /dev/null @@ -1,31 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -# ---------------------------------------------------------------------- -# Top-level Type value, enabling extensible type-specific metadata. We can -# add new logical types to Type without breaking backwards compatibility -class Type(object): - NONE = 0 - Null = 1 - Int = 2 - FloatingPoint = 3 - Binary = 4 - Utf8 = 5 - Bool = 6 - Decimal = 7 - Date = 8 - Time = 9 - Timestamp = 10 - Interval = 11 - List = 12 - Struct_ = 13 - Union = 14 - FixedSizeBinary = 15 - FixedSizeList = 16 - Map = 17 - Duration = 18 - LargeBinary = 19 - LargeUtf8 = 20 - LargeList = 21 - diff --git a/python/generated/org/apache/arrow/flatbuf/Union.py b/python/generated/org/apache/arrow/flatbuf/Union.py deleted file mode 100644 index 406b7f25f1ee6..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Union.py +++ /dev/null @@ -1,65 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# A union is a complex type with children in Field -# By default ids in the type vector refer to the offsets in the children -# optionally typeIds provides an indirection between the child offset and the type id -# for each child `typeIds[offset]` is the id used in the type vector -class Union(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUnion(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Union() - x.Init(buf, n + offset) - return x - - # Union - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - - # Union - def Mode(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos) - return 0 - - # Union - def TypeIds(self, j): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - a = self._tab.Vector(o) - return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) - return 0 - - # Union - def TypeIdsAsNumpy(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) - return 0 - - # Union - def TypeIdsLength(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - if o != 0: - return self._tab.VectorLen(o) - return 0 - - # Union - def TypeIdsIsNone(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) - return o == 0 - -def UnionStart(builder): builder.StartObject(2) -def UnionAddMode(builder, mode): builder.PrependInt16Slot(0, mode, 0) -def UnionAddTypeIds(builder, typeIds): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(typeIds), 0) -def UnionStartTypeIdsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def UnionEnd(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/UnionMode.py b/python/generated/org/apache/arrow/flatbuf/UnionMode.py deleted file mode 100644 index f698907667575..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/UnionMode.py +++ /dev/null @@ -1,8 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -class UnionMode(object): - Sparse = 0 - Dense = 1 - diff --git a/python/generated/org/apache/arrow/flatbuf/Utf8.py b/python/generated/org/apache/arrow/flatbuf/Utf8.py deleted file mode 100644 index 0c2ccc9394586..0000000000000 --- a/python/generated/org/apache/arrow/flatbuf/Utf8.py +++ /dev/null @@ -1,25 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: flatbuf - -import flatbuffers -from flatbuffers.compat import import_numpy -np = import_numpy() - -# Unicode with UTF-8 encoding -class Utf8(object): - __slots__ = ['_tab'] - - @classmethod - def GetRootAsUtf8(cls, buf, offset): - n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) - x = Utf8() - x.Init(buf, n + offset) - return x - - # Utf8 - def Init(self, buf, pos): - self._tab = flatbuffers.table.Table(buf, pos) - -def Utf8Start(builder): builder.StartObject(0) -def Utf8End(builder): return builder.EndObject() diff --git a/python/generated/org/apache/arrow/flatbuf/__init__.py b/python/generated/org/apache/arrow/flatbuf/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 76d77012d10a4d2e6a6658f3d7b76d23eae0885d Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 17:47:23 -0400 Subject: [PATCH 36/96] Remove generated C++ code for now --- .../ComputeIR.ExampleExtensions_generated.h | 693 --- cpp/src/generated/ComputeIR_generated.h | 4386 ----------------- .../generated/ExampleExtensions_generated.h | 691 --- cpp/src/generated/Expression_generated.h | 2657 ---------- cpp/src/generated/InlineBuffer_generated.h | 987 ---- cpp/src/generated/Literal_generated.h | 1981 -------- cpp/src/generated/Plan_generated.h | 132 - cpp/src/generated/Relation_generated.h | 2049 -------- 8 files changed, 13576 deletions(-) delete mode 100644 cpp/src/generated/ComputeIR.ExampleExtensions_generated.h delete mode 100644 cpp/src/generated/ComputeIR_generated.h delete mode 100644 cpp/src/generated/ExampleExtensions_generated.h delete mode 100644 cpp/src/generated/Expression_generated.h delete mode 100644 cpp/src/generated/InlineBuffer_generated.h delete mode 100644 cpp/src/generated/Literal_generated.h delete mode 100644 cpp/src/generated/Plan_generated.h delete mode 100644 cpp/src/generated/Relation_generated.h diff --git a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h b/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h deleted file mode 100644 index 29ff7d5e434a5..0000000000000 --- a/cpp/src/generated/ComputeIR.ExampleExtensions_generated.h +++ /dev/null @@ -1,693 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ -#define FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ - -#include "flatbuffers/flatbuffers.h" - -#include "Schema_generated.h" -#include "ComputeIR_generated.h" -#include "IRLiteral_generated.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { -namespace ext { - -struct Uri; -struct UriBuilder; - -struct Sql_FromOptions; -struct Sql_FromOptionsBuilder; - -struct Partitioning; -struct PartitioningBuilder; - -struct FileFormat; -struct FileFormatBuilder; - -struct Arrow_FileSystemDatasetScanOptions; -struct Arrow_FileSystemDatasetScanOptionsBuilder; - -struct Sql_IntoOptions; -struct Sql_IntoOptionsBuilder; - -struct Arrow_StreamOutOptions; -struct Arrow_StreamOutOptionsBuilder; - -struct Arrow_FileSystemDatasetWriteOptions; -struct Arrow_FileSystemDatasetWriteOptionsBuilder; - -///////////////////////////////////////////////////////////// -struct Uri FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UriBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SCHEMA = 4, - VT_USERINFO = 6, - VT_HOST = 8, - VT_PORT = 10, - VT_PATH = 12, - VT_QUERY = 14, - VT_FRAGMENT = 16 - }; - const flatbuffers::String *schema() const { - return GetPointer(VT_SCHEMA); - } - const flatbuffers::String *userinfo() const { - return GetPointer(VT_USERINFO); - } - const flatbuffers::String *host() const { - return GetPointer(VT_HOST); - } - uint16_t port() const { - return GetField(VT_PORT, 0); - } - const flatbuffers::String *path() const { - return GetPointer(VT_PATH); - } - const flatbuffers::Vector> *query() const { - return GetPointer> *>(VT_QUERY); - } - const flatbuffers::String *fragment() const { - return GetPointer(VT_FRAGMENT); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyString(schema()) && - VerifyOffset(verifier, VT_USERINFO) && - verifier.VerifyString(userinfo()) && - VerifyOffsetRequired(verifier, VT_HOST) && - verifier.VerifyString(host()) && - VerifyField(verifier, VT_PORT) && - VerifyOffsetRequired(verifier, VT_PATH) && - verifier.VerifyString(path()) && - VerifyOffset(verifier, VT_QUERY) && - verifier.VerifyVector(query()) && - verifier.VerifyVectorOfTables(query()) && - VerifyOffset(verifier, VT_FRAGMENT) && - verifier.VerifyString(fragment()) && - verifier.EndTable(); - } -}; - -struct UriBuilder { - typedef Uri Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Uri::VT_SCHEMA, schema); - } - void add_userinfo(flatbuffers::Offset userinfo) { - fbb_.AddOffset(Uri::VT_USERINFO, userinfo); - } - void add_host(flatbuffers::Offset host) { - fbb_.AddOffset(Uri::VT_HOST, host); - } - void add_port(uint16_t port) { - fbb_.AddElement(Uri::VT_PORT, port, 0); - } - void add_path(flatbuffers::Offset path) { - fbb_.AddOffset(Uri::VT_PATH, path); - } - void add_query(flatbuffers::Offset>> query) { - fbb_.AddOffset(Uri::VT_QUERY, query); - } - void add_fragment(flatbuffers::Offset fragment) { - fbb_.AddOffset(Uri::VT_FRAGMENT, fragment); - } - explicit UriBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UriBuilder &operator=(const UriBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Uri::VT_SCHEMA); - fbb_.Required(o, Uri::VT_HOST); - fbb_.Required(o, Uri::VT_PATH); - return o; - } -}; - -inline flatbuffers::Offset CreateUri( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset schema = 0, - flatbuffers::Offset userinfo = 0, - flatbuffers::Offset host = 0, - uint16_t port = 0, - flatbuffers::Offset path = 0, - flatbuffers::Offset>> query = 0, - flatbuffers::Offset fragment = 0) { - UriBuilder builder_(_fbb); - builder_.add_fragment(fragment); - builder_.add_query(query); - builder_.add_path(path); - builder_.add_host(host); - builder_.add_userinfo(userinfo); - builder_.add_schema(schema); - builder_.add_port(port); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUriDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *schema = nullptr, - const char *userinfo = nullptr, - const char *host = nullptr, - uint16_t port = 0, - const char *path = nullptr, - const std::vector> *query = nullptr, - const char *fragment = nullptr) { - auto schema__ = schema ? _fbb.CreateString(schema) : 0; - auto userinfo__ = userinfo ? _fbb.CreateString(userinfo) : 0; - auto host__ = host ? _fbb.CreateString(host) : 0; - auto path__ = path ? _fbb.CreateString(path) : 0; - auto query__ = query ? _fbb.CreateVector>(*query) : 0; - auto fragment__ = fragment ? _fbb.CreateString(fragment) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateUri( - _fbb, - schema__, - userinfo__, - host__, - port, - path__, - query__, - fragment__); -} - -/// The contents of Relation.options will be Sql_FromOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "sql", -/// .name = "from", -/// } -struct Sql_FromOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Sql_FromOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME = 4 - }; - /// The name of a table referenced as a source relation. - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct Sql_FromOptionsBuilder { - typedef Sql_FromOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(Sql_FromOptions::VT_NAME, name); - } - explicit Sql_FromOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Sql_FromOptionsBuilder &operator=(const Sql_FromOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Sql_FromOptions::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateSql_FromOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name = 0) { - Sql_FromOptionsBuilder builder_(_fbb); - builder_.add_name(name); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateSql_FromOptionsDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name = nullptr) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateSql_FromOptions( - _fbb, - name__); -} - -struct Partitioning FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef PartitioningBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_FLAVOR = 4, - VT_SCHEMA = 6 - }; - /// Currently supported: "hive", "directory" - const flatbuffers::String *flavor() const { - return GetPointer(VT_FLAVOR); - } - /// Fields on which data is partitioned - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_FLAVOR) && - verifier.VerifyString(flavor()) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - verifier.EndTable(); - } -}; - -struct PartitioningBuilder { - typedef Partitioning Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_flavor(flatbuffers::Offset flavor) { - fbb_.AddOffset(Partitioning::VT_FLAVOR, flavor); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Partitioning::VT_SCHEMA, schema); - } - explicit PartitioningBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - PartitioningBuilder &operator=(const PartitioningBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Partitioning::VT_FLAVOR); - fbb_.Required(o, Partitioning::VT_SCHEMA); - return o; - } -}; - -inline flatbuffers::Offset CreatePartitioning( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset flavor = 0, - flatbuffers::Offset schema = 0) { - PartitioningBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_flavor(flavor); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreatePartitioningDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *flavor = nullptr, - flatbuffers::Offset schema = 0) { - auto flavor__ = flavor ? _fbb.CreateString(flavor) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreatePartitioning( - _fbb, - flavor__, - schema); -} - -struct FileFormat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FileFormatBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME = 4, - VT_OPTIONS = 6 - }; - /// E.g. "parquet", "csv", ... - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - const org::apache::arrow::flatbuf::Buffer *options() const { - return GetStruct(VT_OPTIONS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - VerifyField(verifier, VT_OPTIONS) && - verifier.EndTable(); - } -}; - -struct FileFormatBuilder { - typedef FileFormat Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(FileFormat::VT_NAME, name); - } - void add_options(const org::apache::arrow::flatbuf::Buffer *options) { - fbb_.AddStruct(FileFormat::VT_OPTIONS, options); - } - explicit FileFormatBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FileFormatBuilder &operator=(const FileFormatBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, FileFormat::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateFileFormat( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name = 0, - const org::apache::arrow::flatbuf::Buffer *options = 0) { - FileFormatBuilder builder_(_fbb); - builder_.add_options(options); - builder_.add_name(name); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateFileFormatDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name = nullptr, - const org::apache::arrow::flatbuf::Buffer *options = 0) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateFileFormat( - _fbb, - name__, - options); -} - -/// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "arrow", -/// .name = "filesystem_dataset_scan", -/// } -struct Arrow_FileSystemDatasetScanOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Arrow_FileSystemDatasetScanOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE_DIR = 4, - VT_FORMAT = 6, - VT_PARTITIONING = 8 - }; - /// The base directory of a dataset which should be scanned - /// as a source relation. A URI is used to accommodate potentially - /// remote file systems. - const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { - return GetPointer(VT_BASE_DIR); - } - /// The format of files in this dataset. - const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { - return GetPointer(VT_FORMAT); - } - /// A partitioning scheme in use in this dataset. - const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { - return GetPointer(VT_PARTITIONING); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE_DIR) && - verifier.VerifyTable(base_dir()) && - VerifyOffsetRequired(verifier, VT_FORMAT) && - verifier.VerifyTable(format()) && - VerifyOffset(verifier, VT_PARTITIONING) && - verifier.VerifyTable(partitioning()) && - verifier.EndTable(); - } -}; - -struct Arrow_FileSystemDatasetScanOptionsBuilder { - typedef Arrow_FileSystemDatasetScanOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base_dir(flatbuffers::Offset base_dir) { - fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR, base_dir); - } - void add_format(flatbuffers::Offset format) { - fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_FORMAT, format); - } - void add_partitioning(flatbuffers::Offset partitioning) { - fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_PARTITIONING, partitioning); - } - explicit Arrow_FileSystemDatasetScanOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Arrow_FileSystemDatasetScanOptionsBuilder &operator=(const Arrow_FileSystemDatasetScanOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR); - fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_FORMAT); - return o; - } -}; - -inline flatbuffers::Offset CreateArrow_FileSystemDatasetScanOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0) { - Arrow_FileSystemDatasetScanOptionsBuilder builder_(_fbb); - builder_.add_partitioning(partitioning); - builder_.add_format(format); - builder_.add_base_dir(base_dir); - return builder_.Finish(); -} - -///////////////////////////////////////////////////////////// -/// The contents of Relation.options will be Sql_IntoOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "sql", -/// .name = "into", -/// } -struct Sql_IntoOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Sql_IntoOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME = 4, - VT_APPEND = 6 - }; - /// The name of a table into which rows will be inserted. - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - /// Whether rows written into the table should be appended - /// to the table's current rows (INSERT INTO). - /// If false, the table will be overwritten (INTO). - bool append() const { - return GetField(VT_APPEND, 1) != 0; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - VerifyField(verifier, VT_APPEND) && - verifier.EndTable(); - } -}; - -struct Sql_IntoOptionsBuilder { - typedef Sql_IntoOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(Sql_IntoOptions::VT_NAME, name); - } - void add_append(bool append) { - fbb_.AddElement(Sql_IntoOptions::VT_APPEND, static_cast(append), 1); - } - explicit Sql_IntoOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Sql_IntoOptionsBuilder &operator=(const Sql_IntoOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Sql_IntoOptions::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateSql_IntoOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name = 0, - bool append = true) { - Sql_IntoOptionsBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_append(append); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateSql_IntoOptionsDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name = nullptr, - bool append = true) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateSql_IntoOptions( - _fbb, - name__, - append); -} - -/// The contents of Relation.options will be Arrow_StreamOutOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "arrow", -/// .name = "stream_out", -/// } -struct Arrow_StreamOutOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Arrow_StreamOutOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_DESTINATION = 4 - }; - /// The URI to which RecordBatches of output should be streamed. - const org::apache::arrow::computeir::flatbuf::ext::Uri *destination() const { - return GetPointer(VT_DESTINATION); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_DESTINATION) && - verifier.VerifyTable(destination()) && - verifier.EndTable(); - } -}; - -struct Arrow_StreamOutOptionsBuilder { - typedef Arrow_StreamOutOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_destination(flatbuffers::Offset destination) { - fbb_.AddOffset(Arrow_StreamOutOptions::VT_DESTINATION, destination); - } - explicit Arrow_StreamOutOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Arrow_StreamOutOptionsBuilder &operator=(const Arrow_StreamOutOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Arrow_StreamOutOptions::VT_DESTINATION); - return o; - } -}; - -inline flatbuffers::Offset CreateArrow_StreamOutOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset destination = 0) { - Arrow_StreamOutOptionsBuilder builder_(_fbb); - builder_.add_destination(destination); - return builder_.Finish(); -} - -/// The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "arrow", -/// .name = "filesystem_dataset_write", -/// } -struct Arrow_FileSystemDatasetWriteOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Arrow_FileSystemDatasetWriteOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE_DIR = 4, - VT_FORMAT = 6, - VT_PARTITIONING = 8, - VT_BASENAME_TEMPLATE = 10 - }; - /// The base directory of a dataset into which output batches should be - /// written. A URI is used to accommodate potentially remote file systems. - /// Files present in this directory will not be explicitly deleted, though - /// they may be overwritten. - const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { - return GetPointer(VT_BASE_DIR); - } - /// The format in which to write files. - const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { - return GetPointer(VT_FORMAT); - } - /// A partitioning scheme which should be used when writing this dataset. - const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { - return GetPointer(VT_PARTITIONING); - } - /// Template string used to generate written files' basenames. - /// {i} will be replaced by an auto incremented integer. - const flatbuffers::String *basename_template() const { - return GetPointer(VT_BASENAME_TEMPLATE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE_DIR) && - verifier.VerifyTable(base_dir()) && - VerifyOffsetRequired(verifier, VT_FORMAT) && - verifier.VerifyTable(format()) && - VerifyOffset(verifier, VT_PARTITIONING) && - verifier.VerifyTable(partitioning()) && - VerifyOffsetRequired(verifier, VT_BASENAME_TEMPLATE) && - verifier.VerifyString(basename_template()) && - verifier.EndTable(); - } -}; - -struct Arrow_FileSystemDatasetWriteOptionsBuilder { - typedef Arrow_FileSystemDatasetWriteOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base_dir(flatbuffers::Offset base_dir) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR, base_dir); - } - void add_format(flatbuffers::Offset format) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_FORMAT, format); - } - void add_partitioning(flatbuffers::Offset partitioning) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_PARTITIONING, partitioning); - } - void add_basename_template(flatbuffers::Offset basename_template) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE, basename_template); - } - explicit Arrow_FileSystemDatasetWriteOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Arrow_FileSystemDatasetWriteOptionsBuilder &operator=(const Arrow_FileSystemDatasetWriteOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR); - fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_FORMAT); - fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE); - return o; - } -}; - -inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0, - flatbuffers::Offset basename_template = 0) { - Arrow_FileSystemDatasetWriteOptionsBuilder builder_(_fbb); - builder_.add_basename_template(basename_template); - builder_.add_partitioning(partitioning); - builder_.add_format(format); - builder_.add_base_dir(base_dir); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptionsDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0, - const char *basename_template = nullptr) { - auto basename_template__ = basename_template ? _fbb.CreateString(basename_template) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateArrow_FileSystemDatasetWriteOptions( - _fbb, - base_dir, - format, - partitioning, - basename_template__); -} - -} // namespace ext -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_COMPUTEIREXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ diff --git a/cpp/src/generated/ComputeIR_generated.h b/cpp/src/generated/ComputeIR_generated.h deleted file mode 100644 index b9f484ec1f248..0000000000000 --- a/cpp/src/generated/ComputeIR_generated.h +++ /dev/null @@ -1,4386 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ -#define FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ - -#include "flatbuffers/flatbuffers.h" - -#include "Schema_generated.h" -#include "IRLiteral_generated.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { - -struct Int8Buffer; -struct Int8BufferBuilder; - -struct Int16Buffer; -struct Int16BufferBuilder; - -struct Int32Buffer; -struct Int32BufferBuilder; - -struct Int64Buffer; -struct Int64BufferBuilder; - -struct UInt8Buffer; -struct UInt8BufferBuilder; - -struct UInt16Buffer; -struct UInt16BufferBuilder; - -struct UInt32Buffer; -struct UInt32BufferBuilder; - -struct UInt64Buffer; -struct UInt64BufferBuilder; - -struct Float32Buffer; -struct Float32BufferBuilder; - -struct Float64Buffer; -struct Float64BufferBuilder; - -struct TableBuffer; -struct TableBufferBuilder; - -struct InlineBuffer; -struct InlineBufferBuilder; - -struct Expression; -struct ExpressionBuilder; - -struct Scalar; -struct ScalarBuilder; - -struct Array; -struct ArrayBuilder; - -struct MapKey; -struct MapKeyBuilder; - -struct StructField; -struct StructFieldBuilder; - -struct ArraySubscript; -struct ArraySubscriptBuilder; - -struct ArraySlice; -struct ArraySliceBuilder; - -struct FieldName; -struct FieldNameBuilder; - -struct FieldRef; -struct FieldRefBuilder; - -struct CanonicalFunction; -struct CanonicalFunctionBuilder; - -struct NonCanonicalFunction; -struct NonCanonicalFunctionBuilder; - -struct Call; -struct CallBuilder; - -struct Remap; -struct RemapBuilder; - -struct PassThrough; -struct PassThroughBuilder; - -struct RelBase; -struct RelBaseBuilder; - -struct Filter; -struct FilterBuilder; - -struct Project; -struct ProjectBuilder; - -struct Aggregate; -struct AggregateBuilder; - -struct CanonicalJoinKind; -struct CanonicalJoinKindBuilder; - -struct NonCanonicalJoinKind; -struct NonCanonicalJoinKindBuilder; - -struct Join; -struct JoinBuilder; - -struct SortKey; -struct SortKeyBuilder; - -struct OrderBy; -struct OrderByBuilder; - -struct Limit; -struct LimitBuilder; - -struct Common; -struct CommonBuilder; - -struct CanonicalSetOpKind; -struct CanonicalSetOpKindBuilder; - -struct NonCanonicalSetOpKind; -struct NonCanonicalSetOpKindBuilder; - -struct SetOperation; -struct SetOperationBuilder; - -struct LiteralRelation; -struct LiteralRelationBuilder; - -struct Custom; -struct CustomBuilder; - -struct Read; -struct ReadBuilder; - -struct Write; -struct WriteBuilder; - -struct Relation; -struct RelationBuilder; - -struct Plan; -struct PlanBuilder; - -enum class InlineBufferImpl : uint8_t { - NONE = 0, - Int8Buffer = 1, - Int16Buffer = 2, - Int32Buffer = 3, - Int64Buffer = 4, - UInt8Buffer = 5, - UInt16Buffer = 6, - UInt32Buffer = 7, - UInt64Buffer = 8, - Float32Buffer = 9, - Float64Buffer = 10, - TableBuffer = 11, - MIN = NONE, - MAX = TableBuffer -}; - -inline const InlineBufferImpl (&EnumValuesInlineBufferImpl())[12] { - static const InlineBufferImpl values[] = { - InlineBufferImpl::NONE, - InlineBufferImpl::Int8Buffer, - InlineBufferImpl::Int16Buffer, - InlineBufferImpl::Int32Buffer, - InlineBufferImpl::Int64Buffer, - InlineBufferImpl::UInt8Buffer, - InlineBufferImpl::UInt16Buffer, - InlineBufferImpl::UInt32Buffer, - InlineBufferImpl::UInt64Buffer, - InlineBufferImpl::Float32Buffer, - InlineBufferImpl::Float64Buffer, - InlineBufferImpl::TableBuffer - }; - return values; -} - -inline const char * const *EnumNamesInlineBufferImpl() { - static const char * const names[13] = { - "NONE", - "Int8Buffer", - "Int16Buffer", - "Int32Buffer", - "Int64Buffer", - "UInt8Buffer", - "UInt16Buffer", - "UInt32Buffer", - "UInt64Buffer", - "Float32Buffer", - "Float64Buffer", - "TableBuffer", - nullptr - }; - return names; -} - -inline const char *EnumNameInlineBufferImpl(InlineBufferImpl e) { - if (flatbuffers::IsOutRange(e, InlineBufferImpl::NONE, InlineBufferImpl::TableBuffer)) return ""; - const size_t index = static_cast(e); - return EnumNamesInlineBufferImpl()[index]; -} - -template struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::NONE; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int8Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int16Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int32Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int64Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt8Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt16Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt32Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt64Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Float32Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Float64Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::TableBuffer; -}; - -bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type); -bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// An expression is one of -/// - a Literal datum -/// - a reference to a field from a Relation -/// - a call to a named function -/// On evaluation, an Expression will have either array or scalar shape. -enum class ExpressionImpl : uint8_t { - NONE = 0, - Literal = 1, - FieldRef = 2, - Call = 3, - MIN = NONE, - MAX = Call -}; - -inline const ExpressionImpl (&EnumValuesExpressionImpl())[4] { - static const ExpressionImpl values[] = { - ExpressionImpl::NONE, - ExpressionImpl::Literal, - ExpressionImpl::FieldRef, - ExpressionImpl::Call - }; - return values; -} - -inline const char * const *EnumNamesExpressionImpl() { - static const char * const names[5] = { - "NONE", - "Literal", - "FieldRef", - "Call", - nullptr - }; - return names; -} - -inline const char *EnumNameExpressionImpl(ExpressionImpl e) { - if (flatbuffers::IsOutRange(e, ExpressionImpl::NONE, ExpressionImpl::Call)) return ""; - const size_t index = static_cast(e); - return EnumNamesExpressionImpl()[index]; -} - -template struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::NONE; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::Literal; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::FieldRef; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::Call; -}; - -bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type); -bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class Shape : uint8_t { - NONE = 0, - Array = 1, - Scalar = 2, - MIN = NONE, - MAX = Scalar -}; - -inline const Shape (&EnumValuesShape())[3] { - static const Shape values[] = { - Shape::NONE, - Shape::Array, - Shape::Scalar - }; - return values; -} - -inline const char * const *EnumNamesShape() { - static const char * const names[4] = { - "NONE", - "Array", - "Scalar", - nullptr - }; - return names; -} - -inline const char *EnumNameShape(Shape e) { - if (flatbuffers::IsOutRange(e, Shape::NONE, Shape::Scalar)) return ""; - const size_t index = static_cast(e); - return EnumNamesShape()[index]; -} - -template struct ShapeTraits { - static const Shape enum_value = Shape::NONE; -}; - -template<> struct ShapeTraits { - static const Shape enum_value = Shape::Array; -}; - -template<> struct ShapeTraits { - static const Shape enum_value = Shape::Scalar; -}; - -bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape type); -bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class Deref : uint8_t { - NONE = 0, - MapKey = 1, - StructField = 2, - ArraySubscript = 3, - ArraySlice = 4, - FieldName = 5, - MIN = NONE, - MAX = FieldName -}; - -inline const Deref (&EnumValuesDeref())[6] { - static const Deref values[] = { - Deref::NONE, - Deref::MapKey, - Deref::StructField, - Deref::ArraySubscript, - Deref::ArraySlice, - Deref::FieldName - }; - return values; -} - -inline const char * const *EnumNamesDeref() { - static const char * const names[7] = { - "NONE", - "MapKey", - "StructField", - "ArraySubscript", - "ArraySlice", - "FieldName", - nullptr - }; - return names; -} - -inline const char *EnumNameDeref(Deref e) { - if (flatbuffers::IsOutRange(e, Deref::NONE, Deref::FieldName)) return ""; - const size_t index = static_cast(e); - return EnumNamesDeref()[index]; -} - -template struct DerefTraits { - static const Deref enum_value = Deref::NONE; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::MapKey; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::StructField; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::ArraySubscript; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::ArraySlice; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::FieldName; -}; - -bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type); -bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// A canonical (probably SQL equivalent) function -enum class CanonicalFunctionId : uint32_t { - And = 0, - Not = 1, - Or = 2, - Add = 3, - Subtract = 4, - Multiply = 5, - Divide = 6, - Power = 7, - AbsoluteValue = 8, - Negate = 9, - Sign = 10, - Equals = 11, - NotEquals = 12, - Greater = 13, - GreaterEqual = 14, - Less = 15, - LessEqual = 16, - All = 17, - Any = 18, - Count = 19, - Mean = 20, - Min = 21, - Max = 22, - Product = 23, - Sum = 24, - Variance = 25, - StandardDeviation = 26, - Cast = 27, - Extract = 28, - Case = 29, - Coalesce = 30, - IsIn = 31, - MIN = And, - MAX = IsIn -}; - -inline const CanonicalFunctionId (&EnumValuesCanonicalFunctionId())[32] { - static const CanonicalFunctionId values[] = { - CanonicalFunctionId::And, - CanonicalFunctionId::Not, - CanonicalFunctionId::Or, - CanonicalFunctionId::Add, - CanonicalFunctionId::Subtract, - CanonicalFunctionId::Multiply, - CanonicalFunctionId::Divide, - CanonicalFunctionId::Power, - CanonicalFunctionId::AbsoluteValue, - CanonicalFunctionId::Negate, - CanonicalFunctionId::Sign, - CanonicalFunctionId::Equals, - CanonicalFunctionId::NotEquals, - CanonicalFunctionId::Greater, - CanonicalFunctionId::GreaterEqual, - CanonicalFunctionId::Less, - CanonicalFunctionId::LessEqual, - CanonicalFunctionId::All, - CanonicalFunctionId::Any, - CanonicalFunctionId::Count, - CanonicalFunctionId::Mean, - CanonicalFunctionId::Min, - CanonicalFunctionId::Max, - CanonicalFunctionId::Product, - CanonicalFunctionId::Sum, - CanonicalFunctionId::Variance, - CanonicalFunctionId::StandardDeviation, - CanonicalFunctionId::Cast, - CanonicalFunctionId::Extract, - CanonicalFunctionId::Case, - CanonicalFunctionId::Coalesce, - CanonicalFunctionId::IsIn - }; - return values; -} - -inline const char * const *EnumNamesCanonicalFunctionId() { - static const char * const names[33] = { - "And", - "Not", - "Or", - "Add", - "Subtract", - "Multiply", - "Divide", - "Power", - "AbsoluteValue", - "Negate", - "Sign", - "Equals", - "NotEquals", - "Greater", - "GreaterEqual", - "Less", - "LessEqual", - "All", - "Any", - "Count", - "Mean", - "Min", - "Max", - "Product", - "Sum", - "Variance", - "StandardDeviation", - "Cast", - "Extract", - "Case", - "Coalesce", - "IsIn", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalFunctionId(CanonicalFunctionId e) { - if (flatbuffers::IsOutRange(e, CanonicalFunctionId::And, CanonicalFunctionId::IsIn)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalFunctionId()[index]; -} - -enum class FunctionImpl : uint8_t { - NONE = 0, - CanonicalFunction = 1, - NonCanonicalFunction = 2, - MIN = NONE, - MAX = NonCanonicalFunction -}; - -inline const FunctionImpl (&EnumValuesFunctionImpl())[3] { - static const FunctionImpl values[] = { - FunctionImpl::NONE, - FunctionImpl::CanonicalFunction, - FunctionImpl::NonCanonicalFunction - }; - return values; -} - -inline const char * const *EnumNamesFunctionImpl() { - static const char * const names[4] = { - "NONE", - "CanonicalFunction", - "NonCanonicalFunction", - nullptr - }; - return names; -} - -inline const char *EnumNameFunctionImpl(FunctionImpl e) { - if (flatbuffers::IsOutRange(e, FunctionImpl::NONE, FunctionImpl::NonCanonicalFunction)) return ""; - const size_t index = static_cast(e); - return EnumNamesFunctionImpl()[index]; -} - -template struct FunctionImplTraits { - static const FunctionImpl enum_value = FunctionImpl::NONE; -}; - -template<> struct FunctionImplTraits { - static const FunctionImpl enum_value = FunctionImpl::CanonicalFunction; -}; - -template<> struct FunctionImplTraits { - static const FunctionImpl enum_value = FunctionImpl::NonCanonicalFunction; -}; - -bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type); -bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// A union for the different colum remapping variants -enum class Emit : uint8_t { - NONE = 0, - Remap = 1, - PassThrough = 2, - MIN = NONE, - MAX = PassThrough -}; - -inline const Emit (&EnumValuesEmit())[3] { - static const Emit values[] = { - Emit::NONE, - Emit::Remap, - Emit::PassThrough - }; - return values; -} - -inline const char * const *EnumNamesEmit() { - static const char * const names[4] = { - "NONE", - "Remap", - "PassThrough", - nullptr - }; - return names; -} - -inline const char *EnumNameEmit(Emit e) { - if (flatbuffers::IsOutRange(e, Emit::NONE, Emit::PassThrough)) return ""; - const size_t index = static_cast(e); - return EnumNamesEmit()[index]; -} - -template struct EmitTraits { - static const Emit enum_value = Emit::NONE; -}; - -template<> struct EmitTraits { - static const Emit enum_value = Emit::Remap; -}; - -template<> struct EmitTraits { - static const Emit enum_value = Emit::PassThrough; -}; - -bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type); -bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class CanonicalJoinKindId : uint8_t { - Anti = 0, - Cross = 1, - FullOuter = 2, - Inner = 3, - LeftOuter = 4, - LeftSemi = 5, - RightOuter = 6, - MIN = Anti, - MAX = RightOuter -}; - -inline const CanonicalJoinKindId (&EnumValuesCanonicalJoinKindId())[7] { - static const CanonicalJoinKindId values[] = { - CanonicalJoinKindId::Anti, - CanonicalJoinKindId::Cross, - CanonicalJoinKindId::FullOuter, - CanonicalJoinKindId::Inner, - CanonicalJoinKindId::LeftOuter, - CanonicalJoinKindId::LeftSemi, - CanonicalJoinKindId::RightOuter - }; - return values; -} - -inline const char * const *EnumNamesCanonicalJoinKindId() { - static const char * const names[8] = { - "Anti", - "Cross", - "FullOuter", - "Inner", - "LeftOuter", - "LeftSemi", - "RightOuter", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalJoinKindId(CanonicalJoinKindId e) { - if (flatbuffers::IsOutRange(e, CanonicalJoinKindId::Anti, CanonicalJoinKindId::RightOuter)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalJoinKindId()[index]; -} - -enum class JoinKind : uint8_t { - NONE = 0, - CanonicalJoinKind = 1, - NonCanonicalJoinKind = 2, - MIN = NONE, - MAX = NonCanonicalJoinKind -}; - -inline const JoinKind (&EnumValuesJoinKind())[3] { - static const JoinKind values[] = { - JoinKind::NONE, - JoinKind::CanonicalJoinKind, - JoinKind::NonCanonicalJoinKind - }; - return values; -} - -inline const char * const *EnumNamesJoinKind() { - static const char * const names[4] = { - "NONE", - "CanonicalJoinKind", - "NonCanonicalJoinKind", - nullptr - }; - return names; -} - -inline const char *EnumNameJoinKind(JoinKind e) { - if (flatbuffers::IsOutRange(e, JoinKind::NONE, JoinKind::NonCanonicalJoinKind)) return ""; - const size_t index = static_cast(e); - return EnumNamesJoinKind()[index]; -} - -template struct JoinKindTraits { - static const JoinKind enum_value = JoinKind::NONE; -}; - -template<> struct JoinKindTraits { - static const JoinKind enum_value = JoinKind::CanonicalJoinKind; -}; - -template<> struct JoinKindTraits { - static const JoinKind enum_value = JoinKind::NonCanonicalJoinKind; -}; - -bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type); -bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// Whether lesser values should precede greater or vice versa, -/// also whether nulls should preced or follow values. -enum class Ordering : uint8_t { - ASCENDING_THEN_NULLS = 0, - DESCENDING_THEN_NULLS = 1, - NULLS_THEN_ASCENDING = 2, - NULLS_THEN_DESCENDING = 3, - MIN = ASCENDING_THEN_NULLS, - MAX = NULLS_THEN_DESCENDING -}; - -inline const Ordering (&EnumValuesOrdering())[4] { - static const Ordering values[] = { - Ordering::ASCENDING_THEN_NULLS, - Ordering::DESCENDING_THEN_NULLS, - Ordering::NULLS_THEN_ASCENDING, - Ordering::NULLS_THEN_DESCENDING - }; - return values; -} - -inline const char * const *EnumNamesOrdering() { - static const char * const names[5] = { - "ASCENDING_THEN_NULLS", - "DESCENDING_THEN_NULLS", - "NULLS_THEN_ASCENDING", - "NULLS_THEN_DESCENDING", - nullptr - }; - return names; -} - -inline const char *EnumNameOrdering(Ordering e) { - if (flatbuffers::IsOutRange(e, Ordering::ASCENDING_THEN_NULLS, Ordering::NULLS_THEN_DESCENDING)) return ""; - const size_t index = static_cast(e); - return EnumNamesOrdering()[index]; -} - -/// The kind of set operation being performed. -enum class CanonicalSetOpKindId : uint8_t { - Union = 0, - Intersection = 1, - Difference = 2, - MIN = Union, - MAX = Difference -}; - -inline const CanonicalSetOpKindId (&EnumValuesCanonicalSetOpKindId())[3] { - static const CanonicalSetOpKindId values[] = { - CanonicalSetOpKindId::Union, - CanonicalSetOpKindId::Intersection, - CanonicalSetOpKindId::Difference - }; - return values; -} - -inline const char * const *EnumNamesCanonicalSetOpKindId() { - static const char * const names[4] = { - "Union", - "Intersection", - "Difference", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalSetOpKindId(CanonicalSetOpKindId e) { - if (flatbuffers::IsOutRange(e, CanonicalSetOpKindId::Union, CanonicalSetOpKindId::Difference)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalSetOpKindId()[index]; -} - -enum class SetOpKind : uint8_t { - NONE = 0, - CanonicalSetOpKind = 1, - NonCanonicalSetOpKind = 2, - MIN = NONE, - MAX = NonCanonicalSetOpKind -}; - -inline const SetOpKind (&EnumValuesSetOpKind())[3] { - static const SetOpKind values[] = { - SetOpKind::NONE, - SetOpKind::CanonicalSetOpKind, - SetOpKind::NonCanonicalSetOpKind - }; - return values; -} - -inline const char * const *EnumNamesSetOpKind() { - static const char * const names[4] = { - "NONE", - "CanonicalSetOpKind", - "NonCanonicalSetOpKind", - nullptr - }; - return names; -} - -inline const char *EnumNameSetOpKind(SetOpKind e) { - if (flatbuffers::IsOutRange(e, SetOpKind::NONE, SetOpKind::NonCanonicalSetOpKind)) return ""; - const size_t index = static_cast(e); - return EnumNamesSetOpKind()[index]; -} - -template struct SetOpKindTraits { - static const SetOpKind enum_value = SetOpKind::NONE; -}; - -template<> struct SetOpKindTraits { - static const SetOpKind enum_value = SetOpKind::CanonicalSetOpKind; -}; - -template<> struct SetOpKindTraits { - static const SetOpKind enum_value = SetOpKind::NonCanonicalSetOpKind; -}; - -bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type); -bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class RelationImpl : uint8_t { - NONE = 0, - Aggregate = 1, - Common = 2, - Custom = 3, - SetOperation = 4, - Filter = 5, - Limit = 6, - LiteralRelation = 7, - OrderBy = 8, - Project = 9, - Read = 10, - Write = 11, - MIN = NONE, - MAX = Write -}; - -inline const RelationImpl (&EnumValuesRelationImpl())[12] { - static const RelationImpl values[] = { - RelationImpl::NONE, - RelationImpl::Aggregate, - RelationImpl::Common, - RelationImpl::Custom, - RelationImpl::SetOperation, - RelationImpl::Filter, - RelationImpl::Limit, - RelationImpl::LiteralRelation, - RelationImpl::OrderBy, - RelationImpl::Project, - RelationImpl::Read, - RelationImpl::Write - }; - return values; -} - -inline const char * const *EnumNamesRelationImpl() { - static const char * const names[13] = { - "NONE", - "Aggregate", - "Common", - "Custom", - "SetOperation", - "Filter", - "Limit", - "LiteralRelation", - "OrderBy", - "Project", - "Read", - "Write", - nullptr - }; - return names; -} - -inline const char *EnumNameRelationImpl(RelationImpl e) { - if (flatbuffers::IsOutRange(e, RelationImpl::NONE, RelationImpl::Write)) return ""; - const size_t index = static_cast(e); - return EnumNamesRelationImpl()[index]; -} - -template struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::NONE; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Aggregate; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Common; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Custom; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::SetOperation; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Filter; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Limit; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::LiteralRelation; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::OrderBy; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Project; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Read; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Write; -}; - -bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type); -bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -struct Int8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int8BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int8BufferBuilder { - typedef Int8Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int8Buffer::VT_ITEMS, items); - } - explicit Int8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int8BufferBuilder &operator=(const Int8BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int8Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt8Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int8BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt8BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt8Buffer( - _fbb, - items__); -} - -struct Int16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int16BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int16BufferBuilder { - typedef Int16Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int16Buffer::VT_ITEMS, items); - } - explicit Int16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int16BufferBuilder &operator=(const Int16BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int16Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt16Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int16BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt16BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt16Buffer( - _fbb, - items__); -} - -struct Int32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int32BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int32BufferBuilder { - typedef Int32Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int32Buffer::VT_ITEMS, items); - } - explicit Int32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int32BufferBuilder &operator=(const Int32BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int32Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt32Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int32BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt32BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt32Buffer( - _fbb, - items__); -} - -struct Int64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int64BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int64BufferBuilder { - typedef Int64Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int64Buffer::VT_ITEMS, items); - } - explicit Int64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int64BufferBuilder &operator=(const Int64BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int64Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt64Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int64BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt64BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt64Buffer( - _fbb, - items__); -} - -struct UInt8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt8BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt8BufferBuilder { - typedef UInt8Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt8Buffer::VT_ITEMS, items); - } - explicit UInt8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt8BufferBuilder &operator=(const UInt8BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt8Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt8Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt8BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt8BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt8Buffer( - _fbb, - items__); -} - -struct UInt16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt16BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt16BufferBuilder { - typedef UInt16Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt16Buffer::VT_ITEMS, items); - } - explicit UInt16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt16BufferBuilder &operator=(const UInt16BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt16Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt16Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt16BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt16BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt16Buffer( - _fbb, - items__); -} - -struct UInt32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt32BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt32BufferBuilder { - typedef UInt32Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt32Buffer::VT_ITEMS, items); - } - explicit UInt32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt32BufferBuilder &operator=(const UInt32BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt32Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt32Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt32BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt32BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt32Buffer( - _fbb, - items__); -} - -struct UInt64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt64BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt64BufferBuilder { - typedef UInt64Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt64Buffer::VT_ITEMS, items); - } - explicit UInt64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt64BufferBuilder &operator=(const UInt64BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt64Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt64Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt64BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt64BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt64Buffer( - _fbb, - items__); -} - -struct Float32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Float32BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Float32BufferBuilder { - typedef Float32Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Float32Buffer::VT_ITEMS, items); - } - explicit Float32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Float32BufferBuilder &operator=(const Float32BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Float32Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateFloat32Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Float32BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateFloat32BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateFloat32Buffer( - _fbb, - items__); -} - -struct Float64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Float64BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Float64BufferBuilder { - typedef Float64Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Float64Buffer::VT_ITEMS, items); - } - explicit Float64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Float64BufferBuilder &operator=(const Float64BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Float64Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateFloat64Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Float64BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateFloat64BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateFloat64Buffer( - _fbb, - items__); -} - -struct TableBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef TableBufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - const org::apache::arrow::computeir::flatbuf::InlineBuffer *items_nested_root() const { - return flatbuffers::GetRoot(items()->Data()); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct TableBufferBuilder { - typedef TableBuffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(TableBuffer::VT_ITEMS, items); - } - explicit TableBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - TableBufferBuilder &operator=(const TableBufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, TableBuffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateTableBuffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - TableBufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateTableBufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateTableBuffer( - _fbb, - items__); -} - -/// An inline replacement for org.apache.arrow.Buffer because that -/// requires a sidecar block of bytes into which offsets can point. -/// A union of buffers of each primitive type is provided to avoid -/// the need for reinterpret_cast, std::mem::transmute, ... -/// The final member of the union is a bytes buffer aligned suitably -/// to hold any flatbuffer Table. -struct InlineBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef InlineBufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 - }; - org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::Int8Buffer *impl_as_Int8Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int8Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int16Buffer *impl_as_Int16Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int16Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int32Buffer *impl_as_Int32Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int32Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int64Buffer *impl_as_Int64Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int64Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt8Buffer *impl_as_UInt8Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt8Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt16Buffer *impl_as_UInt16Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt16Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt32Buffer *impl_as_UInt32Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt32Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt64Buffer *impl_as_UInt64Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt64Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Float32Buffer *impl_as_Float32Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float32Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Float64Buffer *impl_as_Float64Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float64Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::TableBuffer *impl_as_TableBuffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::TableBuffer ? static_cast(impl()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyInlineBufferImpl(verifier, impl(), impl_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Int8Buffer *InlineBuffer::impl_as() const { - return impl_as_Int8Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int16Buffer *InlineBuffer::impl_as() const { - return impl_as_Int16Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int32Buffer *InlineBuffer::impl_as() const { - return impl_as_Int32Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int64Buffer *InlineBuffer::impl_as() const { - return impl_as_Int64Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt8Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt8Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt16Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt16Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt32Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt32Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt64Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt64Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Float32Buffer *InlineBuffer::impl_as() const { - return impl_as_Float32Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Float64Buffer *InlineBuffer::impl_as() const { - return impl_as_Float64Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::TableBuffer *InlineBuffer::impl_as() const { - return impl_as_TableBuffer(); -} - -struct InlineBufferBuilder { - typedef InlineBuffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type) { - fbb_.AddElement(InlineBuffer::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(InlineBuffer::VT_IMPL, impl); - } - explicit InlineBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - InlineBufferBuilder &operator=(const InlineBufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, InlineBuffer::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateInlineBuffer( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type = org::apache::arrow::computeir::flatbuf::InlineBufferImpl::NONE, - flatbuffers::Offset impl = 0) { - InlineBufferBuilder builder_(_fbb); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ExpressionBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 - }; - org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::Literal *impl_as_Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::FieldRef *impl_as_FieldRef() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::FieldRef ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Call *impl_as_Call() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Call ? static_cast(impl()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyExpressionImpl(verifier, impl(), impl_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Literal *Expression::impl_as() const { - return impl_as_Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::FieldRef *Expression::impl_as() const { - return impl_as_FieldRef(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Call *Expression::impl_as() const { - return impl_as_Call(); -} - -struct ExpressionBuilder { - typedef Expression Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type) { - fbb_.AddElement(Expression::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(Expression::VT_IMPL, impl); - } - explicit ExpressionBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ExpressionBuilder &operator=(const ExpressionBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Expression::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateExpression( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type = org::apache::arrow::computeir::flatbuf::ExpressionImpl::NONE, - flatbuffers::Offset impl = 0) { - ExpressionBuilder builder_(_fbb); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -struct Scalar FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ScalarBuilder Builder; - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - verifier.EndTable(); - } -}; - -struct ScalarBuilder { - typedef Scalar Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - explicit ScalarBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ScalarBuilder &operator=(const ScalarBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateScalar( - flatbuffers::FlatBufferBuilder &_fbb) { - ScalarBuilder builder_(_fbb); - return builder_.Finish(); -} - -struct Array FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ArrayBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_LENGTH = 4 - }; - /// Number of slots. - int64_t length() const { - return GetField(VT_LENGTH, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_LENGTH) && - verifier.EndTable(); - } -}; - -struct ArrayBuilder { - typedef Array Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_length(int64_t length) { - fbb_.AddElement(Array::VT_LENGTH, length, 0); - } - explicit ArrayBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ArrayBuilder &operator=(const ArrayBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateArray( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t length = 0) { - ArrayBuilder builder_(_fbb); - builder_.add_length(length); - return builder_.Finish(); -} - -struct MapKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef MapKeyBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KEY = 4 - }; - const flatbuffers::String *key() const { - return GetPointer(VT_KEY); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_KEY) && - verifier.VerifyString(key()) && - verifier.EndTable(); - } -}; - -struct MapKeyBuilder { - typedef MapKey Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_key(flatbuffers::Offset key) { - fbb_.AddOffset(MapKey::VT_KEY, key); - } - explicit MapKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - MapKeyBuilder &operator=(const MapKeyBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, MapKey::VT_KEY); - return o; - } -}; - -inline flatbuffers::Offset CreateMapKey( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset key = 0) { - MapKeyBuilder builder_(_fbb); - builder_.add_key(key); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateMapKeyDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *key = nullptr) { - auto key__ = key ? _fbb.CreateString(key) : 0; - return org::apache::arrow::computeir::flatbuf::CreateMapKey( - _fbb, - key__); -} - -struct StructField FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef StructFieldBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_POSITION = 4, - VT_NESTING_LEVEL = 6 - }; - uint32_t position() const { - return GetField(VT_POSITION, 0); - } - uint32_t nesting_level() const { - return GetField(VT_NESTING_LEVEL, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_POSITION) && - VerifyField(verifier, VT_NESTING_LEVEL) && - verifier.EndTable(); - } -}; - -struct StructFieldBuilder { - typedef StructField Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_position(uint32_t position) { - fbb_.AddElement(StructField::VT_POSITION, position, 0); - } - void add_nesting_level(uint32_t nesting_level) { - fbb_.AddElement(StructField::VT_NESTING_LEVEL, nesting_level, 0); - } - explicit StructFieldBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - StructFieldBuilder &operator=(const StructFieldBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateStructField( - flatbuffers::FlatBufferBuilder &_fbb, - uint32_t position = 0, - uint32_t nesting_level = 0) { - StructFieldBuilder builder_(_fbb); - builder_.add_nesting_level(nesting_level); - builder_.add_position(position); - return builder_.Finish(); -} - -struct ArraySubscript FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ArraySubscriptBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_POSITION = 4 - }; - int64_t position() const { - return GetField(VT_POSITION, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_POSITION) && - verifier.EndTable(); - } -}; - -struct ArraySubscriptBuilder { - typedef ArraySubscript Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_position(int64_t position) { - fbb_.AddElement(ArraySubscript::VT_POSITION, position, 0); - } - explicit ArraySubscriptBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ArraySubscriptBuilder &operator=(const ArraySubscriptBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateArraySubscript( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t position = 0) { - ArraySubscriptBuilder builder_(_fbb); - builder_.add_position(position); - return builder_.Finish(); -} - -struct ArraySlice FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ArraySliceBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_START_INCLUSIVE = 4, - VT_END_EXCLUSIVE = 6 - }; - int64_t start_inclusive() const { - return GetField(VT_START_INCLUSIVE, 0); - } - int64_t end_exclusive() const { - return GetField(VT_END_EXCLUSIVE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_START_INCLUSIVE) && - VerifyField(verifier, VT_END_EXCLUSIVE) && - verifier.EndTable(); - } -}; - -struct ArraySliceBuilder { - typedef ArraySlice Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_start_inclusive(int64_t start_inclusive) { - fbb_.AddElement(ArraySlice::VT_START_INCLUSIVE, start_inclusive, 0); - } - void add_end_exclusive(int64_t end_exclusive) { - fbb_.AddElement(ArraySlice::VT_END_EXCLUSIVE, end_exclusive, 0); - } - explicit ArraySliceBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ArraySliceBuilder &operator=(const ArraySliceBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateArraySlice( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t start_inclusive = 0, - int64_t end_exclusive = 0) { - ArraySliceBuilder builder_(_fbb); - builder_.add_end_exclusive(end_exclusive); - builder_.add_start_inclusive(start_inclusive); - return builder_.Finish(); -} - -struct FieldName FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FieldNameBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_POSITION = 4 - }; - uint32_t position() const { - return GetField(VT_POSITION, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_POSITION) && - verifier.EndTable(); - } -}; - -struct FieldNameBuilder { - typedef FieldName Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_position(uint32_t position) { - fbb_.AddElement(FieldName::VT_POSITION, position, 0); - } - explicit FieldNameBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FieldNameBuilder &operator=(const FieldNameBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateFieldName( - flatbuffers::FlatBufferBuilder &_fbb, - uint32_t position = 0) { - FieldNameBuilder builder_(_fbb); - builder_.add_position(position); - return builder_.Finish(); -} - -struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FieldRefBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_REF_TYPE = 4, - VT_REF = 6, - VT_RELATION_INDEX = 8 - }; - org::apache::arrow::computeir::flatbuf::Deref ref_type() const { - return static_cast(GetField(VT_REF_TYPE, 0)); - } - /// A sequence of field names to allow referencing potentially nested fields - const void *ref() const { - return GetPointer(VT_REF); - } - template const T *ref_as() const; - const org::apache::arrow::computeir::flatbuf::MapKey *ref_as_MapKey() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::MapKey ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::StructField *ref_as_StructField() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::StructField ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::ArraySubscript *ref_as_ArraySubscript() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySubscript ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::ArraySlice *ref_as_ArraySlice() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySlice ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::FieldName *ref_as_FieldName() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::FieldName ? static_cast(ref()) : nullptr; - } - /// For Expressions which might reference fields in multiple Relations, - /// this index may be provided to indicate which Relation's fields - /// `path` points into. For example in the case of a join, - /// 0 refers to the left relation and 1 to the right relation. - int32_t relation_index() const { - return GetField(VT_RELATION_INDEX, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_REF_TYPE) && - VerifyOffsetRequired(verifier, VT_REF) && - VerifyDeref(verifier, ref(), ref_type()) && - VerifyField(verifier, VT_RELATION_INDEX) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::MapKey *FieldRef::ref_as() const { - return ref_as_MapKey(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::StructField *FieldRef::ref_as() const { - return ref_as_StructField(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::ArraySubscript *FieldRef::ref_as() const { - return ref_as_ArraySubscript(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::ArraySlice *FieldRef::ref_as() const { - return ref_as_ArraySlice(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::FieldName *FieldRef::ref_as() const { - return ref_as_FieldName(); -} - -struct FieldRefBuilder { - typedef FieldRef Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_ref_type(org::apache::arrow::computeir::flatbuf::Deref ref_type) { - fbb_.AddElement(FieldRef::VT_REF_TYPE, static_cast(ref_type), 0); - } - void add_ref(flatbuffers::Offset ref) { - fbb_.AddOffset(FieldRef::VT_REF, ref); - } - void add_relation_index(int32_t relation_index) { - fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); - } - explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FieldRefBuilder &operator=(const FieldRefBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, FieldRef::VT_REF); - return o; - } -}; - -inline flatbuffers::Offset CreateFieldRef( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::Deref ref_type = org::apache::arrow::computeir::flatbuf::Deref::NONE, - flatbuffers::Offset ref = 0, - int32_t relation_index = 0) { - FieldRefBuilder builder_(_fbb); - builder_.add_relation_index(relation_index); - builder_.add_ref(ref); - builder_.add_ref_type(ref_type); - return builder_.Finish(); -} - -struct CanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalFunctionBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 - }; - org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id() const { - return static_cast(GetField(VT_ID, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && - verifier.EndTable(); - } -}; - -struct CanonicalFunctionBuilder { - typedef CanonicalFunction Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id) { - fbb_.AddElement(CanonicalFunction::VT_ID, static_cast(id), 0); - } - explicit CanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CanonicalFunctionBuilder &operator=(const CanonicalFunctionBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCanonicalFunction( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id = org::apache::arrow::computeir::flatbuf::CanonicalFunctionId::And) { - CanonicalFunctionBuilder builder_(_fbb); - builder_.add_id(id); - return builder_.Finish(); -} - -struct NonCanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalFunctionBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 - }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); - } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct NonCanonicalFunctionBuilder { - typedef NonCanonicalFunction Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalFunction::VT_NAME_SPACE, name_space); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalFunction::VT_NAME, name); - } - explicit NonCanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NonCanonicalFunctionBuilder &operator=(const NonCanonicalFunctionBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalFunction::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateNonCanonicalFunction( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalFunctionBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateNonCanonicalFunctionDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalFunction( - _fbb, - name_space__, - name__); -} - -struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CallBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KIND_TYPE = 4, - VT_KIND = 6, - VT_ARGUMENTS = 8, - VT_METADATA = 10 - }; - org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type() const { - return static_cast(GetField(VT_KIND_TYPE, 0)); - } - /// The kind of function call this is - const void *kind() const { - return GetPointer(VT_KIND); - } - template const T *kind_as() const; - const org::apache::arrow::computeir::flatbuf::CanonicalFunction *kind_as_CanonicalFunction() const { - return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::CanonicalFunction ? static_cast(kind()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *kind_as_NonCanonicalFunction() const { - return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::NonCanonicalFunction ? static_cast(kind()) : nullptr; - } - /// The arguments passed to `function_name`. - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); - } - /// Parameters for `function_name`; content/format may be unique to each - /// value of `function_name`. - const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { - return GetPointer(VT_METADATA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_KIND_TYPE) && - VerifyOffsetRequired(verifier, VT_KIND) && - VerifyFunctionImpl(verifier, kind(), kind_type()) && - VerifyOffsetRequired(verifier, VT_ARGUMENTS) && - verifier.VerifyVector(arguments()) && - verifier.VerifyVectorOfTables(arguments()) && - VerifyOffset(verifier, VT_METADATA) && - verifier.VerifyTable(metadata()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalFunction *Call::kind_as() const { - return kind_as_CanonicalFunction(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *Call::kind_as() const { - return kind_as_NonCanonicalFunction(); -} - -struct CallBuilder { - typedef Call Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_kind_type(org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type) { - fbb_.AddElement(Call::VT_KIND_TYPE, static_cast(kind_type), 0); - } - void add_kind(flatbuffers::Offset kind) { - fbb_.AddOffset(Call::VT_KIND, kind); - } - void add_arguments(flatbuffers::Offset>> arguments) { - fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); - } - void add_metadata(flatbuffers::Offset metadata) { - fbb_.AddOffset(Call::VT_METADATA, metadata); - } - explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CallBuilder &operator=(const CallBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Call::VT_KIND); - fbb_.Required(o, Call::VT_ARGUMENTS); - return o; - } -}; - -inline flatbuffers::Offset CreateCall( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, - flatbuffers::Offset kind = 0, - flatbuffers::Offset>> arguments = 0, - flatbuffers::Offset metadata = 0) { - CallBuilder builder_(_fbb); - builder_.add_metadata(metadata); - builder_.add_arguments(arguments); - builder_.add_kind(kind); - builder_.add_kind_type(kind_type); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateCallDirect( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, - flatbuffers::Offset kind = 0, - const std::vector> *arguments = nullptr, - flatbuffers::Offset metadata = 0) { - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; - return org::apache::arrow::computeir::flatbuf::CreateCall( - _fbb, - kind_type, - kind, - arguments__, - metadata); -} - -/// A data type indicating a different mapping of columns -/// should occur in the output. -/// -/// For example: -/// -/// Given a query `SELECT a, b FROM t` where `t` has columns a, b, c -/// the mapping value for the projection would equal [0, 1]. -struct Remap FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef RemapBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_MAPPING = 4 - }; - const flatbuffers::Vector *mapping() const { - return GetPointer *>(VT_MAPPING); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_MAPPING) && - verifier.VerifyVector(mapping()) && - verifier.EndTable(); - } -}; - -struct RemapBuilder { - typedef Remap Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_mapping(flatbuffers::Offset> mapping) { - fbb_.AddOffset(Remap::VT_MAPPING, mapping); - } - explicit RemapBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - RemapBuilder &operator=(const RemapBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Remap::VT_MAPPING); - return o; - } -}; - -inline flatbuffers::Offset CreateRemap( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> mapping = 0) { - RemapBuilder builder_(_fbb); - builder_.add_mapping(mapping); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateRemapDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *mapping = nullptr) { - auto mapping__ = mapping ? _fbb.CreateVector(*mapping) : 0; - return org::apache::arrow::computeir::flatbuf::CreateRemap( - _fbb, - mapping__); -} - -struct PassThrough FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef PassThroughBuilder Builder; - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - verifier.EndTable(); - } -}; - -struct PassThroughBuilder { - typedef PassThrough Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - explicit PassThroughBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - PassThroughBuilder &operator=(const PassThroughBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreatePassThrough( - flatbuffers::FlatBufferBuilder &_fbb) { - PassThroughBuilder builder_(_fbb); - return builder_.Finish(); -} - -/// Fields common to every relational operator -struct RelBase FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef RelBaseBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ARGUMENTS = 4, - VT_OUTPUT_MAPPING_TYPE = 6, - VT_OUTPUT_MAPPING = 8, - VT_OPTIONS = 10 - }; - /// The arguments passed to `operation`. - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); - } - org::apache::arrow::computeir::flatbuf::Emit output_mapping_type() const { - return static_cast(GetField(VT_OUTPUT_MAPPING_TYPE, 0)); - } - /// Output remapping of ordinals for a given operation - const void *output_mapping() const { - return GetPointer(VT_OUTPUT_MAPPING); - } - template const T *output_mapping_as() const; - const org::apache::arrow::computeir::flatbuf::Remap *output_mapping_as_Remap() const { - return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::Remap ? static_cast(output_mapping()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::PassThrough *output_mapping_as_PassThrough() const { - return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::PassThrough ? static_cast(output_mapping()) : nullptr; - } - /// Arguments for custom operations - const org::apache::arrow::computeir::flatbuf::InlineBuffer *options() const { - return GetPointer(VT_OPTIONS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ARGUMENTS) && - verifier.VerifyVector(arguments()) && - verifier.VerifyVectorOfTables(arguments()) && - VerifyField(verifier, VT_OUTPUT_MAPPING_TYPE) && - VerifyOffsetRequired(verifier, VT_OUTPUT_MAPPING) && - VerifyEmit(verifier, output_mapping(), output_mapping_type()) && - VerifyOffset(verifier, VT_OPTIONS) && - verifier.VerifyTable(options()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Remap *RelBase::output_mapping_as() const { - return output_mapping_as_Remap(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::PassThrough *RelBase::output_mapping_as() const { - return output_mapping_as_PassThrough(); -} - -struct RelBaseBuilder { - typedef RelBase Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_arguments(flatbuffers::Offset>> arguments) { - fbb_.AddOffset(RelBase::VT_ARGUMENTS, arguments); - } - void add_output_mapping_type(org::apache::arrow::computeir::flatbuf::Emit output_mapping_type) { - fbb_.AddElement(RelBase::VT_OUTPUT_MAPPING_TYPE, static_cast(output_mapping_type), 0); - } - void add_output_mapping(flatbuffers::Offset output_mapping) { - fbb_.AddOffset(RelBase::VT_OUTPUT_MAPPING, output_mapping); - } - void add_options(flatbuffers::Offset options) { - fbb_.AddOffset(RelBase::VT_OPTIONS, options); - } - explicit RelBaseBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - RelBaseBuilder &operator=(const RelBaseBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, RelBase::VT_ARGUMENTS); - fbb_.Required(o, RelBase::VT_OUTPUT_MAPPING); - return o; - } -}; - -inline flatbuffers::Offset CreateRelBase( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> arguments = 0, - org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, - flatbuffers::Offset output_mapping = 0, - flatbuffers::Offset options = 0) { - RelBaseBuilder builder_(_fbb); - builder_.add_options(options); - builder_.add_output_mapping(output_mapping); - builder_.add_arguments(arguments); - builder_.add_output_mapping_type(output_mapping_type); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateRelBaseDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *arguments = nullptr, - org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, - flatbuffers::Offset output_mapping = 0, - flatbuffers::Offset options = 0) { - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; - return org::apache::arrow::computeir::flatbuf::CreateRelBase( - _fbb, - arguments__, - output_mapping_type, - output_mapping, - options); -} - -/// Filter operation -struct Filter FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FilterBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_PREDICATE = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// The expression which will be evaluated against input rows - /// to determine whether they should be excluded from the - /// filter relation's output. - const org::apache::arrow::computeir::flatbuf::Expression *predicate() const { - return GetPointer(VT_PREDICATE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_PREDICATE) && - verifier.VerifyTable(predicate()) && - verifier.EndTable(); - } -}; - -struct FilterBuilder { - typedef Filter Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Filter::VT_BASE, base); - } - void add_predicate(flatbuffers::Offset predicate) { - fbb_.AddOffset(Filter::VT_PREDICATE, predicate); - } - explicit FilterBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FilterBuilder &operator=(const FilterBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Filter::VT_PREDICATE); - return o; - } -}; - -inline flatbuffers::Offset CreateFilter( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset predicate = 0) { - FilterBuilder builder_(_fbb); - builder_.add_predicate(predicate); - builder_.add_base(base); - return builder_.Finish(); -} - -/// Projection -struct Project FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ProjectBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_EXPRESSIONS = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Expressions which will be evaluated to produce to - /// the rows of the project relation's output. - const flatbuffers::Vector> *expressions() const { - return GetPointer> *>(VT_EXPRESSIONS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_EXPRESSIONS) && - verifier.VerifyVector(expressions()) && - verifier.VerifyVectorOfTables(expressions()) && - verifier.EndTable(); - } -}; - -struct ProjectBuilder { - typedef Project Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Project::VT_BASE, base); - } - void add_expressions(flatbuffers::Offset>> expressions) { - fbb_.AddOffset(Project::VT_EXPRESSIONS, expressions); - } - explicit ProjectBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ProjectBuilder &operator=(const ProjectBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Project::VT_EXPRESSIONS); - return o; - } -}; - -inline flatbuffers::Offset CreateProject( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> expressions = 0) { - ProjectBuilder builder_(_fbb); - builder_.add_expressions(expressions); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateProjectDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *expressions = nullptr) { - auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; - return org::apache::arrow::computeir::flatbuf::CreateProject( - _fbb, - base, - expressions__); -} - -/// Aggregate operation -struct Aggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef AggregateBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_AGGREGATIONS = 6, - VT_KEYS = 8 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Expressions which will be evaluated to produce to - /// the rows of the aggregate relation's output. - const flatbuffers::Vector> *aggregations() const { - return GetPointer> *>(VT_AGGREGATIONS); - } - /// Keys by which `aggregations` will be grouped. - const flatbuffers::Vector> *keys() const { - return GetPointer> *>(VT_KEYS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_AGGREGATIONS) && - verifier.VerifyVector(aggregations()) && - verifier.VerifyVectorOfTables(aggregations()) && - VerifyOffsetRequired(verifier, VT_KEYS) && - verifier.VerifyVector(keys()) && - verifier.VerifyVectorOfTables(keys()) && - verifier.EndTable(); - } -}; - -struct AggregateBuilder { - typedef Aggregate Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Aggregate::VT_BASE, base); - } - void add_aggregations(flatbuffers::Offset>> aggregations) { - fbb_.AddOffset(Aggregate::VT_AGGREGATIONS, aggregations); - } - void add_keys(flatbuffers::Offset>> keys) { - fbb_.AddOffset(Aggregate::VT_KEYS, keys); - } - explicit AggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - AggregateBuilder &operator=(const AggregateBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Aggregate::VT_AGGREGATIONS); - fbb_.Required(o, Aggregate::VT_KEYS); - return o; - } -}; - -inline flatbuffers::Offset CreateAggregate( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> aggregations = 0, - flatbuffers::Offset>> keys = 0) { - AggregateBuilder builder_(_fbb); - builder_.add_keys(keys); - builder_.add_aggregations(aggregations); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateAggregateDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *aggregations = nullptr, - const std::vector> *keys = nullptr) { - auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; - auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; - return org::apache::arrow::computeir::flatbuf::CreateAggregate( - _fbb, - base, - aggregations__, - keys__); -} - -struct CanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalJoinKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 - }; - org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id() const { - return static_cast(GetField(VT_ID, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && - verifier.EndTable(); - } -}; - -struct CanonicalJoinKindBuilder { - typedef CanonicalJoinKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id) { - fbb_.AddElement(CanonicalJoinKind::VT_ID, static_cast(id), 0); - } - explicit CanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CanonicalJoinKindBuilder &operator=(const CanonicalJoinKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCanonicalJoinKind( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id = org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId::Anti) { - CanonicalJoinKindBuilder builder_(_fbb); - builder_.add_id(id); - return builder_.Finish(); -} - -struct NonCanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalJoinKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 - }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); - } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct NonCanonicalJoinKindBuilder { - typedef NonCanonicalJoinKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME_SPACE, name_space); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME, name); - } - explicit NonCanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NonCanonicalJoinKindBuilder &operator=(const NonCanonicalJoinKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalJoinKind::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateNonCanonicalJoinKind( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalJoinKindBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateNonCanonicalJoinKindDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalJoinKind( - _fbb, - name_space__, - name__); -} - -/// The contents of Relation.options will be JoinOptions -/// if Relation.operation = CanonicalOperation::Join -struct Join FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef JoinBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_ON_EXPRESSION = 6, - VT_JOIN_KIND_TYPE = 8, - VT_JOIN_KIND = 10 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// The expression which will be evaluated against rows from each - /// input to determine whether they should be included in the - /// join relation's output. - const org::apache::arrow::computeir::flatbuf::Expression *on_expression() const { - return GetPointer(VT_ON_EXPRESSION); - } - org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type() const { - return static_cast(GetField(VT_JOIN_KIND_TYPE, 0)); - } - /// The kind of join to use. - const void *join_kind() const { - return GetPointer(VT_JOIN_KIND); - } - template const T *join_kind_as() const; - const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *join_kind_as_CanonicalJoinKind() const { - return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::CanonicalJoinKind ? static_cast(join_kind()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *join_kind_as_NonCanonicalJoinKind() const { - return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::NonCanonicalJoinKind ? static_cast(join_kind()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && - verifier.VerifyTable(on_expression()) && - VerifyField(verifier, VT_JOIN_KIND_TYPE) && - VerifyOffsetRequired(verifier, VT_JOIN_KIND) && - VerifyJoinKind(verifier, join_kind(), join_kind_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *Join::join_kind_as() const { - return join_kind_as_CanonicalJoinKind(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *Join::join_kind_as() const { - return join_kind_as_NonCanonicalJoinKind(); -} - -struct JoinBuilder { - typedef Join Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Join::VT_BASE, base); - } - void add_on_expression(flatbuffers::Offset on_expression) { - fbb_.AddOffset(Join::VT_ON_EXPRESSION, on_expression); - } - void add_join_kind_type(org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type) { - fbb_.AddElement(Join::VT_JOIN_KIND_TYPE, static_cast(join_kind_type), 0); - } - void add_join_kind(flatbuffers::Offset join_kind) { - fbb_.AddOffset(Join::VT_JOIN_KIND, join_kind); - } - explicit JoinBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - JoinBuilder &operator=(const JoinBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Join::VT_ON_EXPRESSION); - fbb_.Required(o, Join::VT_JOIN_KIND); - return o; - } -}; - -inline flatbuffers::Offset CreateJoin( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset on_expression = 0, - org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type = org::apache::arrow::computeir::flatbuf::JoinKind::NONE, - flatbuffers::Offset join_kind = 0) { - JoinBuilder builder_(_fbb); - builder_.add_join_kind(join_kind); - builder_.add_on_expression(on_expression); - builder_.add_base(base); - builder_.add_join_kind_type(join_kind_type); - return builder_.Finish(); -} - -struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef SortKeyBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4, - VT_ORDERING = 6 - }; - const org::apache::arrow::computeir::flatbuf::Expression *value() const { - return GetPointer(VT_VALUE); - } - org::apache::arrow::computeir::flatbuf::Ordering ordering() const { - return static_cast(GetField(VT_ORDERING, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_VALUE) && - verifier.VerifyTable(value()) && - VerifyField(verifier, VT_ORDERING) && - verifier.EndTable(); - } -}; - -struct SortKeyBuilder { - typedef SortKey Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(flatbuffers::Offset value) { - fbb_.AddOffset(SortKey::VT_VALUE, value); - } - void add_ordering(org::apache::arrow::computeir::flatbuf::Ordering ordering) { - fbb_.AddElement(SortKey::VT_ORDERING, static_cast(ordering), 0); - } - explicit SortKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - SortKeyBuilder &operator=(const SortKeyBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, SortKey::VT_VALUE); - return o; - } -}; - -inline flatbuffers::Offset CreateSortKey( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset value = 0, - org::apache::arrow::computeir::flatbuf::Ordering ordering = org::apache::arrow::computeir::flatbuf::Ordering::ASCENDING_THEN_NULLS) { - SortKeyBuilder builder_(_fbb); - builder_.add_value(value); - builder_.add_ordering(ordering); - return builder_.Finish(); -} - -/// Order by relation -struct OrderBy FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef OrderByBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_KEYS = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Define sort order for rows of output. - /// Keys with higher precedence are ordered ahead of other keys. - const flatbuffers::Vector> *keys() const { - return GetPointer> *>(VT_KEYS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_KEYS) && - verifier.VerifyVector(keys()) && - verifier.VerifyVectorOfTables(keys()) && - verifier.EndTable(); - } -}; - -struct OrderByBuilder { - typedef OrderBy Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(OrderBy::VT_BASE, base); - } - void add_keys(flatbuffers::Offset>> keys) { - fbb_.AddOffset(OrderBy::VT_KEYS, keys); - } - explicit OrderByBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - OrderByBuilder &operator=(const OrderByBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, OrderBy::VT_KEYS); - return o; - } -}; - -inline flatbuffers::Offset CreateOrderBy( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> keys = 0) { - OrderByBuilder builder_(_fbb); - builder_.add_keys(keys); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateOrderByDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *keys = nullptr) { - auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; - return org::apache::arrow::computeir::flatbuf::CreateOrderBy( - _fbb, - base, - keys__); -} - -/// Limit operation -struct Limit FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LimitBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_COUNT = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Set the maximum number of rows of output. - int64_t count() const { - return GetField(VT_COUNT, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyField(verifier, VT_COUNT) && - verifier.EndTable(); - } -}; - -struct LimitBuilder { - typedef Limit Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Limit::VT_BASE, base); - } - void add_count(int64_t count) { - fbb_.AddElement(Limit::VT_COUNT, count, 0); - } - explicit LimitBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - LimitBuilder &operator=(const LimitBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateLimit( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - int64_t count = 0) { - LimitBuilder builder_(_fbb); - builder_.add_count(count); - builder_.add_base(base); - return builder_.Finish(); -} - -/// Common table expresssion -struct Common FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CommonBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_NAME = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Commons (CTEs in SQL) allow assigning a name to a stream - /// of data and reusing it, potentially multiple times and - /// potentially recursively. - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct CommonBuilder { - typedef Common Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Common::VT_BASE, base); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(Common::VT_NAME, name); - } - explicit CommonBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CommonBuilder &operator=(const CommonBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Common::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateCommon( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset name = 0) { - CommonBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateCommonDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const char *name = nullptr) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateCommon( - _fbb, - base, - name__); -} - -struct CanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalSetOpKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 - }; - org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id() const { - return static_cast(GetField(VT_ID, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && - verifier.EndTable(); - } -}; - -struct CanonicalSetOpKindBuilder { - typedef CanonicalSetOpKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id) { - fbb_.AddElement(CanonicalSetOpKind::VT_ID, static_cast(id), 0); - } - explicit CanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CanonicalSetOpKindBuilder &operator=(const CanonicalSetOpKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCanonicalSetOpKind( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id = org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId::Union) { - CanonicalSetOpKindBuilder builder_(_fbb); - builder_.add_id(id); - return builder_.Finish(); -} - -struct NonCanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalSetOpKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 - }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); - } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct NonCanonicalSetOpKindBuilder { - typedef NonCanonicalSetOpKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME_SPACE, name_space); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME, name); - } - explicit NonCanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NonCanonicalSetOpKindBuilder &operator=(const NonCanonicalSetOpKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalSetOpKind::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateNonCanonicalSetOpKind( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalSetOpKindBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateNonCanonicalSetOpKindDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalSetOpKind( - _fbb, - name_space__, - name__); -} - -/// A set operation on two or more relations -struct SetOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef SetOperationBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_SET_OP_TYPE = 6, - VT_SET_OP = 8 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type() const { - return static_cast(GetField(VT_SET_OP_TYPE, 0)); - } - /// The kind of set operation - const void *set_op() const { - return GetPointer(VT_SET_OP); - } - template const T *set_op_as() const; - const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *set_op_as_CanonicalSetOpKind() const { - return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::CanonicalSetOpKind ? static_cast(set_op()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *set_op_as_NonCanonicalSetOpKind() const { - return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::NonCanonicalSetOpKind ? static_cast(set_op()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyField(verifier, VT_SET_OP_TYPE) && - VerifyOffsetRequired(verifier, VT_SET_OP) && - VerifySetOpKind(verifier, set_op(), set_op_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *SetOperation::set_op_as() const { - return set_op_as_CanonicalSetOpKind(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *SetOperation::set_op_as() const { - return set_op_as_NonCanonicalSetOpKind(); -} - -struct SetOperationBuilder { - typedef SetOperation Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(SetOperation::VT_BASE, base); - } - void add_set_op_type(org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type) { - fbb_.AddElement(SetOperation::VT_SET_OP_TYPE, static_cast(set_op_type), 0); - } - void add_set_op(flatbuffers::Offset set_op) { - fbb_.AddOffset(SetOperation::VT_SET_OP, set_op); - } - explicit SetOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - SetOperationBuilder &operator=(const SetOperationBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, SetOperation::VT_BASE); - fbb_.Required(o, SetOperation::VT_SET_OP); - return o; - } -}; - -inline flatbuffers::Offset CreateSetOperation( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type = org::apache::arrow::computeir::flatbuf::SetOpKind::NONE, - flatbuffers::Offset set_op = 0) { - SetOperationBuilder builder_(_fbb); - builder_.add_set_op(set_op); - builder_.add_base(base); - builder_.add_set_op_type(set_op_type); - return builder_.Finish(); -} - -/// Literal relation -struct LiteralRelation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LiteralRelationBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_COLUMNS = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// The columns of this literal relation. - const flatbuffers::Vector> *columns() const { - return GetPointer> *>(VT_COLUMNS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_COLUMNS) && - verifier.VerifyVector(columns()) && - verifier.VerifyVectorOfTables(columns()) && - verifier.EndTable(); - } -}; - -struct LiteralRelationBuilder { - typedef LiteralRelation Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(LiteralRelation::VT_BASE, base); - } - void add_columns(flatbuffers::Offset>> columns) { - fbb_.AddOffset(LiteralRelation::VT_COLUMNS, columns); - } - explicit LiteralRelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - LiteralRelationBuilder &operator=(const LiteralRelationBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, LiteralRelation::VT_BASE); - fbb_.Required(o, LiteralRelation::VT_COLUMNS); - return o; - } -}; - -inline flatbuffers::Offset CreateLiteralRelation( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> columns = 0) { - LiteralRelationBuilder builder_(_fbb); - builder_.add_columns(columns); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateLiteralRelationDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *columns = nullptr) { - auto columns__ = columns ? _fbb.CreateVector>(*columns) : 0; - return org::apache::arrow::computeir::flatbuf::CreateLiteralRelation( - _fbb, - base, - columns__); -} - -/// A user-defined relation -struct Custom FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CustomBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - verifier.EndTable(); - } -}; - -struct CustomBuilder { - typedef Custom Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Custom::VT_BASE, base); - } - explicit CustomBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CustomBuilder &operator=(const CustomBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCustom( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0) { - CustomBuilder builder_(_fbb); - builder_.add_base(base); - return builder_.Finish(); -} - -struct Read FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ReadBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_RESOURCE = 6, - VT_OPTIONS = 8, - VT_SCHEMA = 10 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - const flatbuffers::String *resource() const { - return GetPointer(VT_RESOURCE); - } - const flatbuffers::Vector> *options() const { - return GetPointer> *>(VT_OPTIONS); - } - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_RESOURCE) && - verifier.VerifyString(resource()) && - VerifyOffset(verifier, VT_OPTIONS) && - verifier.VerifyVector(options()) && - verifier.VerifyVectorOfTables(options()) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - verifier.EndTable(); - } -}; - -struct ReadBuilder { - typedef Read Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Read::VT_BASE, base); - } - void add_resource(flatbuffers::Offset resource) { - fbb_.AddOffset(Read::VT_RESOURCE, resource); - } - void add_options(flatbuffers::Offset>> options) { - fbb_.AddOffset(Read::VT_OPTIONS, options); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Read::VT_SCHEMA, schema); - } - explicit ReadBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ReadBuilder &operator=(const ReadBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Read::VT_RESOURCE); - fbb_.Required(o, Read::VT_SCHEMA); - return o; - } -}; - -inline flatbuffers::Offset CreateRead( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset resource = 0, - flatbuffers::Offset>> options = 0, - flatbuffers::Offset schema = 0) { - ReadBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_options(options); - builder_.add_resource(resource); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateReadDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const char *resource = nullptr, - const std::vector> *options = nullptr, - flatbuffers::Offset schema = 0) { - auto resource__ = resource ? _fbb.CreateString(resource) : 0; - auto options__ = options ? _fbb.CreateVector>(*options) : 0; - return org::apache::arrow::computeir::flatbuf::CreateRead( - _fbb, - base, - resource__, - options__, - schema); -} - -struct Write FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef WriteBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_RESOURCE = 6, - VT_OPTIONS = 8, - VT_SCHEMA = 10 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - const flatbuffers::String *resource() const { - return GetPointer(VT_RESOURCE); - } - const flatbuffers::Vector> *options() const { - return GetPointer> *>(VT_OPTIONS); - } - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_RESOURCE) && - verifier.VerifyString(resource()) && - VerifyOffset(verifier, VT_OPTIONS) && - verifier.VerifyVector(options()) && - verifier.VerifyVectorOfTables(options()) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - verifier.EndTable(); - } -}; - -struct WriteBuilder { - typedef Write Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Write::VT_BASE, base); - } - void add_resource(flatbuffers::Offset resource) { - fbb_.AddOffset(Write::VT_RESOURCE, resource); - } - void add_options(flatbuffers::Offset>> options) { - fbb_.AddOffset(Write::VT_OPTIONS, options); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Write::VT_SCHEMA, schema); - } - explicit WriteBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - WriteBuilder &operator=(const WriteBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Write::VT_RESOURCE); - fbb_.Required(o, Write::VT_SCHEMA); - return o; - } -}; - -inline flatbuffers::Offset CreateWrite( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset resource = 0, - flatbuffers::Offset>> options = 0, - flatbuffers::Offset schema = 0) { - WriteBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_options(options); - builder_.add_resource(resource); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateWriteDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const char *resource = nullptr, - const std::vector> *options = nullptr, - flatbuffers::Offset schema = 0) { - auto resource__ = resource ? _fbb.CreateString(resource) : 0; - auto options__ = options ? _fbb.CreateVector>(*options) : 0; - return org::apache::arrow::computeir::flatbuf::CreateWrite( - _fbb, - base, - resource__, - options__, - schema); -} - -/// A table holding an instance of the possible relation types. -struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef RelationBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_REL_TYPE = 4, - VT_REL = 6 - }; - org::apache::arrow::computeir::flatbuf::RelationImpl rel_type() const { - return static_cast(GetField(VT_REL_TYPE, 0)); - } - const void *rel() const { - return GetPointer(VT_REL); - } - template const T *rel_as() const; - const org::apache::arrow::computeir::flatbuf::Aggregate *rel_as_Aggregate() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Aggregate ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Common *rel_as_Common() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Common ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Custom *rel_as_Custom() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Custom ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::SetOperation *rel_as_SetOperation() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::SetOperation ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Filter *rel_as_Filter() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Filter ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Limit *rel_as_Limit() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Limit ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::LiteralRelation *rel_as_LiteralRelation() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::LiteralRelation ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::OrderBy *rel_as_OrderBy() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::OrderBy ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Project *rel_as_Project() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Project ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Read *rel_as_Read() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Read ? static_cast(rel()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Write *rel_as_Write() const { - return rel_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Write ? static_cast(rel()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_REL_TYPE) && - VerifyOffsetRequired(verifier, VT_REL) && - VerifyRelationImpl(verifier, rel(), rel_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Aggregate *Relation::rel_as() const { - return rel_as_Aggregate(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Common *Relation::rel_as() const { - return rel_as_Common(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Custom *Relation::rel_as() const { - return rel_as_Custom(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::SetOperation *Relation::rel_as() const { - return rel_as_SetOperation(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Filter *Relation::rel_as() const { - return rel_as_Filter(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Limit *Relation::rel_as() const { - return rel_as_Limit(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::LiteralRelation *Relation::rel_as() const { - return rel_as_LiteralRelation(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::OrderBy *Relation::rel_as() const { - return rel_as_OrderBy(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Project *Relation::rel_as() const { - return rel_as_Project(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Read *Relation::rel_as() const { - return rel_as_Read(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Write *Relation::rel_as() const { - return rel_as_Write(); -} - -struct RelationBuilder { - typedef Relation Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_rel_type(org::apache::arrow::computeir::flatbuf::RelationImpl rel_type) { - fbb_.AddElement(Relation::VT_REL_TYPE, static_cast(rel_type), 0); - } - void add_rel(flatbuffers::Offset rel) { - fbb_.AddOffset(Relation::VT_REL, rel); - } - explicit RelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - RelationBuilder &operator=(const RelationBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Relation::VT_REL); - return o; - } -}; - -inline flatbuffers::Offset CreateRelation( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::RelationImpl rel_type = org::apache::arrow::computeir::flatbuf::RelationImpl::NONE, - flatbuffers::Offset rel = 0) { - RelationBuilder builder_(_fbb); - builder_.add_rel(rel); - builder_.add_rel_type(rel_type); - return builder_.Finish(); -} - -/// A specification of a query. -struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef PlanBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SINKS = 4, - VT_DERIVED_FROM = 6 - }; - /// One or more output relations. - const flatbuffers::Vector> *sinks() const { - return GetPointer> *>(VT_SINKS); - } - /// If this Plan was derived from another (for example by running - /// an optimization pass), that plan may be included here to - /// provide a backtrace of derivations. - const org::apache::arrow::computeir::flatbuf::Plan *derived_from() const { - return GetPointer(VT_DERIVED_FROM); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_SINKS) && - verifier.VerifyVector(sinks()) && - verifier.VerifyVectorOfTables(sinks()) && - VerifyOffset(verifier, VT_DERIVED_FROM) && - verifier.VerifyTable(derived_from()) && - verifier.EndTable(); - } -}; - -struct PlanBuilder { - typedef Plan Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_sinks(flatbuffers::Offset>> sinks) { - fbb_.AddOffset(Plan::VT_SINKS, sinks); - } - void add_derived_from(flatbuffers::Offset derived_from) { - fbb_.AddOffset(Plan::VT_DERIVED_FROM, derived_from); - } - explicit PlanBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - PlanBuilder &operator=(const PlanBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Plan::VT_SINKS); - return o; - } -}; - -inline flatbuffers::Offset CreatePlan( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> sinks = 0, - flatbuffers::Offset derived_from = 0) { - PlanBuilder builder_(_fbb); - builder_.add_derived_from(derived_from); - builder_.add_sinks(sinks); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreatePlanDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *sinks = nullptr, - flatbuffers::Offset derived_from = 0) { - auto sinks__ = sinks ? _fbb.CreateVector>(*sinks) : 0; - return org::apache::arrow::computeir::flatbuf::CreatePlan( - _fbb, - sinks__, - derived_from); -} - -inline bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type) { - switch (type) { - case InlineBufferImpl::NONE: { - return true; - } - case InlineBufferImpl::Int8Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Int16Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Int32Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Int64Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt8Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt16Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt32Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt64Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Float32Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Float64Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::TableBuffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyInlineBufferImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type) { - switch (type) { - case ExpressionImpl::NONE: { - return true; - } - case ExpressionImpl::Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::FieldRef: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::Call: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyExpressionImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyShape(flatbuffers::Verifier &verifier, const void *obj, Shape type) { - switch (type) { - case Shape::NONE: { - return true; - } - case Shape::Array: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Shape::Scalar: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyShapeVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyShape( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type) { - switch (type) { - case Deref::NONE: { - return true; - } - case Deref::MapKey: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::StructField: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::ArraySubscript: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::ArraySlice: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::FieldName: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyDeref( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type) { - switch (type) { - case FunctionImpl::NONE: { - return true; - } - case FunctionImpl::CanonicalFunction: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case FunctionImpl::NonCanonicalFunction: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyFunctionImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type) { - switch (type) { - case Emit::NONE: { - return true; - } - case Emit::Remap: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Emit::PassThrough: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyEmit( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type) { - switch (type) { - case JoinKind::NONE: { - return true; - } - case JoinKind::CanonicalJoinKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case JoinKind::NonCanonicalJoinKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyJoinKind( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type) { - switch (type) { - case SetOpKind::NONE: { - return true; - } - case SetOpKind::CanonicalSetOpKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case SetOpKind::NonCanonicalSetOpKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifySetOpKind( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type) { - switch (type) { - case RelationImpl::NONE: { - return true; - } - case RelationImpl::Aggregate: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Common: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Custom: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::SetOperation: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Filter: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Limit: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::LiteralRelation: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::OrderBy: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Project: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Read: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Write: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyRelationImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const org::apache::arrow::computeir::flatbuf::Plan *GetPlan(const void *buf) { - return flatbuffers::GetRoot(buf); -} - -inline const org::apache::arrow::computeir::flatbuf::Plan *GetSizePrefixedPlan(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyPlanBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedPlanBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishPlanBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedPlanBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_COMPUTEIR_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/ExampleExtensions_generated.h b/cpp/src/generated/ExampleExtensions_generated.h deleted file mode 100644 index fc98c8f689503..0000000000000 --- a/cpp/src/generated/ExampleExtensions_generated.h +++ /dev/null @@ -1,691 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_EXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ -#define FLATBUFFERS_GENERATED_EXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ - -#include "flatbuffers/flatbuffers.h" - -#include "Schema_generated.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { -namespace ext { - -struct Uri; -struct UriBuilder; - -struct Sql_FromOptions; -struct Sql_FromOptionsBuilder; - -struct Partitioning; -struct PartitioningBuilder; - -struct FileFormat; -struct FileFormatBuilder; - -struct Arrow_FileSystemDatasetScanOptions; -struct Arrow_FileSystemDatasetScanOptionsBuilder; - -struct Sql_IntoOptions; -struct Sql_IntoOptionsBuilder; - -struct Arrow_StreamOutOptions; -struct Arrow_StreamOutOptionsBuilder; - -struct Arrow_FileSystemDatasetWriteOptions; -struct Arrow_FileSystemDatasetWriteOptionsBuilder; - -///////////////////////////////////////////////////////////// -struct Uri FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UriBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SCHEMA = 4, - VT_USERINFO = 6, - VT_HOST = 8, - VT_PORT = 10, - VT_PATH = 12, - VT_QUERY = 14, - VT_FRAGMENT = 16 - }; - const flatbuffers::String *schema() const { - return GetPointer(VT_SCHEMA); - } - const flatbuffers::String *userinfo() const { - return GetPointer(VT_USERINFO); - } - const flatbuffers::String *host() const { - return GetPointer(VT_HOST); - } - uint16_t port() const { - return GetField(VT_PORT, 0); - } - const flatbuffers::String *path() const { - return GetPointer(VT_PATH); - } - const flatbuffers::Vector> *query() const { - return GetPointer> *>(VT_QUERY); - } - const flatbuffers::String *fragment() const { - return GetPointer(VT_FRAGMENT); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyString(schema()) && - VerifyOffset(verifier, VT_USERINFO) && - verifier.VerifyString(userinfo()) && - VerifyOffsetRequired(verifier, VT_HOST) && - verifier.VerifyString(host()) && - VerifyField(verifier, VT_PORT) && - VerifyOffsetRequired(verifier, VT_PATH) && - verifier.VerifyString(path()) && - VerifyOffset(verifier, VT_QUERY) && - verifier.VerifyVector(query()) && - verifier.VerifyVectorOfTables(query()) && - VerifyOffset(verifier, VT_FRAGMENT) && - verifier.VerifyString(fragment()) && - verifier.EndTable(); - } -}; - -struct UriBuilder { - typedef Uri Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Uri::VT_SCHEMA, schema); - } - void add_userinfo(flatbuffers::Offset userinfo) { - fbb_.AddOffset(Uri::VT_USERINFO, userinfo); - } - void add_host(flatbuffers::Offset host) { - fbb_.AddOffset(Uri::VT_HOST, host); - } - void add_port(uint16_t port) { - fbb_.AddElement(Uri::VT_PORT, port, 0); - } - void add_path(flatbuffers::Offset path) { - fbb_.AddOffset(Uri::VT_PATH, path); - } - void add_query(flatbuffers::Offset>> query) { - fbb_.AddOffset(Uri::VT_QUERY, query); - } - void add_fragment(flatbuffers::Offset fragment) { - fbb_.AddOffset(Uri::VT_FRAGMENT, fragment); - } - explicit UriBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UriBuilder &operator=(const UriBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Uri::VT_SCHEMA); - fbb_.Required(o, Uri::VT_HOST); - fbb_.Required(o, Uri::VT_PATH); - return o; - } -}; - -inline flatbuffers::Offset CreateUri( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset schema = 0, - flatbuffers::Offset userinfo = 0, - flatbuffers::Offset host = 0, - uint16_t port = 0, - flatbuffers::Offset path = 0, - flatbuffers::Offset>> query = 0, - flatbuffers::Offset fragment = 0) { - UriBuilder builder_(_fbb); - builder_.add_fragment(fragment); - builder_.add_query(query); - builder_.add_path(path); - builder_.add_host(host); - builder_.add_userinfo(userinfo); - builder_.add_schema(schema); - builder_.add_port(port); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUriDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *schema = nullptr, - const char *userinfo = nullptr, - const char *host = nullptr, - uint16_t port = 0, - const char *path = nullptr, - const std::vector> *query = nullptr, - const char *fragment = nullptr) { - auto schema__ = schema ? _fbb.CreateString(schema) : 0; - auto userinfo__ = userinfo ? _fbb.CreateString(userinfo) : 0; - auto host__ = host ? _fbb.CreateString(host) : 0; - auto path__ = path ? _fbb.CreateString(path) : 0; - auto query__ = query ? _fbb.CreateVector>(*query) : 0; - auto fragment__ = fragment ? _fbb.CreateString(fragment) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateUri( - _fbb, - schema__, - userinfo__, - host__, - port, - path__, - query__, - fragment__); -} - -/// The contents of Relation.options will be Sql_FromOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "sql", -/// .name = "from", -/// } -struct Sql_FromOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Sql_FromOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME = 4 - }; - /// The name of a table referenced as a source relation. - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct Sql_FromOptionsBuilder { - typedef Sql_FromOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(Sql_FromOptions::VT_NAME, name); - } - explicit Sql_FromOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Sql_FromOptionsBuilder &operator=(const Sql_FromOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Sql_FromOptions::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateSql_FromOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name = 0) { - Sql_FromOptionsBuilder builder_(_fbb); - builder_.add_name(name); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateSql_FromOptionsDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name = nullptr) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateSql_FromOptions( - _fbb, - name__); -} - -struct Partitioning FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef PartitioningBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_FLAVOR = 4, - VT_SCHEMA = 6 - }; - /// Currently supported: "hive", "directory" - const flatbuffers::String *flavor() const { - return GetPointer(VT_FLAVOR); - } - /// Fields on which data is partitioned - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_FLAVOR) && - verifier.VerifyString(flavor()) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - verifier.EndTable(); - } -}; - -struct PartitioningBuilder { - typedef Partitioning Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_flavor(flatbuffers::Offset flavor) { - fbb_.AddOffset(Partitioning::VT_FLAVOR, flavor); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Partitioning::VT_SCHEMA, schema); - } - explicit PartitioningBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - PartitioningBuilder &operator=(const PartitioningBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Partitioning::VT_FLAVOR); - fbb_.Required(o, Partitioning::VT_SCHEMA); - return o; - } -}; - -inline flatbuffers::Offset CreatePartitioning( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset flavor = 0, - flatbuffers::Offset schema = 0) { - PartitioningBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_flavor(flavor); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreatePartitioningDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *flavor = nullptr, - flatbuffers::Offset schema = 0) { - auto flavor__ = flavor ? _fbb.CreateString(flavor) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreatePartitioning( - _fbb, - flavor__, - schema); -} - -struct FileFormat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FileFormatBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME = 4, - VT_OPTIONS = 6 - }; - /// E.g. "parquet", "csv", ... - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - const org::apache::arrow::flatbuf::Buffer *options() const { - return GetStruct(VT_OPTIONS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - VerifyField(verifier, VT_OPTIONS) && - verifier.EndTable(); - } -}; - -struct FileFormatBuilder { - typedef FileFormat Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(FileFormat::VT_NAME, name); - } - void add_options(const org::apache::arrow::flatbuf::Buffer *options) { - fbb_.AddStruct(FileFormat::VT_OPTIONS, options); - } - explicit FileFormatBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FileFormatBuilder &operator=(const FileFormatBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, FileFormat::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateFileFormat( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name = 0, - const org::apache::arrow::flatbuf::Buffer *options = 0) { - FileFormatBuilder builder_(_fbb); - builder_.add_options(options); - builder_.add_name(name); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateFileFormatDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name = nullptr, - const org::apache::arrow::flatbuf::Buffer *options = 0) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateFileFormat( - _fbb, - name__, - options); -} - -/// The contents of Relation.options will be Arrow_FileSystemDatasetScanOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "arrow", -/// .name = "filesystem_dataset_scan", -/// } -struct Arrow_FileSystemDatasetScanOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Arrow_FileSystemDatasetScanOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE_DIR = 4, - VT_FORMAT = 6, - VT_PARTITIONING = 8 - }; - /// The base directory of a dataset which should be scanned - /// as a source relation. A URI is used to accommodate potentially - /// remote file systems. - const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { - return GetPointer(VT_BASE_DIR); - } - /// The format of files in this dataset. - const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { - return GetPointer(VT_FORMAT); - } - /// A partitioning scheme in use in this dataset. - const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { - return GetPointer(VT_PARTITIONING); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE_DIR) && - verifier.VerifyTable(base_dir()) && - VerifyOffsetRequired(verifier, VT_FORMAT) && - verifier.VerifyTable(format()) && - VerifyOffset(verifier, VT_PARTITIONING) && - verifier.VerifyTable(partitioning()) && - verifier.EndTable(); - } -}; - -struct Arrow_FileSystemDatasetScanOptionsBuilder { - typedef Arrow_FileSystemDatasetScanOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base_dir(flatbuffers::Offset base_dir) { - fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR, base_dir); - } - void add_format(flatbuffers::Offset format) { - fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_FORMAT, format); - } - void add_partitioning(flatbuffers::Offset partitioning) { - fbb_.AddOffset(Arrow_FileSystemDatasetScanOptions::VT_PARTITIONING, partitioning); - } - explicit Arrow_FileSystemDatasetScanOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Arrow_FileSystemDatasetScanOptionsBuilder &operator=(const Arrow_FileSystemDatasetScanOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_BASE_DIR); - fbb_.Required(o, Arrow_FileSystemDatasetScanOptions::VT_FORMAT); - return o; - } -}; - -inline flatbuffers::Offset CreateArrow_FileSystemDatasetScanOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0) { - Arrow_FileSystemDatasetScanOptionsBuilder builder_(_fbb); - builder_.add_partitioning(partitioning); - builder_.add_format(format); - builder_.add_base_dir(base_dir); - return builder_.Finish(); -} - -///////////////////////////////////////////////////////////// -/// The contents of Relation.options will be Sql_IntoOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "sql", -/// .name = "into", -/// } -struct Sql_IntoOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Sql_IntoOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME = 4, - VT_APPEND = 6 - }; - /// The name of a table into which rows will be inserted. - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - /// Whether rows written into the table should be appended - /// to the table's current rows (INSERT INTO). - /// If false, the table will be overwritten (INTO). - bool append() const { - return GetField(VT_APPEND, 1) != 0; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - VerifyField(verifier, VT_APPEND) && - verifier.EndTable(); - } -}; - -struct Sql_IntoOptionsBuilder { - typedef Sql_IntoOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(Sql_IntoOptions::VT_NAME, name); - } - void add_append(bool append) { - fbb_.AddElement(Sql_IntoOptions::VT_APPEND, static_cast(append), 1); - } - explicit Sql_IntoOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Sql_IntoOptionsBuilder &operator=(const Sql_IntoOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Sql_IntoOptions::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateSql_IntoOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name = 0, - bool append = true) { - Sql_IntoOptionsBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_append(append); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateSql_IntoOptionsDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name = nullptr, - bool append = true) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateSql_IntoOptions( - _fbb, - name__, - append); -} - -/// The contents of Relation.options will be Arrow_StreamOutOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "arrow", -/// .name = "stream_out", -/// } -struct Arrow_StreamOutOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Arrow_StreamOutOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_DESTINATION = 4 - }; - /// The URI to which RecordBatches of output should be streamed. - const org::apache::arrow::computeir::flatbuf::ext::Uri *destination() const { - return GetPointer(VT_DESTINATION); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_DESTINATION) && - verifier.VerifyTable(destination()) && - verifier.EndTable(); - } -}; - -struct Arrow_StreamOutOptionsBuilder { - typedef Arrow_StreamOutOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_destination(flatbuffers::Offset destination) { - fbb_.AddOffset(Arrow_StreamOutOptions::VT_DESTINATION, destination); - } - explicit Arrow_StreamOutOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Arrow_StreamOutOptionsBuilder &operator=(const Arrow_StreamOutOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Arrow_StreamOutOptions::VT_DESTINATION); - return o; - } -}; - -inline flatbuffers::Offset CreateArrow_StreamOutOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset destination = 0) { - Arrow_StreamOutOptionsBuilder builder_(_fbb); - builder_.add_destination(destination); - return builder_.Finish(); -} - -/// The contents of Relation.options will be Arrow_FileSystemDatasetWriteOptions -/// if Relation.operation = NonCanonicalOperation{ -/// .name_space = "arrow", -/// .name = "filesystem_dataset_write", -/// } -struct Arrow_FileSystemDatasetWriteOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Arrow_FileSystemDatasetWriteOptionsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE_DIR = 4, - VT_FORMAT = 6, - VT_PARTITIONING = 8, - VT_BASENAME_TEMPLATE = 10 - }; - /// The base directory of a dataset into which output batches should be - /// written. A URI is used to accommodate potentially remote file systems. - /// Files present in this directory will not be explicitly deleted, though - /// they may be overwritten. - const org::apache::arrow::computeir::flatbuf::ext::Uri *base_dir() const { - return GetPointer(VT_BASE_DIR); - } - /// The format in which to write files. - const org::apache::arrow::computeir::flatbuf::ext::FileFormat *format() const { - return GetPointer(VT_FORMAT); - } - /// A partitioning scheme which should be used when writing this dataset. - const org::apache::arrow::computeir::flatbuf::ext::Partitioning *partitioning() const { - return GetPointer(VT_PARTITIONING); - } - /// Template string used to generate written files' basenames. - /// {i} will be replaced by an auto incremented integer. - const flatbuffers::String *basename_template() const { - return GetPointer(VT_BASENAME_TEMPLATE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE_DIR) && - verifier.VerifyTable(base_dir()) && - VerifyOffsetRequired(verifier, VT_FORMAT) && - verifier.VerifyTable(format()) && - VerifyOffset(verifier, VT_PARTITIONING) && - verifier.VerifyTable(partitioning()) && - VerifyOffsetRequired(verifier, VT_BASENAME_TEMPLATE) && - verifier.VerifyString(basename_template()) && - verifier.EndTable(); - } -}; - -struct Arrow_FileSystemDatasetWriteOptionsBuilder { - typedef Arrow_FileSystemDatasetWriteOptions Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base_dir(flatbuffers::Offset base_dir) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR, base_dir); - } - void add_format(flatbuffers::Offset format) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_FORMAT, format); - } - void add_partitioning(flatbuffers::Offset partitioning) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_PARTITIONING, partitioning); - } - void add_basename_template(flatbuffers::Offset basename_template) { - fbb_.AddOffset(Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE, basename_template); - } - explicit Arrow_FileSystemDatasetWriteOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Arrow_FileSystemDatasetWriteOptionsBuilder &operator=(const Arrow_FileSystemDatasetWriteOptionsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASE_DIR); - fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_FORMAT); - fbb_.Required(o, Arrow_FileSystemDatasetWriteOptions::VT_BASENAME_TEMPLATE); - return o; - } -}; - -inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptions( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0, - flatbuffers::Offset basename_template = 0) { - Arrow_FileSystemDatasetWriteOptionsBuilder builder_(_fbb); - builder_.add_basename_template(basename_template); - builder_.add_partitioning(partitioning); - builder_.add_format(format); - builder_.add_base_dir(base_dir); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateArrow_FileSystemDatasetWriteOptionsDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base_dir = 0, - flatbuffers::Offset format = 0, - flatbuffers::Offset partitioning = 0, - const char *basename_template = nullptr) { - auto basename_template__ = basename_template ? _fbb.CreateString(basename_template) : 0; - return org::apache::arrow::computeir::flatbuf::ext::CreateArrow_FileSystemDatasetWriteOptions( - _fbb, - base_dir, - format, - partitioning, - basename_template__); -} - -} // namespace ext -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_EXAMPLEEXTENSIONS_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_EXT_H_ diff --git a/cpp/src/generated/Expression_generated.h b/cpp/src/generated/Expression_generated.h deleted file mode 100644 index 0f5667f03c824..0000000000000 --- a/cpp/src/generated/Expression_generated.h +++ /dev/null @@ -1,2657 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_EXPRESSION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ -#define FLATBUFFERS_GENERATED_EXPRESSION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ - -#include "flatbuffers/flatbuffers.h" - -#include "Schema_generated.h" -#include "InlineBuffer_generated.h" -#include "Literal_generated.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { - -struct MapKey; -struct MapKeyBuilder; - -struct StructField; -struct StructFieldBuilder; - -struct ArraySubscript; -struct ArraySubscriptBuilder; - -struct ArraySlice; -struct ArraySliceBuilder; - -struct FieldName; -struct FieldNameBuilder; - -struct FieldRef; -struct FieldRefBuilder; - -struct CanonicalFunction; -struct CanonicalFunctionBuilder; - -struct NonCanonicalFunction; -struct NonCanonicalFunctionBuilder; - -struct Call; -struct CallBuilder; - -struct CaseFragment; -struct CaseFragmentBuilder; - -struct Case; -struct CaseBuilder; - -struct Cast; -struct CastBuilder; - -struct Extract; -struct ExtractBuilder; - -struct SortKey; -struct SortKeyBuilder; - -struct Unbounded; -struct UnboundedBuilder; - -struct Preceding; -struct PrecedingBuilder; - -struct Following; -struct FollowingBuilder; - -struct CurrentRow; -struct CurrentRowBuilder; - -struct Bound; -struct BoundBuilder; - -struct WindowCall; -struct WindowCallBuilder; - -struct CanonicalAggregate; -struct CanonicalAggregateBuilder; - -struct NonCanonicalAggregate; -struct NonCanonicalAggregateBuilder; - -struct AggregateCall; -struct AggregateCallBuilder; - -struct Expression; -struct ExpressionBuilder; - -/// A union of possible dereference operations -enum class Deref : uint8_t { - NONE = 0, - /// Access a value for a given map key - MapKey = 1, - /// Access the value at a struct field - StructField = 2, - /// Access the element at a given index in an array - ArraySubscript = 3, - /// Access a range of elements in an array - ArraySlice = 4, - /// Access a field of a relation - FieldName = 5, - MIN = NONE, - MAX = FieldName -}; - -inline const Deref (&EnumValuesDeref())[6] { - static const Deref values[] = { - Deref::NONE, - Deref::MapKey, - Deref::StructField, - Deref::ArraySubscript, - Deref::ArraySlice, - Deref::FieldName - }; - return values; -} - -inline const char * const *EnumNamesDeref() { - static const char * const names[7] = { - "NONE", - "MapKey", - "StructField", - "ArraySubscript", - "ArraySlice", - "FieldName", - nullptr - }; - return names; -} - -inline const char *EnumNameDeref(Deref e) { - if (flatbuffers::IsOutRange(e, Deref::NONE, Deref::FieldName)) return ""; - const size_t index = static_cast(e); - return EnumNamesDeref()[index]; -} - -template struct DerefTraits { - static const Deref enum_value = Deref::NONE; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::MapKey; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::StructField; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::ArraySubscript; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::ArraySlice; -}; - -template<> struct DerefTraits { - static const Deref enum_value = Deref::FieldName; -}; - -bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type); -bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// A canonical (probably SQL equivalent) function -enum class CanonicalFunctionId : uint32_t { - And = 0, - Not = 1, - Or = 2, - Add = 3, - Subtract = 4, - Multiply = 5, - Divide = 6, - Power = 7, - AbsoluteValue = 8, - Negate = 9, - Sign = 10, - DateSub = 11, - DateAdd = 12, - DateDiff = 13, - TimeAdd = 14, - TimeSub = 15, - TimeDiff = 16, - TimestampAdd = 17, - TimestampSub = 18, - TimestampDiff = 19, - Equals = 20, - NotEquals = 21, - Greater = 22, - GreaterEqual = 23, - Less = 24, - LessEqual = 25, - MIN = And, - MAX = LessEqual -}; - -inline const CanonicalFunctionId (&EnumValuesCanonicalFunctionId())[26] { - static const CanonicalFunctionId values[] = { - CanonicalFunctionId::And, - CanonicalFunctionId::Not, - CanonicalFunctionId::Or, - CanonicalFunctionId::Add, - CanonicalFunctionId::Subtract, - CanonicalFunctionId::Multiply, - CanonicalFunctionId::Divide, - CanonicalFunctionId::Power, - CanonicalFunctionId::AbsoluteValue, - CanonicalFunctionId::Negate, - CanonicalFunctionId::Sign, - CanonicalFunctionId::DateSub, - CanonicalFunctionId::DateAdd, - CanonicalFunctionId::DateDiff, - CanonicalFunctionId::TimeAdd, - CanonicalFunctionId::TimeSub, - CanonicalFunctionId::TimeDiff, - CanonicalFunctionId::TimestampAdd, - CanonicalFunctionId::TimestampSub, - CanonicalFunctionId::TimestampDiff, - CanonicalFunctionId::Equals, - CanonicalFunctionId::NotEquals, - CanonicalFunctionId::Greater, - CanonicalFunctionId::GreaterEqual, - CanonicalFunctionId::Less, - CanonicalFunctionId::LessEqual - }; - return values; -} - -inline const char * const *EnumNamesCanonicalFunctionId() { - static const char * const names[27] = { - "And", - "Not", - "Or", - "Add", - "Subtract", - "Multiply", - "Divide", - "Power", - "AbsoluteValue", - "Negate", - "Sign", - "DateSub", - "DateAdd", - "DateDiff", - "TimeAdd", - "TimeSub", - "TimeDiff", - "TimestampAdd", - "TimestampSub", - "TimestampDiff", - "Equals", - "NotEquals", - "Greater", - "GreaterEqual", - "Less", - "LessEqual", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalFunctionId(CanonicalFunctionId e) { - if (flatbuffers::IsOutRange(e, CanonicalFunctionId::And, CanonicalFunctionId::LessEqual)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalFunctionId()[index]; -} - -enum class FunctionImpl : uint8_t { - NONE = 0, - CanonicalFunction = 1, - NonCanonicalFunction = 2, - MIN = NONE, - MAX = NonCanonicalFunction -}; - -inline const FunctionImpl (&EnumValuesFunctionImpl())[3] { - static const FunctionImpl values[] = { - FunctionImpl::NONE, - FunctionImpl::CanonicalFunction, - FunctionImpl::NonCanonicalFunction - }; - return values; -} - -inline const char * const *EnumNamesFunctionImpl() { - static const char * const names[4] = { - "NONE", - "CanonicalFunction", - "NonCanonicalFunction", - nullptr - }; - return names; -} - -inline const char *EnumNameFunctionImpl(FunctionImpl e) { - if (flatbuffers::IsOutRange(e, FunctionImpl::NONE, FunctionImpl::NonCanonicalFunction)) return ""; - const size_t index = static_cast(e); - return EnumNamesFunctionImpl()[index]; -} - -template struct FunctionImplTraits { - static const FunctionImpl enum_value = FunctionImpl::NONE; -}; - -template<> struct FunctionImplTraits { - static const FunctionImpl enum_value = FunctionImpl::CanonicalFunction; -}; - -template<> struct FunctionImplTraits { - static const FunctionImpl enum_value = FunctionImpl::NonCanonicalFunction; -}; - -bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type); -bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// Whether lesser values should precede greater or vice versa, -/// also whether nulls should preced or follow values. -enum class Ordering : uint8_t { - ASCENDING_THEN_NULLS = 0, - DESCENDING_THEN_NULLS = 1, - NULLS_THEN_ASCENDING = 2, - NULLS_THEN_DESCENDING = 3, - MIN = ASCENDING_THEN_NULLS, - MAX = NULLS_THEN_DESCENDING -}; - -inline const Ordering (&EnumValuesOrdering())[4] { - static const Ordering values[] = { - Ordering::ASCENDING_THEN_NULLS, - Ordering::DESCENDING_THEN_NULLS, - Ordering::NULLS_THEN_ASCENDING, - Ordering::NULLS_THEN_DESCENDING - }; - return values; -} - -inline const char * const *EnumNamesOrdering() { - static const char * const names[5] = { - "ASCENDING_THEN_NULLS", - "DESCENDING_THEN_NULLS", - "NULLS_THEN_ASCENDING", - "NULLS_THEN_DESCENDING", - nullptr - }; - return names; -} - -inline const char *EnumNameOrdering(Ordering e) { - if (flatbuffers::IsOutRange(e, Ordering::ASCENDING_THEN_NULLS, Ordering::NULLS_THEN_DESCENDING)) return ""; - const size_t index = static_cast(e); - return EnumNamesOrdering()[index]; -} - -enum class ConcreteBoundImpl : uint8_t { - NONE = 0, - Expression = 1, - Unbounded = 2, - MIN = NONE, - MAX = Unbounded -}; - -inline const ConcreteBoundImpl (&EnumValuesConcreteBoundImpl())[3] { - static const ConcreteBoundImpl values[] = { - ConcreteBoundImpl::NONE, - ConcreteBoundImpl::Expression, - ConcreteBoundImpl::Unbounded - }; - return values; -} - -inline const char * const *EnumNamesConcreteBoundImpl() { - static const char * const names[4] = { - "NONE", - "Expression", - "Unbounded", - nullptr - }; - return names; -} - -inline const char *EnumNameConcreteBoundImpl(ConcreteBoundImpl e) { - if (flatbuffers::IsOutRange(e, ConcreteBoundImpl::NONE, ConcreteBoundImpl::Unbounded)) return ""; - const size_t index = static_cast(e); - return EnumNamesConcreteBoundImpl()[index]; -} - -template struct ConcreteBoundImplTraits { - static const ConcreteBoundImpl enum_value = ConcreteBoundImpl::NONE; -}; - -template<> struct ConcreteBoundImplTraits { - static const ConcreteBoundImpl enum_value = ConcreteBoundImpl::Expression; -}; - -template<> struct ConcreteBoundImplTraits { - static const ConcreteBoundImpl enum_value = ConcreteBoundImpl::Unbounded; -}; - -bool VerifyConcreteBoundImpl(flatbuffers::Verifier &verifier, const void *obj, ConcreteBoundImpl type); -bool VerifyConcreteBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class BoundImpl : uint8_t { - NONE = 0, - Preceding = 1, - Following = 2, - CurrentRow = 3, - MIN = NONE, - MAX = CurrentRow -}; - -inline const BoundImpl (&EnumValuesBoundImpl())[4] { - static const BoundImpl values[] = { - BoundImpl::NONE, - BoundImpl::Preceding, - BoundImpl::Following, - BoundImpl::CurrentRow - }; - return values; -} - -inline const char * const *EnumNamesBoundImpl() { - static const char * const names[5] = { - "NONE", - "Preceding", - "Following", - "CurrentRow", - nullptr - }; - return names; -} - -inline const char *EnumNameBoundImpl(BoundImpl e) { - if (flatbuffers::IsOutRange(e, BoundImpl::NONE, BoundImpl::CurrentRow)) return ""; - const size_t index = static_cast(e); - return EnumNamesBoundImpl()[index]; -} - -template struct BoundImplTraits { - static const BoundImpl enum_value = BoundImpl::NONE; -}; - -template<> struct BoundImplTraits { - static const BoundImpl enum_value = BoundImpl::Preceding; -}; - -template<> struct BoundImplTraits { - static const BoundImpl enum_value = BoundImpl::Following; -}; - -template<> struct BoundImplTraits { - static const BoundImpl enum_value = BoundImpl::CurrentRow; -}; - -bool VerifyBoundImpl(flatbuffers::Verifier &verifier, const void *obj, BoundImpl type); -bool VerifyBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// The kind of window function to be executed. -enum class Frame : uint8_t { - Rows = 0, - Range = 1, - MIN = Rows, - MAX = Range -}; - -inline const Frame (&EnumValuesFrame())[2] { - static const Frame values[] = { - Frame::Rows, - Frame::Range - }; - return values; -} - -inline const char * const *EnumNamesFrame() { - static const char * const names[3] = { - "Rows", - "Range", - nullptr - }; - return names; -} - -inline const char *EnumNameFrame(Frame e) { - if (flatbuffers::IsOutRange(e, Frame::Rows, Frame::Range)) return ""; - const size_t index = static_cast(e); - return EnumNamesFrame()[index]; -} - -/// A canonical (probably SQL equivalent) function -enum class CanonicalAggregateId : uint32_t { - All = 0, - Any = 1, - Count = 2, - CountTable = 3, - Mean = 4, - Min = 5, - Max = 6, - Product = 7, - Sum = 8, - Variance = 9, - StandardDev = 10, - MIN = All, - MAX = StandardDev -}; - -inline const CanonicalAggregateId (&EnumValuesCanonicalAggregateId())[11] { - static const CanonicalAggregateId values[] = { - CanonicalAggregateId::All, - CanonicalAggregateId::Any, - CanonicalAggregateId::Count, - CanonicalAggregateId::CountTable, - CanonicalAggregateId::Mean, - CanonicalAggregateId::Min, - CanonicalAggregateId::Max, - CanonicalAggregateId::Product, - CanonicalAggregateId::Sum, - CanonicalAggregateId::Variance, - CanonicalAggregateId::StandardDev - }; - return values; -} - -inline const char * const *EnumNamesCanonicalAggregateId() { - static const char * const names[12] = { - "All", - "Any", - "Count", - "CountTable", - "Mean", - "Min", - "Max", - "Product", - "Sum", - "Variance", - "StandardDev", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalAggregateId(CanonicalAggregateId e) { - if (flatbuffers::IsOutRange(e, CanonicalAggregateId::All, CanonicalAggregateId::StandardDev)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalAggregateId()[index]; -} - -enum class AggregateImpl : uint8_t { - NONE = 0, - CanonicalAggregate = 1, - NonCanonicalAggregate = 2, - MIN = NONE, - MAX = NonCanonicalAggregate -}; - -inline const AggregateImpl (&EnumValuesAggregateImpl())[3] { - static const AggregateImpl values[] = { - AggregateImpl::NONE, - AggregateImpl::CanonicalAggregate, - AggregateImpl::NonCanonicalAggregate - }; - return values; -} - -inline const char * const *EnumNamesAggregateImpl() { - static const char * const names[4] = { - "NONE", - "CanonicalAggregate", - "NonCanonicalAggregate", - nullptr - }; - return names; -} - -inline const char *EnumNameAggregateImpl(AggregateImpl e) { - if (flatbuffers::IsOutRange(e, AggregateImpl::NONE, AggregateImpl::NonCanonicalAggregate)) return ""; - const size_t index = static_cast(e); - return EnumNamesAggregateImpl()[index]; -} - -template struct AggregateImplTraits { - static const AggregateImpl enum_value = AggregateImpl::NONE; -}; - -template<> struct AggregateImplTraits { - static const AggregateImpl enum_value = AggregateImpl::CanonicalAggregate; -}; - -template<> struct AggregateImplTraits { - static const AggregateImpl enum_value = AggregateImpl::NonCanonicalAggregate; -}; - -bool VerifyAggregateImpl(flatbuffers::Verifier &verifier, const void *obj, AggregateImpl type); -bool VerifyAggregateImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// An expression is one of -/// - a Literal datum -/// - a reference to a field from a Relation -/// - a call to a named function -/// - a case expression -/// - a cast expression -/// - an extract operation -/// - a window function call -/// - an aggregate function call -/// -/// The expressions here that look like function calls such as -/// Cast,Case and Extract are special in that while they might -/// fit into a Call, they don't cleanly do so without having -/// to pass around non-expression arguments as metadata. -/// -/// AggregateCall and WindowCall are also separate variants -/// due to special options for each that don't apply to generic -/// function calls. Again this is done to make it easier -/// for consumers to deal with the structure of the operation -enum class ExpressionImpl : uint8_t { - NONE = 0, - Literal = 1, - FieldRef = 2, - Call = 3, - Case = 4, - Cast = 5, - Extract = 6, - WindowCall = 7, - AggregateCall = 8, - MIN = NONE, - MAX = AggregateCall -}; - -inline const ExpressionImpl (&EnumValuesExpressionImpl())[9] { - static const ExpressionImpl values[] = { - ExpressionImpl::NONE, - ExpressionImpl::Literal, - ExpressionImpl::FieldRef, - ExpressionImpl::Call, - ExpressionImpl::Case, - ExpressionImpl::Cast, - ExpressionImpl::Extract, - ExpressionImpl::WindowCall, - ExpressionImpl::AggregateCall - }; - return values; -} - -inline const char * const *EnumNamesExpressionImpl() { - static const char * const names[10] = { - "NONE", - "Literal", - "FieldRef", - "Call", - "Case", - "Cast", - "Extract", - "WindowCall", - "AggregateCall", - nullptr - }; - return names; -} - -inline const char *EnumNameExpressionImpl(ExpressionImpl e) { - if (flatbuffers::IsOutRange(e, ExpressionImpl::NONE, ExpressionImpl::AggregateCall)) return ""; - const size_t index = static_cast(e); - return EnumNamesExpressionImpl()[index]; -} - -template struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::NONE; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::Literal; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::FieldRef; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::Call; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::Case; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::Cast; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::Extract; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::WindowCall; -}; - -template<> struct ExpressionImplTraits { - static const ExpressionImpl enum_value = ExpressionImpl::AggregateCall; -}; - -bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type); -bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// Access a value for a given map key -struct MapKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef MapKeyBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KEY = 4 - }; - const flatbuffers::String *key() const { - return GetPointer(VT_KEY); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_KEY) && - verifier.VerifyString(key()) && - verifier.EndTable(); - } -}; - -struct MapKeyBuilder { - typedef MapKey Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_key(flatbuffers::Offset key) { - fbb_.AddOffset(MapKey::VT_KEY, key); - } - explicit MapKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - MapKeyBuilder &operator=(const MapKeyBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, MapKey::VT_KEY); - return o; - } -}; - -inline flatbuffers::Offset CreateMapKey( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset key = 0) { - MapKeyBuilder builder_(_fbb); - builder_.add_key(key); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateMapKeyDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *key = nullptr) { - auto key__ = key ? _fbb.CreateString(key) : 0; - return org::apache::arrow::computeir::flatbuf::CreateMapKey( - _fbb, - key__); -} - -/// Struct field access -struct StructField FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef StructFieldBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_POSITION = 4 - }; - /// The position of the field in the struct schema - uint32_t position() const { - return GetField(VT_POSITION, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_POSITION) && - verifier.EndTable(); - } -}; - -struct StructFieldBuilder { - typedef StructField Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_position(uint32_t position) { - fbb_.AddElement(StructField::VT_POSITION, position, 0); - } - explicit StructFieldBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - StructFieldBuilder &operator=(const StructFieldBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateStructField( - flatbuffers::FlatBufferBuilder &_fbb, - uint32_t position = 0) { - StructFieldBuilder builder_(_fbb); - builder_.add_position(position); - return builder_.Finish(); -} - -/// Zero-based array index -struct ArraySubscript FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ArraySubscriptBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_POSITION = 4 - }; - uint32_t position() const { - return GetField(VT_POSITION, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_POSITION) && - verifier.EndTable(); - } -}; - -struct ArraySubscriptBuilder { - typedef ArraySubscript Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_position(uint32_t position) { - fbb_.AddElement(ArraySubscript::VT_POSITION, position, 0); - } - explicit ArraySubscriptBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ArraySubscriptBuilder &operator=(const ArraySubscriptBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateArraySubscript( - flatbuffers::FlatBufferBuilder &_fbb, - uint32_t position = 0) { - ArraySubscriptBuilder builder_(_fbb); - builder_.add_position(position); - return builder_.Finish(); -} - -/// Zero-based range of elements in an array -struct ArraySlice FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ArraySliceBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_START_INCLUSIVE = 4, - VT_END_EXCLUSIVE = 6 - }; - /// The start of an array slice, inclusive - uint32_t start_inclusive() const { - return GetField(VT_START_INCLUSIVE, 0); - } - /// The end of an array slice, exclusive - uint32_t end_exclusive() const { - return GetField(VT_END_EXCLUSIVE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_START_INCLUSIVE) && - VerifyField(verifier, VT_END_EXCLUSIVE) && - verifier.EndTable(); - } -}; - -struct ArraySliceBuilder { - typedef ArraySlice Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_start_inclusive(uint32_t start_inclusive) { - fbb_.AddElement(ArraySlice::VT_START_INCLUSIVE, start_inclusive, 0); - } - void add_end_exclusive(uint32_t end_exclusive) { - fbb_.AddElement(ArraySlice::VT_END_EXCLUSIVE, end_exclusive, 0); - } - explicit ArraySliceBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ArraySliceBuilder &operator=(const ArraySliceBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateArraySlice( - flatbuffers::FlatBufferBuilder &_fbb, - uint32_t start_inclusive = 0, - uint32_t end_exclusive = 0) { - ArraySliceBuilder builder_(_fbb); - builder_.add_end_exclusive(end_exclusive); - builder_.add_start_inclusive(start_inclusive); - return builder_.Finish(); -} - -/// Field name in a relation -struct FieldName FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FieldNameBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_POSITION = 4 - }; - uint32_t position() const { - return GetField(VT_POSITION, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_POSITION) && - verifier.EndTable(); - } -}; - -struct FieldNameBuilder { - typedef FieldName Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_position(uint32_t position) { - fbb_.AddElement(FieldName::VT_POSITION, position, 0); - } - explicit FieldNameBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FieldNameBuilder &operator=(const FieldNameBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateFieldName( - flatbuffers::FlatBufferBuilder &_fbb, - uint32_t position = 0) { - FieldNameBuilder builder_(_fbb); - builder_.add_position(position); - return builder_.Finish(); -} - -/// Access the data of a field -struct FieldRef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FieldRefBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_REF_TYPE = 4, - VT_REF = 6, - VT_RELATION_INDEX = 8 - }; - org::apache::arrow::computeir::flatbuf::Deref ref_type() const { - return static_cast(GetField(VT_REF_TYPE, 0)); - } - /// A sequence of field names to allow referencing potentially nested fields - const void *ref() const { - return GetPointer(VT_REF); - } - template const T *ref_as() const; - const org::apache::arrow::computeir::flatbuf::MapKey *ref_as_MapKey() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::MapKey ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::StructField *ref_as_StructField() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::StructField ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::ArraySubscript *ref_as_ArraySubscript() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySubscript ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::ArraySlice *ref_as_ArraySlice() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::ArraySlice ? static_cast(ref()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::FieldName *ref_as_FieldName() const { - return ref_type() == org::apache::arrow::computeir::flatbuf::Deref::FieldName ? static_cast(ref()) : nullptr; - } - /// For Expressions which might reference fields in multiple Relations, - /// this index may be provided to indicate which Relation's fields - /// `path` points into. For example in the case of a join, - /// 0 refers to the left relation and 1 to the right relation. - int32_t relation_index() const { - return GetField(VT_RELATION_INDEX, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_REF_TYPE) && - VerifyOffsetRequired(verifier, VT_REF) && - VerifyDeref(verifier, ref(), ref_type()) && - VerifyField(verifier, VT_RELATION_INDEX) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::MapKey *FieldRef::ref_as() const { - return ref_as_MapKey(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::StructField *FieldRef::ref_as() const { - return ref_as_StructField(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::ArraySubscript *FieldRef::ref_as() const { - return ref_as_ArraySubscript(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::ArraySlice *FieldRef::ref_as() const { - return ref_as_ArraySlice(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::FieldName *FieldRef::ref_as() const { - return ref_as_FieldName(); -} - -struct FieldRefBuilder { - typedef FieldRef Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_ref_type(org::apache::arrow::computeir::flatbuf::Deref ref_type) { - fbb_.AddElement(FieldRef::VT_REF_TYPE, static_cast(ref_type), 0); - } - void add_ref(flatbuffers::Offset ref) { - fbb_.AddOffset(FieldRef::VT_REF, ref); - } - void add_relation_index(int32_t relation_index) { - fbb_.AddElement(FieldRef::VT_RELATION_INDEX, relation_index, 0); - } - explicit FieldRefBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FieldRefBuilder &operator=(const FieldRefBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, FieldRef::VT_REF); - return o; - } -}; - -inline flatbuffers::Offset CreateFieldRef( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::Deref ref_type = org::apache::arrow::computeir::flatbuf::Deref::NONE, - flatbuffers::Offset ref = 0, - int32_t relation_index = 0) { - FieldRefBuilder builder_(_fbb); - builder_.add_relation_index(relation_index); - builder_.add_ref(ref); - builder_.add_ref_type(ref_type); - return builder_.Finish(); -} - -struct CanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalFunctionBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 - }; - org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id() const { - return static_cast(GetField(VT_ID, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && - verifier.EndTable(); - } -}; - -struct CanonicalFunctionBuilder { - typedef CanonicalFunction Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id) { - fbb_.AddElement(CanonicalFunction::VT_ID, static_cast(id), 0); - } - explicit CanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CanonicalFunctionBuilder &operator=(const CanonicalFunctionBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCanonicalFunction( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::CanonicalFunctionId id = org::apache::arrow::computeir::flatbuf::CanonicalFunctionId::And) { - CanonicalFunctionBuilder builder_(_fbb); - builder_.add_id(id); - return builder_.Finish(); -} - -struct NonCanonicalFunction FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalFunctionBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 - }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); - } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct NonCanonicalFunctionBuilder { - typedef NonCanonicalFunction Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalFunction::VT_NAME_SPACE, name_space); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalFunction::VT_NAME, name); - } - explicit NonCanonicalFunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NonCanonicalFunctionBuilder &operator=(const NonCanonicalFunctionBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalFunction::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateNonCanonicalFunction( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalFunctionBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateNonCanonicalFunctionDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalFunction( - _fbb, - name_space__, - name__); -} - -/// A function call expression -struct Call FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CallBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KIND_TYPE = 4, - VT_KIND = 6, - VT_ARGUMENTS = 8, - VT_METADATA = 10 - }; - org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type() const { - return static_cast(GetField(VT_KIND_TYPE, 0)); - } - /// The kind of function call this is. - const void *kind() const { - return GetPointer(VT_KIND); - } - template const T *kind_as() const; - const org::apache::arrow::computeir::flatbuf::CanonicalFunction *kind_as_CanonicalFunction() const { - return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::CanonicalFunction ? static_cast(kind()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *kind_as_NonCanonicalFunction() const { - return kind_type() == org::apache::arrow::computeir::flatbuf::FunctionImpl::NonCanonicalFunction ? static_cast(kind()) : nullptr; - } - /// The arguments passed to `function_name`. - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); - } - /// Parameters for `function_name`; content/format may be unique to each - /// value of `function_name`. - const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { - return GetPointer(VT_METADATA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_KIND_TYPE) && - VerifyOffsetRequired(verifier, VT_KIND) && - VerifyFunctionImpl(verifier, kind(), kind_type()) && - VerifyOffsetRequired(verifier, VT_ARGUMENTS) && - verifier.VerifyVector(arguments()) && - verifier.VerifyVectorOfTables(arguments()) && - VerifyOffset(verifier, VT_METADATA) && - verifier.VerifyTable(metadata()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalFunction *Call::kind_as() const { - return kind_as_CanonicalFunction(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalFunction *Call::kind_as() const { - return kind_as_NonCanonicalFunction(); -} - -struct CallBuilder { - typedef Call Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_kind_type(org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type) { - fbb_.AddElement(Call::VT_KIND_TYPE, static_cast(kind_type), 0); - } - void add_kind(flatbuffers::Offset kind) { - fbb_.AddOffset(Call::VT_KIND, kind); - } - void add_arguments(flatbuffers::Offset>> arguments) { - fbb_.AddOffset(Call::VT_ARGUMENTS, arguments); - } - void add_metadata(flatbuffers::Offset metadata) { - fbb_.AddOffset(Call::VT_METADATA, metadata); - } - explicit CallBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CallBuilder &operator=(const CallBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Call::VT_KIND); - fbb_.Required(o, Call::VT_ARGUMENTS); - return o; - } -}; - -inline flatbuffers::Offset CreateCall( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, - flatbuffers::Offset kind = 0, - flatbuffers::Offset>> arguments = 0, - flatbuffers::Offset metadata = 0) { - CallBuilder builder_(_fbb); - builder_.add_metadata(metadata); - builder_.add_arguments(arguments); - builder_.add_kind(kind); - builder_.add_kind_type(kind_type); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateCallDirect( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::FunctionImpl kind_type = org::apache::arrow::computeir::flatbuf::FunctionImpl::NONE, - flatbuffers::Offset kind = 0, - const std::vector> *arguments = nullptr, - flatbuffers::Offset metadata = 0) { - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; - return org::apache::arrow::computeir::flatbuf::CreateCall( - _fbb, - kind_type, - kind, - arguments__, - metadata); -} - -/// A single WHEN x THEN y fragment. -struct CaseFragment FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CaseFragmentBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_WHEN = 4, - VT_THEN = 6 - }; - const org::apache::arrow::computeir::flatbuf::Expression *when() const { - return GetPointer(VT_WHEN); - } - const org::apache::arrow::computeir::flatbuf::Expression *then() const { - return GetPointer(VT_THEN); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_WHEN) && - verifier.VerifyTable(when()) && - VerifyOffsetRequired(verifier, VT_THEN) && - verifier.VerifyTable(then()) && - verifier.EndTable(); - } -}; - -struct CaseFragmentBuilder { - typedef CaseFragment Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_when(flatbuffers::Offset when) { - fbb_.AddOffset(CaseFragment::VT_WHEN, when); - } - void add_then(flatbuffers::Offset then) { - fbb_.AddOffset(CaseFragment::VT_THEN, then); - } - explicit CaseFragmentBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CaseFragmentBuilder &operator=(const CaseFragmentBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, CaseFragment::VT_WHEN); - fbb_.Required(o, CaseFragment::VT_THEN); - return o; - } -}; - -inline flatbuffers::Offset CreateCaseFragment( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset when = 0, - flatbuffers::Offset then = 0) { - CaseFragmentBuilder builder_(_fbb); - builder_.add_then(then); - builder_.add_when(when); - return builder_.Finish(); -} - -/// Case statement-style expression. -struct Case FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CaseBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_CASES = 4, - VT_DEFAULT_ = 6, - VT_METADATA = 8 - }; - const flatbuffers::Vector> *cases() const { - return GetPointer> *>(VT_CASES); - } - /// The default value if no cases match. This is typically NULL in SQL - /// - /// Defaulting to NULL is a frontend choice, so producers must specify NULL - /// if that's their desired behavior. - const org::apache::arrow::computeir::flatbuf::Expression *default_() const { - return GetPointer(VT_DEFAULT_); - } - /// Parameters for `function_name`; content/format may be unique to each - /// value of `function_name`. - const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { - return GetPointer(VT_METADATA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_CASES) && - verifier.VerifyVector(cases()) && - verifier.VerifyVectorOfTables(cases()) && - VerifyOffsetRequired(verifier, VT_DEFAULT_) && - verifier.VerifyTable(default_()) && - VerifyOffset(verifier, VT_METADATA) && - verifier.VerifyTable(metadata()) && - verifier.EndTable(); - } -}; - -struct CaseBuilder { - typedef Case Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_cases(flatbuffers::Offset>> cases) { - fbb_.AddOffset(Case::VT_CASES, cases); - } - void add_default_(flatbuffers::Offset default_) { - fbb_.AddOffset(Case::VT_DEFAULT_, default_); - } - void add_metadata(flatbuffers::Offset metadata) { - fbb_.AddOffset(Case::VT_METADATA, metadata); - } - explicit CaseBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CaseBuilder &operator=(const CaseBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Case::VT_CASES); - fbb_.Required(o, Case::VT_DEFAULT_); - return o; - } -}; - -inline flatbuffers::Offset CreateCase( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> cases = 0, - flatbuffers::Offset default_ = 0, - flatbuffers::Offset metadata = 0) { - CaseBuilder builder_(_fbb); - builder_.add_metadata(metadata); - builder_.add_default_(default_); - builder_.add_cases(cases); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateCaseDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *cases = nullptr, - flatbuffers::Offset default_ = 0, - flatbuffers::Offset metadata = 0) { - auto cases__ = cases ? _fbb.CreateVector>(*cases) : 0; - return org::apache::arrow::computeir::flatbuf::CreateCase( - _fbb, - cases__, - default_, - metadata); -} - -struct Cast FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CastBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_EXPRESSION = 4, - VT_TYPE = 6, - VT_METADATA = 8 - }; - /// The expression to cast - const org::apache::arrow::computeir::flatbuf::Expression *expression() const { - return GetPointer(VT_EXPRESSION); - } - /// The type to cast `argument` to. - const org::apache::arrow::flatbuf::Field *type() const { - return GetPointer(VT_TYPE); - } - /// Parameters for `function_name`; content/format may be unique to each - /// value of `function_name`. - const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { - return GetPointer(VT_METADATA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_EXPRESSION) && - verifier.VerifyTable(expression()) && - VerifyOffsetRequired(verifier, VT_TYPE) && - verifier.VerifyTable(type()) && - VerifyOffset(verifier, VT_METADATA) && - verifier.VerifyTable(metadata()) && - verifier.EndTable(); - } -}; - -struct CastBuilder { - typedef Cast Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_expression(flatbuffers::Offset expression) { - fbb_.AddOffset(Cast::VT_EXPRESSION, expression); - } - void add_type(flatbuffers::Offset type) { - fbb_.AddOffset(Cast::VT_TYPE, type); - } - void add_metadata(flatbuffers::Offset metadata) { - fbb_.AddOffset(Cast::VT_METADATA, metadata); - } - explicit CastBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CastBuilder &operator=(const CastBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Cast::VT_EXPRESSION); - fbb_.Required(o, Cast::VT_TYPE); - return o; - } -}; - -inline flatbuffers::Offset CreateCast( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset expression = 0, - flatbuffers::Offset type = 0, - flatbuffers::Offset metadata = 0) { - CastBuilder builder_(_fbb); - builder_.add_metadata(metadata); - builder_.add_type(type); - builder_.add_expression(expression); - return builder_.Finish(); -} - -struct Extract FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ExtractBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_EXPRESSION = 4, - VT_FIELD = 6, - VT_METADATA = 8 - }; - /// Expression from which to extract components. - const org::apache::arrow::computeir::flatbuf::Expression *expression() const { - return GetPointer(VT_EXPRESSION); - } - /// Field to extract from `expression`. - const flatbuffers::String *field() const { - return GetPointer(VT_FIELD); - } - /// Parameters for `function_name`; content/format may be unique to each - /// value of `function_name`. - const org::apache::arrow::computeir::flatbuf::InlineBuffer *metadata() const { - return GetPointer(VT_METADATA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_EXPRESSION) && - verifier.VerifyTable(expression()) && - VerifyOffsetRequired(verifier, VT_FIELD) && - verifier.VerifyString(field()) && - VerifyOffset(verifier, VT_METADATA) && - verifier.VerifyTable(metadata()) && - verifier.EndTable(); - } -}; - -struct ExtractBuilder { - typedef Extract Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_expression(flatbuffers::Offset expression) { - fbb_.AddOffset(Extract::VT_EXPRESSION, expression); - } - void add_field(flatbuffers::Offset field) { - fbb_.AddOffset(Extract::VT_FIELD, field); - } - void add_metadata(flatbuffers::Offset metadata) { - fbb_.AddOffset(Extract::VT_METADATA, metadata); - } - explicit ExtractBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ExtractBuilder &operator=(const ExtractBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Extract::VT_EXPRESSION); - fbb_.Required(o, Extract::VT_FIELD); - return o; - } -}; - -inline flatbuffers::Offset CreateExtract( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset expression = 0, - flatbuffers::Offset field = 0, - flatbuffers::Offset metadata = 0) { - ExtractBuilder builder_(_fbb); - builder_.add_metadata(metadata); - builder_.add_field(field); - builder_.add_expression(expression); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateExtractDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset expression = 0, - const char *field = nullptr, - flatbuffers::Offset metadata = 0) { - auto field__ = field ? _fbb.CreateString(field) : 0; - return org::apache::arrow::computeir::flatbuf::CreateExtract( - _fbb, - expression, - field__, - metadata); -} - -/// An expression with an order -struct SortKey FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef SortKeyBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_EXPRESSION = 4, - VT_ORDERING = 6 - }; - const org::apache::arrow::computeir::flatbuf::Expression *expression() const { - return GetPointer(VT_EXPRESSION); - } - org::apache::arrow::computeir::flatbuf::Ordering ordering() const { - return static_cast(GetField(VT_ORDERING, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_EXPRESSION) && - verifier.VerifyTable(expression()) && - VerifyField(verifier, VT_ORDERING) && - verifier.EndTable(); - } -}; - -struct SortKeyBuilder { - typedef SortKey Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_expression(flatbuffers::Offset expression) { - fbb_.AddOffset(SortKey::VT_EXPRESSION, expression); - } - void add_ordering(org::apache::arrow::computeir::flatbuf::Ordering ordering) { - fbb_.AddElement(SortKey::VT_ORDERING, static_cast(ordering), 0); - } - explicit SortKeyBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - SortKeyBuilder &operator=(const SortKeyBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, SortKey::VT_EXPRESSION); - return o; - } -}; - -inline flatbuffers::Offset CreateSortKey( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset expression = 0, - org::apache::arrow::computeir::flatbuf::Ordering ordering = org::apache::arrow::computeir::flatbuf::Ordering::ASCENDING_THEN_NULLS) { - SortKeyBuilder builder_(_fbb); - builder_.add_expression(expression); - builder_.add_ordering(ordering); - return builder_.Finish(); -} - -/// Boundary is unbounded -struct Unbounded FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UnboundedBuilder Builder; - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - verifier.EndTable(); - } -}; - -struct UnboundedBuilder { - typedef Unbounded Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - explicit UnboundedBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UnboundedBuilder &operator=(const UnboundedBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateUnbounded( - flatbuffers::FlatBufferBuilder &_fbb) { - UnboundedBuilder builder_(_fbb); - return builder_.Finish(); -} - -/// Boundary is preceding rows, determined by the contained expression -struct Preceding FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef PrecedingBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IPML_TYPE = 4, - VT_IPML = 6 - }; - org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl ipml_type() const { - return static_cast(GetField(VT_IPML_TYPE, 0)); - } - const void *ipml() const { - return GetPointer(VT_IPML); - } - template const T *ipml_as() const; - const org::apache::arrow::computeir::flatbuf::Expression *ipml_as_Expression() const { - return ipml_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Expression ? static_cast(ipml()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Unbounded *ipml_as_Unbounded() const { - return ipml_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Unbounded ? static_cast(ipml()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IPML_TYPE) && - VerifyOffsetRequired(verifier, VT_IPML) && - VerifyConcreteBoundImpl(verifier, ipml(), ipml_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Expression *Preceding::ipml_as() const { - return ipml_as_Expression(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Unbounded *Preceding::ipml_as() const { - return ipml_as_Unbounded(); -} - -struct PrecedingBuilder { - typedef Preceding Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_ipml_type(org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl ipml_type) { - fbb_.AddElement(Preceding::VT_IPML_TYPE, static_cast(ipml_type), 0); - } - void add_ipml(flatbuffers::Offset ipml) { - fbb_.AddOffset(Preceding::VT_IPML, ipml); - } - explicit PrecedingBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - PrecedingBuilder &operator=(const PrecedingBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Preceding::VT_IPML); - return o; - } -}; - -inline flatbuffers::Offset CreatePreceding( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl ipml_type = org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::NONE, - flatbuffers::Offset ipml = 0) { - PrecedingBuilder builder_(_fbb); - builder_.add_ipml(ipml); - builder_.add_ipml_type(ipml_type); - return builder_.Finish(); -} - -/// Boundary is following rows, determined by the contained expression -struct Following FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FollowingBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 - }; - org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::Expression *impl_as_Expression() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Expression ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Unbounded *impl_as_Unbounded() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::Unbounded ? static_cast(impl()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyConcreteBoundImpl(verifier, impl(), impl_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Expression *Following::impl_as() const { - return impl_as_Expression(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Unbounded *Following::impl_as() const { - return impl_as_Unbounded(); -} - -struct FollowingBuilder { - typedef Following Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl impl_type) { - fbb_.AddElement(Following::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(Following::VT_IMPL, impl); - } - explicit FollowingBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FollowingBuilder &operator=(const FollowingBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Following::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateFollowing( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl impl_type = org::apache::arrow::computeir::flatbuf::ConcreteBoundImpl::NONE, - flatbuffers::Offset impl = 0) { - FollowingBuilder builder_(_fbb); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -/// Boundary is the current row -struct CurrentRow FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CurrentRowBuilder Builder; - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - verifier.EndTable(); - } -}; - -struct CurrentRowBuilder { - typedef CurrentRow Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - explicit CurrentRowBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CurrentRowBuilder &operator=(const CurrentRowBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCurrentRow( - flatbuffers::FlatBufferBuilder &_fbb) { - CurrentRowBuilder builder_(_fbb); - return builder_.Finish(); -} - -/// Boundary of a window -struct Bound FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef BoundBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 - }; - org::apache::arrow::computeir::flatbuf::BoundImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::Preceding *impl_as_Preceding() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::BoundImpl::Preceding ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Following *impl_as_Following() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::BoundImpl::Following ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::CurrentRow *impl_as_CurrentRow() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::BoundImpl::CurrentRow ? static_cast(impl()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyBoundImpl(verifier, impl(), impl_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Preceding *Bound::impl_as() const { - return impl_as_Preceding(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Following *Bound::impl_as() const { - return impl_as_Following(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::CurrentRow *Bound::impl_as() const { - return impl_as_CurrentRow(); -} - -struct BoundBuilder { - typedef Bound Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::BoundImpl impl_type) { - fbb_.AddElement(Bound::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(Bound::VT_IMPL, impl); - } - explicit BoundBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - BoundBuilder &operator=(const BoundBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Bound::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateBound( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::BoundImpl impl_type = org::apache::arrow::computeir::flatbuf::BoundImpl::NONE, - flatbuffers::Offset impl = 0) { - BoundBuilder builder_(_fbb); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -/// An expression representing a window function call. -struct WindowCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef WindowCallBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KIND = 4, - VT_EXPRESSION = 6, - VT_PARTITIONS = 8, - VT_ORDERINGS = 10, - VT_LOWER_BOUND = 12, - VT_UPPER_BOUND = 14 - }; - /// The kind of window frame - org::apache::arrow::computeir::flatbuf::Frame kind() const { - return static_cast(GetField(VT_KIND, 0)); - } - /// The expression to operate over - const org::apache::arrow::computeir::flatbuf::Expression *expression() const { - return GetPointer(VT_EXPRESSION); - } - /// Partition keys - const flatbuffers::Vector> *partitions() const { - return GetPointer> *>(VT_PARTITIONS); - } - /// Sort keys - const flatbuffers::Vector> *orderings() const { - return GetPointer> *>(VT_ORDERINGS); - } - /// Lower window bound - const org::apache::arrow::computeir::flatbuf::Bound *lower_bound() const { - return GetPointer(VT_LOWER_BOUND); - } - /// Upper window bound - const org::apache::arrow::computeir::flatbuf::Bound *upper_bound() const { - return GetPointer(VT_UPPER_BOUND); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_KIND) && - VerifyOffsetRequired(verifier, VT_EXPRESSION) && - verifier.VerifyTable(expression()) && - VerifyOffsetRequired(verifier, VT_PARTITIONS) && - verifier.VerifyVector(partitions()) && - verifier.VerifyVectorOfTables(partitions()) && - VerifyOffsetRequired(verifier, VT_ORDERINGS) && - verifier.VerifyVector(orderings()) && - verifier.VerifyVectorOfTables(orderings()) && - VerifyOffsetRequired(verifier, VT_LOWER_BOUND) && - verifier.VerifyTable(lower_bound()) && - VerifyOffsetRequired(verifier, VT_UPPER_BOUND) && - verifier.VerifyTable(upper_bound()) && - verifier.EndTable(); - } -}; - -struct WindowCallBuilder { - typedef WindowCall Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_kind(org::apache::arrow::computeir::flatbuf::Frame kind) { - fbb_.AddElement(WindowCall::VT_KIND, static_cast(kind), 0); - } - void add_expression(flatbuffers::Offset expression) { - fbb_.AddOffset(WindowCall::VT_EXPRESSION, expression); - } - void add_partitions(flatbuffers::Offset>> partitions) { - fbb_.AddOffset(WindowCall::VT_PARTITIONS, partitions); - } - void add_orderings(flatbuffers::Offset>> orderings) { - fbb_.AddOffset(WindowCall::VT_ORDERINGS, orderings); - } - void add_lower_bound(flatbuffers::Offset lower_bound) { - fbb_.AddOffset(WindowCall::VT_LOWER_BOUND, lower_bound); - } - void add_upper_bound(flatbuffers::Offset upper_bound) { - fbb_.AddOffset(WindowCall::VT_UPPER_BOUND, upper_bound); - } - explicit WindowCallBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - WindowCallBuilder &operator=(const WindowCallBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, WindowCall::VT_EXPRESSION); - fbb_.Required(o, WindowCall::VT_PARTITIONS); - fbb_.Required(o, WindowCall::VT_ORDERINGS); - fbb_.Required(o, WindowCall::VT_LOWER_BOUND); - fbb_.Required(o, WindowCall::VT_UPPER_BOUND); - return o; - } -}; - -inline flatbuffers::Offset CreateWindowCall( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::Frame kind = org::apache::arrow::computeir::flatbuf::Frame::Rows, - flatbuffers::Offset expression = 0, - flatbuffers::Offset>> partitions = 0, - flatbuffers::Offset>> orderings = 0, - flatbuffers::Offset lower_bound = 0, - flatbuffers::Offset upper_bound = 0) { - WindowCallBuilder builder_(_fbb); - builder_.add_upper_bound(upper_bound); - builder_.add_lower_bound(lower_bound); - builder_.add_orderings(orderings); - builder_.add_partitions(partitions); - builder_.add_expression(expression); - builder_.add_kind(kind); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateWindowCallDirect( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::Frame kind = org::apache::arrow::computeir::flatbuf::Frame::Rows, - flatbuffers::Offset expression = 0, - const std::vector> *partitions = nullptr, - const std::vector> *orderings = nullptr, - flatbuffers::Offset lower_bound = 0, - flatbuffers::Offset upper_bound = 0) { - auto partitions__ = partitions ? _fbb.CreateVector>(*partitions) : 0; - auto orderings__ = orderings ? _fbb.CreateVector>(*orderings) : 0; - return org::apache::arrow::computeir::flatbuf::CreateWindowCall( - _fbb, - kind, - expression, - partitions__, - orderings__, - lower_bound, - upper_bound); -} - -struct CanonicalAggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalAggregateBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 - }; - org::apache::arrow::computeir::flatbuf::CanonicalAggregateId id() const { - return static_cast(GetField(VT_ID, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && - verifier.EndTable(); - } -}; - -struct CanonicalAggregateBuilder { - typedef CanonicalAggregate Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::computeir::flatbuf::CanonicalAggregateId id) { - fbb_.AddElement(CanonicalAggregate::VT_ID, static_cast(id), 0); - } - explicit CanonicalAggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CanonicalAggregateBuilder &operator=(const CanonicalAggregateBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCanonicalAggregate( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::CanonicalAggregateId id = org::apache::arrow::computeir::flatbuf::CanonicalAggregateId::All) { - CanonicalAggregateBuilder builder_(_fbb); - builder_.add_id(id); - return builder_.Finish(); -} - -struct NonCanonicalAggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalAggregateBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 - }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); - } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct NonCanonicalAggregateBuilder { - typedef NonCanonicalAggregate Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalAggregate::VT_NAME_SPACE, name_space); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalAggregate::VT_NAME, name); - } - explicit NonCanonicalAggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NonCanonicalAggregateBuilder &operator=(const NonCanonicalAggregateBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalAggregate::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateNonCanonicalAggregate( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalAggregateBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateNonCanonicalAggregateDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalAggregate( - _fbb, - name_space__, - name__); -} - -struct AggregateCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef AggregateCallBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KIND_TYPE = 4, - VT_KIND = 6, - VT_ARGUMENTS = 8, - VT_ORDERINGS = 10, - VT_PREDICATE = 12 - }; - org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type() const { - return static_cast(GetField(VT_KIND_TYPE, 0)); - } - /// The kind of aggregate function being executed - const void *kind() const { - return GetPointer(VT_KIND); - } - template const T *kind_as() const; - const org::apache::arrow::computeir::flatbuf::CanonicalAggregate *kind_as_CanonicalAggregate() const { - return kind_type() == org::apache::arrow::computeir::flatbuf::AggregateImpl::CanonicalAggregate ? static_cast(kind()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::NonCanonicalAggregate *kind_as_NonCanonicalAggregate() const { - return kind_type() == org::apache::arrow::computeir::flatbuf::AggregateImpl::NonCanonicalAggregate ? static_cast(kind()) : nullptr; - } - /// Aggregate expression arguments - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); - } - /// Possible ordering. - const flatbuffers::Vector> *orderings() const { - return GetPointer> *>(VT_ORDERINGS); - } - /// optional per-aggregate filtering - const org::apache::arrow::computeir::flatbuf::Expression *predicate() const { - return GetPointer(VT_PREDICATE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_KIND_TYPE) && - VerifyOffsetRequired(verifier, VT_KIND) && - VerifyAggregateImpl(verifier, kind(), kind_type()) && - VerifyOffsetRequired(verifier, VT_ARGUMENTS) && - verifier.VerifyVector(arguments()) && - verifier.VerifyVectorOfTables(arguments()) && - VerifyOffset(verifier, VT_ORDERINGS) && - verifier.VerifyVector(orderings()) && - verifier.VerifyVectorOfTables(orderings()) && - VerifyOffset(verifier, VT_PREDICATE) && - verifier.VerifyTable(predicate()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalAggregate *AggregateCall::kind_as() const { - return kind_as_CanonicalAggregate(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalAggregate *AggregateCall::kind_as() const { - return kind_as_NonCanonicalAggregate(); -} - -struct AggregateCallBuilder { - typedef AggregateCall Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_kind_type(org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type) { - fbb_.AddElement(AggregateCall::VT_KIND_TYPE, static_cast(kind_type), 0); - } - void add_kind(flatbuffers::Offset kind) { - fbb_.AddOffset(AggregateCall::VT_KIND, kind); - } - void add_arguments(flatbuffers::Offset>> arguments) { - fbb_.AddOffset(AggregateCall::VT_ARGUMENTS, arguments); - } - void add_orderings(flatbuffers::Offset>> orderings) { - fbb_.AddOffset(AggregateCall::VT_ORDERINGS, orderings); - } - void add_predicate(flatbuffers::Offset predicate) { - fbb_.AddOffset(AggregateCall::VT_PREDICATE, predicate); - } - explicit AggregateCallBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - AggregateCallBuilder &operator=(const AggregateCallBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, AggregateCall::VT_KIND); - fbb_.Required(o, AggregateCall::VT_ARGUMENTS); - return o; - } -}; - -inline flatbuffers::Offset CreateAggregateCall( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type = org::apache::arrow::computeir::flatbuf::AggregateImpl::NONE, - flatbuffers::Offset kind = 0, - flatbuffers::Offset>> arguments = 0, - flatbuffers::Offset>> orderings = 0, - flatbuffers::Offset predicate = 0) { - AggregateCallBuilder builder_(_fbb); - builder_.add_predicate(predicate); - builder_.add_orderings(orderings); - builder_.add_arguments(arguments); - builder_.add_kind(kind); - builder_.add_kind_type(kind_type); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateAggregateCallDirect( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::AggregateImpl kind_type = org::apache::arrow::computeir::flatbuf::AggregateImpl::NONE, - flatbuffers::Offset kind = 0, - const std::vector> *arguments = nullptr, - const std::vector> *orderings = nullptr, - flatbuffers::Offset predicate = 0) { - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; - auto orderings__ = orderings ? _fbb.CreateVector>(*orderings) : 0; - return org::apache::arrow::computeir::flatbuf::CreateAggregateCall( - _fbb, - kind_type, - kind, - arguments__, - orderings__, - predicate); -} - -/// Expression types -/// -/// Expressions have a concrete `impl` value, which is a specific operation -/// They also have a `type` field, which is the output type of the expression, -/// regardless of operation type. -/// -/// The only exception so far is Cast, which has a type as input argument, which -/// is equal to output type. -struct Expression FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ExpressionBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6, - VT_TYPE = 8 - }; - org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::Literal *impl_as_Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::FieldRef *impl_as_FieldRef() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::FieldRef ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Call *impl_as_Call() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Call ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Case *impl_as_Case() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Case ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Cast *impl_as_Cast() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Cast ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Extract *impl_as_Extract() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::Extract ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::WindowCall *impl_as_WindowCall() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::WindowCall ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::AggregateCall *impl_as_AggregateCall() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::ExpressionImpl::AggregateCall ? static_cast(impl()) : nullptr; - } - /// The type of the expression. - /// - /// This is a field, because the Type union in Schema.fbs - /// isn't self-contained: Fields are necessary to describe complex types - /// and there's currently no reason to optimize the storage of this. - const org::apache::arrow::flatbuf::Field *type() const { - return GetPointer(VT_TYPE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyExpressionImpl(verifier, impl(), impl_type()) && - VerifyOffset(verifier, VT_TYPE) && - verifier.VerifyTable(type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Literal *Expression::impl_as() const { - return impl_as_Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::FieldRef *Expression::impl_as() const { - return impl_as_FieldRef(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Call *Expression::impl_as() const { - return impl_as_Call(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Case *Expression::impl_as() const { - return impl_as_Case(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Cast *Expression::impl_as() const { - return impl_as_Cast(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Extract *Expression::impl_as() const { - return impl_as_Extract(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::WindowCall *Expression::impl_as() const { - return impl_as_WindowCall(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::AggregateCall *Expression::impl_as() const { - return impl_as_AggregateCall(); -} - -struct ExpressionBuilder { - typedef Expression Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type) { - fbb_.AddElement(Expression::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(Expression::VT_IMPL, impl); - } - void add_type(flatbuffers::Offset type) { - fbb_.AddOffset(Expression::VT_TYPE, type); - } - explicit ExpressionBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ExpressionBuilder &operator=(const ExpressionBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Expression::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateExpression( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::ExpressionImpl impl_type = org::apache::arrow::computeir::flatbuf::ExpressionImpl::NONE, - flatbuffers::Offset impl = 0, - flatbuffers::Offset type = 0) { - ExpressionBuilder builder_(_fbb); - builder_.add_type(type); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -inline bool VerifyDeref(flatbuffers::Verifier &verifier, const void *obj, Deref type) { - switch (type) { - case Deref::NONE: { - return true; - } - case Deref::MapKey: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::StructField: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::ArraySubscript: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::ArraySlice: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Deref::FieldName: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyDerefVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyDeref( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyFunctionImpl(flatbuffers::Verifier &verifier, const void *obj, FunctionImpl type) { - switch (type) { - case FunctionImpl::NONE: { - return true; - } - case FunctionImpl::CanonicalFunction: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case FunctionImpl::NonCanonicalFunction: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyFunctionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyFunctionImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyConcreteBoundImpl(flatbuffers::Verifier &verifier, const void *obj, ConcreteBoundImpl type) { - switch (type) { - case ConcreteBoundImpl::NONE: { - return true; - } - case ConcreteBoundImpl::Expression: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ConcreteBoundImpl::Unbounded: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyConcreteBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyConcreteBoundImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyBoundImpl(flatbuffers::Verifier &verifier, const void *obj, BoundImpl type) { - switch (type) { - case BoundImpl::NONE: { - return true; - } - case BoundImpl::Preceding: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case BoundImpl::Following: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case BoundImpl::CurrentRow: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyBoundImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyBoundImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyAggregateImpl(flatbuffers::Verifier &verifier, const void *obj, AggregateImpl type) { - switch (type) { - case AggregateImpl::NONE: { - return true; - } - case AggregateImpl::CanonicalAggregate: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case AggregateImpl::NonCanonicalAggregate: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyAggregateImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyAggregateImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyExpressionImpl(flatbuffers::Verifier &verifier, const void *obj, ExpressionImpl type) { - switch (type) { - case ExpressionImpl::NONE: { - return true; - } - case ExpressionImpl::Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::FieldRef: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::Call: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::Case: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::Cast: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::Extract: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::WindowCall: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case ExpressionImpl::AggregateCall: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyExpressionImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyExpressionImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const org::apache::arrow::computeir::flatbuf::Expression *GetExpression(const void *buf) { - return flatbuffers::GetRoot(buf); -} - -inline const org::apache::arrow::computeir::flatbuf::Expression *GetSizePrefixedExpression(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyExpressionBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedExpressionBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishExpressionBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedExpressionBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_EXPRESSION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/InlineBuffer_generated.h b/cpp/src/generated/InlineBuffer_generated.h deleted file mode 100644 index d35e5518f084f..0000000000000 --- a/cpp/src/generated/InlineBuffer_generated.h +++ /dev/null @@ -1,987 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_INLINEBUFFER_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ -#define FLATBUFFERS_GENERATED_INLINEBUFFER_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ - -#include "flatbuffers/flatbuffers.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { - -struct Int8Buffer; -struct Int8BufferBuilder; - -struct Int16Buffer; -struct Int16BufferBuilder; - -struct Int32Buffer; -struct Int32BufferBuilder; - -struct Int64Buffer; -struct Int64BufferBuilder; - -struct UInt8Buffer; -struct UInt8BufferBuilder; - -struct UInt16Buffer; -struct UInt16BufferBuilder; - -struct UInt32Buffer; -struct UInt32BufferBuilder; - -struct UInt64Buffer; -struct UInt64BufferBuilder; - -struct Float32Buffer; -struct Float32BufferBuilder; - -struct Float64Buffer; -struct Float64BufferBuilder; - -struct TableBuffer; -struct TableBufferBuilder; - -struct InlineBuffer; -struct InlineBufferBuilder; - -enum class InlineBufferImpl : uint8_t { - NONE = 0, - Int8Buffer = 1, - Int16Buffer = 2, - Int32Buffer = 3, - Int64Buffer = 4, - UInt8Buffer = 5, - UInt16Buffer = 6, - UInt32Buffer = 7, - UInt64Buffer = 8, - Float32Buffer = 9, - Float64Buffer = 10, - TableBuffer = 11, - MIN = NONE, - MAX = TableBuffer -}; - -inline const InlineBufferImpl (&EnumValuesInlineBufferImpl())[12] { - static const InlineBufferImpl values[] = { - InlineBufferImpl::NONE, - InlineBufferImpl::Int8Buffer, - InlineBufferImpl::Int16Buffer, - InlineBufferImpl::Int32Buffer, - InlineBufferImpl::Int64Buffer, - InlineBufferImpl::UInt8Buffer, - InlineBufferImpl::UInt16Buffer, - InlineBufferImpl::UInt32Buffer, - InlineBufferImpl::UInt64Buffer, - InlineBufferImpl::Float32Buffer, - InlineBufferImpl::Float64Buffer, - InlineBufferImpl::TableBuffer - }; - return values; -} - -inline const char * const *EnumNamesInlineBufferImpl() { - static const char * const names[13] = { - "NONE", - "Int8Buffer", - "Int16Buffer", - "Int32Buffer", - "Int64Buffer", - "UInt8Buffer", - "UInt16Buffer", - "UInt32Buffer", - "UInt64Buffer", - "Float32Buffer", - "Float64Buffer", - "TableBuffer", - nullptr - }; - return names; -} - -inline const char *EnumNameInlineBufferImpl(InlineBufferImpl e) { - if (flatbuffers::IsOutRange(e, InlineBufferImpl::NONE, InlineBufferImpl::TableBuffer)) return ""; - const size_t index = static_cast(e); - return EnumNamesInlineBufferImpl()[index]; -} - -template struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::NONE; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int8Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int16Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int32Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Int64Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt8Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt16Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt32Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::UInt64Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Float32Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::Float64Buffer; -}; - -template<> struct InlineBufferImplTraits { - static const InlineBufferImpl enum_value = InlineBufferImpl::TableBuffer; -}; - -bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type); -bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -struct Int8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int8BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int8BufferBuilder { - typedef Int8Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int8Buffer::VT_ITEMS, items); - } - explicit Int8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int8BufferBuilder &operator=(const Int8BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int8Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt8Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int8BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt8BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt8Buffer( - _fbb, - items__); -} - -struct Int16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int16BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int16BufferBuilder { - typedef Int16Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int16Buffer::VT_ITEMS, items); - } - explicit Int16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int16BufferBuilder &operator=(const Int16BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int16Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt16Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int16BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt16BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt16Buffer( - _fbb, - items__); -} - -struct Int32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int32BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int32BufferBuilder { - typedef Int32Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int32Buffer::VT_ITEMS, items); - } - explicit Int32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int32BufferBuilder &operator=(const Int32BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int32Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt32Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int32BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt32BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt32Buffer( - _fbb, - items__); -} - -struct Int64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int64BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Int64BufferBuilder { - typedef Int64Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Int64Buffer::VT_ITEMS, items); - } - explicit Int64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int64BufferBuilder &operator=(const Int64BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Int64Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateInt64Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Int64BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateInt64BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateInt64Buffer( - _fbb, - items__); -} - -struct UInt8Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt8BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt8BufferBuilder { - typedef UInt8Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt8Buffer::VT_ITEMS, items); - } - explicit UInt8BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt8BufferBuilder &operator=(const UInt8BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt8Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt8Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt8BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt8BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt8Buffer( - _fbb, - items__); -} - -struct UInt16Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt16BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt16BufferBuilder { - typedef UInt16Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt16Buffer::VT_ITEMS, items); - } - explicit UInt16BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt16BufferBuilder &operator=(const UInt16BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt16Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt16Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt16BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt16BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt16Buffer( - _fbb, - items__); -} - -struct UInt32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt32BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt32BufferBuilder { - typedef UInt32Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt32Buffer::VT_ITEMS, items); - } - explicit UInt32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt32BufferBuilder &operator=(const UInt32BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt32Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt32Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt32BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt32BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt32Buffer( - _fbb, - items__); -} - -struct UInt64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt64BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct UInt64BufferBuilder { - typedef UInt64Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(UInt64Buffer::VT_ITEMS, items); - } - explicit UInt64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt64BufferBuilder &operator=(const UInt64BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, UInt64Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt64Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - UInt64BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateUInt64BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateUInt64Buffer( - _fbb, - items__); -} - -struct Float32Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Float32BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Float32BufferBuilder { - typedef Float32Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Float32Buffer::VT_ITEMS, items); - } - explicit Float32BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Float32BufferBuilder &operator=(const Float32BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Float32Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateFloat32Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Float32BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateFloat32BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateFloat32Buffer( - _fbb, - items__); -} - -struct Float64Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Float64BufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct Float64BufferBuilder { - typedef Float64Buffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(Float64Buffer::VT_ITEMS, items); - } - explicit Float64BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Float64BufferBuilder &operator=(const Float64BufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Float64Buffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateFloat64Buffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - Float64BufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateFloat64BufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateFloat64Buffer( - _fbb, - items__); -} - -struct TableBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef TableBufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ITEMS = 4 - }; - const flatbuffers::Vector *items() const { - return GetPointer *>(VT_ITEMS); - } - const org::apache::arrow::computeir::flatbuf::InlineBuffer *items_nested_root() const { - return flatbuffers::GetRoot(items()->Data()); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ITEMS) && - verifier.VerifyVector(items()) && - verifier.EndTable(); - } -}; - -struct TableBufferBuilder { - typedef TableBuffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_items(flatbuffers::Offset> items) { - fbb_.AddOffset(TableBuffer::VT_ITEMS, items); - } - explicit TableBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - TableBufferBuilder &operator=(const TableBufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, TableBuffer::VT_ITEMS); - return o; - } -}; - -inline flatbuffers::Offset CreateTableBuffer( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> items = 0) { - TableBufferBuilder builder_(_fbb); - builder_.add_items(items); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateTableBufferDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *items = nullptr) { - auto items__ = items ? _fbb.CreateVector(*items) : 0; - return org::apache::arrow::computeir::flatbuf::CreateTableBuffer( - _fbb, - items__); -} - -/// An inline replacement for org.apache.arrow.Buffer because that -/// requires a sidecar block of bytes into which offsets can point. -/// A union of buffers of each primitive type is provided to avoid -/// the need for reinterpret_cast, std::mem::transmute, ... -/// The final member of the union is a bytes buffer aligned suitably -/// to hold any flatbuffer Table. -struct InlineBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef InlineBufferBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 - }; - org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::Int8Buffer *impl_as_Int8Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int8Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int16Buffer *impl_as_Int16Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int16Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int32Buffer *impl_as_Int32Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int32Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int64Buffer *impl_as_Int64Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Int64Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt8Buffer *impl_as_UInt8Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt8Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt16Buffer *impl_as_UInt16Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt16Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt32Buffer *impl_as_UInt32Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt32Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt64Buffer *impl_as_UInt64Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::UInt64Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Float32Buffer *impl_as_Float32Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float32Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Float64Buffer *impl_as_Float64Buffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::Float64Buffer ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::TableBuffer *impl_as_TableBuffer() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::InlineBufferImpl::TableBuffer ? static_cast(impl()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyInlineBufferImpl(verifier, impl(), impl_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Int8Buffer *InlineBuffer::impl_as() const { - return impl_as_Int8Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int16Buffer *InlineBuffer::impl_as() const { - return impl_as_Int16Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int32Buffer *InlineBuffer::impl_as() const { - return impl_as_Int32Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int64Buffer *InlineBuffer::impl_as() const { - return impl_as_Int64Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt8Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt8Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt16Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt16Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt32Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt32Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt64Buffer *InlineBuffer::impl_as() const { - return impl_as_UInt64Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Float32Buffer *InlineBuffer::impl_as() const { - return impl_as_Float32Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Float64Buffer *InlineBuffer::impl_as() const { - return impl_as_Float64Buffer(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::TableBuffer *InlineBuffer::impl_as() const { - return impl_as_TableBuffer(); -} - -struct InlineBufferBuilder { - typedef InlineBuffer Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type) { - fbb_.AddElement(InlineBuffer::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(InlineBuffer::VT_IMPL, impl); - } - explicit InlineBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - InlineBufferBuilder &operator=(const InlineBufferBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, InlineBuffer::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateInlineBuffer( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::InlineBufferImpl impl_type = org::apache::arrow::computeir::flatbuf::InlineBufferImpl::NONE, - flatbuffers::Offset impl = 0) { - InlineBufferBuilder builder_(_fbb); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -inline bool VerifyInlineBufferImpl(flatbuffers::Verifier &verifier, const void *obj, InlineBufferImpl type) { - switch (type) { - case InlineBufferImpl::NONE: { - return true; - } - case InlineBufferImpl::Int8Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Int16Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Int32Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Int64Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt8Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt16Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt32Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::UInt64Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Float32Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::Float64Buffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case InlineBufferImpl::TableBuffer: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyInlineBufferImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyInlineBufferImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const org::apache::arrow::computeir::flatbuf::InlineBuffer *GetInlineBuffer(const void *buf) { - return flatbuffers::GetRoot(buf); -} - -inline const org::apache::arrow::computeir::flatbuf::InlineBuffer *GetSizePrefixedInlineBuffer(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyInlineBufferBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedInlineBufferBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishInlineBufferBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedInlineBufferBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_INLINEBUFFER_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/Literal_generated.h b/cpp/src/generated/Literal_generated.h deleted file mode 100644 index f5627f6361256..0000000000000 --- a/cpp/src/generated/Literal_generated.h +++ /dev/null @@ -1,1981 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_LITERAL_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ -#define FLATBUFFERS_GENERATED_LITERAL_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ - -#include "flatbuffers/flatbuffers.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { - -struct ArrayLiteral; -struct ArrayLiteralBuilder; - -struct StructLiteral; -struct StructLiteralBuilder; - -struct KeyValue; -struct KeyValueBuilder; - -struct MapLiteral; -struct MapLiteralBuilder; - -struct Int8Literal; -struct Int8LiteralBuilder; - -struct Int16Literal; -struct Int16LiteralBuilder; - -struct Int32Literal; -struct Int32LiteralBuilder; - -struct Int64Literal; -struct Int64LiteralBuilder; - -struct UInt8Literal; -struct UInt8LiteralBuilder; - -struct UInt16Literal; -struct UInt16LiteralBuilder; - -struct UInt32Literal; -struct UInt32LiteralBuilder; - -struct UInt64Literal; -struct UInt64LiteralBuilder; - -struct Float16Literal; -struct Float16LiteralBuilder; - -struct Float32Literal; -struct Float32LiteralBuilder; - -struct Float64Literal; -struct Float64LiteralBuilder; - -struct DecimalLiteral; -struct DecimalLiteralBuilder; - -struct BooleanLiteral; -struct BooleanLiteralBuilder; - -struct NullLiteral; -struct NullLiteralBuilder; - -struct DateLiteral; -struct DateLiteralBuilder; - -struct TimeLiteral; -struct TimeLiteralBuilder; - -struct TimestampLiteral; -struct TimestampLiteralBuilder; - -struct IntervalLiteralMonths; -struct IntervalLiteralMonthsBuilder; - -struct IntervalLiteralDaysMilliseconds; -struct IntervalLiteralDaysMillisecondsBuilder; - -struct IntervalLiteral; -struct IntervalLiteralBuilder; - -struct BinaryLiteral; -struct BinaryLiteralBuilder; - -struct StringLiteral; -struct StringLiteralBuilder; - -struct Literal; -struct LiteralBuilder; - -enum class IntervalLiteralImpl : uint8_t { - NONE = 0, - IntervalLiteralMonths = 1, - IntervalLiteralDaysMilliseconds = 2, - MIN = NONE, - MAX = IntervalLiteralDaysMilliseconds -}; - -inline const IntervalLiteralImpl (&EnumValuesIntervalLiteralImpl())[3] { - static const IntervalLiteralImpl values[] = { - IntervalLiteralImpl::NONE, - IntervalLiteralImpl::IntervalLiteralMonths, - IntervalLiteralImpl::IntervalLiteralDaysMilliseconds - }; - return values; -} - -inline const char * const *EnumNamesIntervalLiteralImpl() { - static const char * const names[4] = { - "NONE", - "IntervalLiteralMonths", - "IntervalLiteralDaysMilliseconds", - nullptr - }; - return names; -} - -inline const char *EnumNameIntervalLiteralImpl(IntervalLiteralImpl e) { - if (flatbuffers::IsOutRange(e, IntervalLiteralImpl::NONE, IntervalLiteralImpl::IntervalLiteralDaysMilliseconds)) return ""; - const size_t index = static_cast(e); - return EnumNamesIntervalLiteralImpl()[index]; -} - -template struct IntervalLiteralImplTraits { - static const IntervalLiteralImpl enum_value = IntervalLiteralImpl::NONE; -}; - -template<> struct IntervalLiteralImplTraits { - static const IntervalLiteralImpl enum_value = IntervalLiteralImpl::IntervalLiteralMonths; -}; - -template<> struct IntervalLiteralImplTraits { - static const IntervalLiteralImpl enum_value = IntervalLiteralImpl::IntervalLiteralDaysMilliseconds; -}; - -bool VerifyIntervalLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, IntervalLiteralImpl type); -bool VerifyIntervalLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class LiteralImpl : uint8_t { - NONE = 0, - NullLiteral = 1, - BooleanLiteral = 2, - Int8Literal = 3, - Int16Literal = 4, - Int32Literal = 5, - Int64Literal = 6, - UInt8Literal = 7, - UInt16Literal = 8, - UInt32Literal = 9, - UInt64Literal = 10, - DateLiteral = 11, - TimeLiteral = 12, - TimestampLiteral = 13, - IntervalLiteral = 14, - DecimalLiteral = 15, - Float16Literal = 16, - Float32Literal = 17, - Float64Literal = 18, - ArrayLiteral = 19, - StructLiteral = 20, - MapLiteral = 21, - StringLiteral = 22, - BinaryLiteral = 23, - MIN = NONE, - MAX = BinaryLiteral -}; - -inline const LiteralImpl (&EnumValuesLiteralImpl())[24] { - static const LiteralImpl values[] = { - LiteralImpl::NONE, - LiteralImpl::NullLiteral, - LiteralImpl::BooleanLiteral, - LiteralImpl::Int8Literal, - LiteralImpl::Int16Literal, - LiteralImpl::Int32Literal, - LiteralImpl::Int64Literal, - LiteralImpl::UInt8Literal, - LiteralImpl::UInt16Literal, - LiteralImpl::UInt32Literal, - LiteralImpl::UInt64Literal, - LiteralImpl::DateLiteral, - LiteralImpl::TimeLiteral, - LiteralImpl::TimestampLiteral, - LiteralImpl::IntervalLiteral, - LiteralImpl::DecimalLiteral, - LiteralImpl::Float16Literal, - LiteralImpl::Float32Literal, - LiteralImpl::Float64Literal, - LiteralImpl::ArrayLiteral, - LiteralImpl::StructLiteral, - LiteralImpl::MapLiteral, - LiteralImpl::StringLiteral, - LiteralImpl::BinaryLiteral - }; - return values; -} - -inline const char * const *EnumNamesLiteralImpl() { - static const char * const names[25] = { - "NONE", - "NullLiteral", - "BooleanLiteral", - "Int8Literal", - "Int16Literal", - "Int32Literal", - "Int64Literal", - "UInt8Literal", - "UInt16Literal", - "UInt32Literal", - "UInt64Literal", - "DateLiteral", - "TimeLiteral", - "TimestampLiteral", - "IntervalLiteral", - "DecimalLiteral", - "Float16Literal", - "Float32Literal", - "Float64Literal", - "ArrayLiteral", - "StructLiteral", - "MapLiteral", - "StringLiteral", - "BinaryLiteral", - nullptr - }; - return names; -} - -inline const char *EnumNameLiteralImpl(LiteralImpl e) { - if (flatbuffers::IsOutRange(e, LiteralImpl::NONE, LiteralImpl::BinaryLiteral)) return ""; - const size_t index = static_cast(e); - return EnumNamesLiteralImpl()[index]; -} - -template struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::NONE; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::NullLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::BooleanLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::Int8Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::Int16Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::Int32Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::Int64Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::UInt8Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::UInt16Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::UInt32Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::UInt64Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::DateLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::TimeLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::TimestampLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::IntervalLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::DecimalLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::Float16Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::Float32Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::Float64Literal; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::ArrayLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::StructLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::MapLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::StringLiteral; -}; - -template<> struct LiteralImplTraits { - static const LiteralImpl enum_value = LiteralImpl::BinaryLiteral; -}; - -bool VerifyLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, LiteralImpl type); -bool VerifyLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -struct ArrayLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ArrayLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUES = 4 - }; - const flatbuffers::Vector> *values() const { - return GetPointer> *>(VT_VALUES); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_VALUES) && - verifier.VerifyVector(values()) && - verifier.VerifyVectorOfTables(values()) && - verifier.EndTable(); - } -}; - -struct ArrayLiteralBuilder { - typedef ArrayLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_values(flatbuffers::Offset>> values) { - fbb_.AddOffset(ArrayLiteral::VT_VALUES, values); - } - explicit ArrayLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ArrayLiteralBuilder &operator=(const ArrayLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateArrayLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> values = 0) { - ArrayLiteralBuilder builder_(_fbb); - builder_.add_values(values); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateArrayLiteralDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *values = nullptr) { - auto values__ = values ? _fbb.CreateVector>(*values) : 0; - return org::apache::arrow::computeir::flatbuf::CreateArrayLiteral( - _fbb, - values__); -} - -struct StructLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef StructLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUES = 4 - }; - const flatbuffers::Vector> *values() const { - return GetPointer> *>(VT_VALUES); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_VALUES) && - verifier.VerifyVector(values()) && - verifier.VerifyVectorOfTables(values()) && - verifier.EndTable(); - } -}; - -struct StructLiteralBuilder { - typedef StructLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_values(flatbuffers::Offset>> values) { - fbb_.AddOffset(StructLiteral::VT_VALUES, values); - } - explicit StructLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - StructLiteralBuilder &operator=(const StructLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateStructLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> values = 0) { - StructLiteralBuilder builder_(_fbb); - builder_.add_values(values); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateStructLiteralDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *values = nullptr) { - auto values__ = values ? _fbb.CreateVector>(*values) : 0; - return org::apache::arrow::computeir::flatbuf::CreateStructLiteral( - _fbb, - values__); -} - -struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef KeyValueBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_KEY = 4, - VT_VALUE = 6 - }; - const flatbuffers::String *key() const { - return GetPointer(VT_KEY); - } - const org::apache::arrow::computeir::flatbuf::Literal *value() const { - return GetPointer(VT_VALUE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_KEY) && - verifier.VerifyString(key()) && - VerifyOffset(verifier, VT_VALUE) && - verifier.VerifyTable(value()) && - verifier.EndTable(); - } -}; - -struct KeyValueBuilder { - typedef KeyValue Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_key(flatbuffers::Offset key) { - fbb_.AddOffset(KeyValue::VT_KEY, key); - } - void add_value(flatbuffers::Offset value) { - fbb_.AddOffset(KeyValue::VT_VALUE, value); - } - explicit KeyValueBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - KeyValueBuilder &operator=(const KeyValueBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateKeyValue( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset key = 0, - flatbuffers::Offset value = 0) { - KeyValueBuilder builder_(_fbb); - builder_.add_value(value); - builder_.add_key(key); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateKeyValueDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *key = nullptr, - flatbuffers::Offset value = 0) { - auto key__ = key ? _fbb.CreateString(key) : 0; - return org::apache::arrow::computeir::flatbuf::CreateKeyValue( - _fbb, - key__, - value); -} - -struct MapLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef MapLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUES = 4 - }; - const flatbuffers::Vector> *values() const { - return GetPointer> *>(VT_VALUES); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_VALUES) && - verifier.VerifyVector(values()) && - verifier.VerifyVectorOfTables(values()) && - verifier.EndTable(); - } -}; - -struct MapLiteralBuilder { - typedef MapLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_values(flatbuffers::Offset>> values) { - fbb_.AddOffset(MapLiteral::VT_VALUES, values); - } - explicit MapLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - MapLiteralBuilder &operator=(const MapLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateMapLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> values = 0) { - MapLiteralBuilder builder_(_fbb); - builder_.add_values(values); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateMapLiteralDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *values = nullptr) { - auto values__ = values ? _fbb.CreateVector>(*values) : 0; - return org::apache::arrow::computeir::flatbuf::CreateMapLiteral( - _fbb, - values__); -} - -struct Int8Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int8LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - int8_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct Int8LiteralBuilder { - typedef Int8Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(int8_t value) { - fbb_.AddElement(Int8Literal::VT_VALUE, value, 0); - } - explicit Int8LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int8LiteralBuilder &operator=(const Int8LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateInt8Literal( - flatbuffers::FlatBufferBuilder &_fbb, - int8_t value = 0) { - Int8LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct Int16Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int16LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - int16_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct Int16LiteralBuilder { - typedef Int16Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(int16_t value) { - fbb_.AddElement(Int16Literal::VT_VALUE, value, 0); - } - explicit Int16LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int16LiteralBuilder &operator=(const Int16LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateInt16Literal( - flatbuffers::FlatBufferBuilder &_fbb, - int16_t value = 0) { - Int16LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct Int32Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int32LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - int32_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct Int32LiteralBuilder { - typedef Int32Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(int32_t value) { - fbb_.AddElement(Int32Literal::VT_VALUE, value, 0); - } - explicit Int32LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int32LiteralBuilder &operator=(const Int32LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateInt32Literal( - flatbuffers::FlatBufferBuilder &_fbb, - int32_t value = 0) { - Int32LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct Int64Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Int64LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - int64_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct Int64LiteralBuilder { - typedef Int64Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(int64_t value) { - fbb_.AddElement(Int64Literal::VT_VALUE, value, 0); - } - explicit Int64LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Int64LiteralBuilder &operator=(const Int64LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateInt64Literal( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t value = 0) { - Int64LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct UInt8Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt8LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - uint8_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct UInt8LiteralBuilder { - typedef UInt8Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(uint8_t value) { - fbb_.AddElement(UInt8Literal::VT_VALUE, value, 0); - } - explicit UInt8LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt8LiteralBuilder &operator=(const UInt8LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt8Literal( - flatbuffers::FlatBufferBuilder &_fbb, - uint8_t value = 0) { - UInt8LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct UInt16Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt16LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - uint16_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct UInt16LiteralBuilder { - typedef UInt16Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(uint16_t value) { - fbb_.AddElement(UInt16Literal::VT_VALUE, value, 0); - } - explicit UInt16LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt16LiteralBuilder &operator=(const UInt16LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt16Literal( - flatbuffers::FlatBufferBuilder &_fbb, - uint16_t value = 0) { - UInt16LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct UInt32Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt32LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - uint32_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct UInt32LiteralBuilder { - typedef UInt32Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(uint32_t value) { - fbb_.AddElement(UInt32Literal::VT_VALUE, value, 0); - } - explicit UInt32LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt32LiteralBuilder &operator=(const UInt32LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt32Literal( - flatbuffers::FlatBufferBuilder &_fbb, - uint32_t value = 0) { - UInt32LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct UInt64Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef UInt64LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - uint64_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct UInt64LiteralBuilder { - typedef UInt64Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(uint64_t value) { - fbb_.AddElement(UInt64Literal::VT_VALUE, value, 0); - } - explicit UInt64LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - UInt64LiteralBuilder &operator=(const UInt64LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateUInt64Literal( - flatbuffers::FlatBufferBuilder &_fbb, - uint64_t value = 0) { - UInt64LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct Float16Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Float16LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - uint16_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct Float16LiteralBuilder { - typedef Float16Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(uint16_t value) { - fbb_.AddElement(Float16Literal::VT_VALUE, value, 0); - } - explicit Float16LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Float16LiteralBuilder &operator=(const Float16LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateFloat16Literal( - flatbuffers::FlatBufferBuilder &_fbb, - uint16_t value = 0) { - Float16LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct Float32Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Float32LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - float value() const { - return GetField(VT_VALUE, 0.0f); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct Float32LiteralBuilder { - typedef Float32Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(float value) { - fbb_.AddElement(Float32Literal::VT_VALUE, value, 0.0f); - } - explicit Float32LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Float32LiteralBuilder &operator=(const Float32LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateFloat32Literal( - flatbuffers::FlatBufferBuilder &_fbb, - float value = 0.0f) { - Float32LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct Float64Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef Float64LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - double value() const { - return GetField(VT_VALUE, 0.0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct Float64LiteralBuilder { - typedef Float64Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(double value) { - fbb_.AddElement(Float64Literal::VT_VALUE, value, 0.0); - } - explicit Float64LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - Float64LiteralBuilder &operator=(const Float64LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateFloat64Literal( - flatbuffers::FlatBufferBuilder &_fbb, - double value = 0.0) { - Float64LiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct DecimalLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef DecimalLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4, - VT_SCALE = 6, - VT_PRECISION = 8 - }; - const flatbuffers::Vector *value() const { - return GetPointer *>(VT_VALUE); - } - uint8_t scale() const { - return GetField(VT_SCALE, 0); - } - uint8_t precision() const { - return GetField(VT_PRECISION, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_VALUE) && - verifier.VerifyVector(value()) && - VerifyField(verifier, VT_SCALE) && - VerifyField(verifier, VT_PRECISION) && - verifier.EndTable(); - } -}; - -struct DecimalLiteralBuilder { - typedef DecimalLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(flatbuffers::Offset> value) { - fbb_.AddOffset(DecimalLiteral::VT_VALUE, value); - } - void add_scale(uint8_t scale) { - fbb_.AddElement(DecimalLiteral::VT_SCALE, scale, 0); - } - void add_precision(uint8_t precision) { - fbb_.AddElement(DecimalLiteral::VT_PRECISION, precision, 0); - } - explicit DecimalLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - DecimalLiteralBuilder &operator=(const DecimalLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateDecimalLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> value = 0, - uint8_t scale = 0, - uint8_t precision = 0) { - DecimalLiteralBuilder builder_(_fbb); - builder_.add_value(value); - builder_.add_precision(precision); - builder_.add_scale(scale); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateDecimalLiteralDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *value = nullptr, - uint8_t scale = 0, - uint8_t precision = 0) { - auto value__ = value ? _fbb.CreateVector(*value) : 0; - return org::apache::arrow::computeir::flatbuf::CreateDecimalLiteral( - _fbb, - value__, - scale, - precision); -} - -struct BooleanLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef BooleanLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - bool value() const { - return GetField(VT_VALUE, 0) != 0; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct BooleanLiteralBuilder { - typedef BooleanLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(bool value) { - fbb_.AddElement(BooleanLiteral::VT_VALUE, static_cast(value), 0); - } - explicit BooleanLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - BooleanLiteralBuilder &operator=(const BooleanLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateBooleanLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - bool value = false) { - BooleanLiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct NullLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NullLiteralBuilder Builder; - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - verifier.EndTable(); - } -}; - -struct NullLiteralBuilder { - typedef NullLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - explicit NullLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NullLiteralBuilder &operator=(const NullLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateNullLiteral( - flatbuffers::FlatBufferBuilder &_fbb) { - NullLiteralBuilder builder_(_fbb); - return builder_.Finish(); -} - -struct DateLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef DateLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - int64_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct DateLiteralBuilder { - typedef DateLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(int64_t value) { - fbb_.AddElement(DateLiteral::VT_VALUE, value, 0); - } - explicit DateLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - DateLiteralBuilder &operator=(const DateLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateDateLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t value = 0) { - DateLiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct TimeLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef TimeLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - int64_t value() const { - return GetField(VT_VALUE, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - verifier.EndTable(); - } -}; - -struct TimeLiteralBuilder { - typedef TimeLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(int64_t value) { - fbb_.AddElement(TimeLiteral::VT_VALUE, value, 0); - } - explicit TimeLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - TimeLiteralBuilder &operator=(const TimeLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateTimeLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t value = 0) { - TimeLiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -struct TimestampLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef TimestampLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4, - VT_TIMEZONE = 6 - }; - int64_t value() const { - return GetField(VT_VALUE, 0); - } - const flatbuffers::String *timezone() const { - return GetPointer(VT_TIMEZONE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE) && - VerifyOffset(verifier, VT_TIMEZONE) && - verifier.VerifyString(timezone()) && - verifier.EndTable(); - } -}; - -struct TimestampLiteralBuilder { - typedef TimestampLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(int64_t value) { - fbb_.AddElement(TimestampLiteral::VT_VALUE, value, 0); - } - void add_timezone(flatbuffers::Offset timezone) { - fbb_.AddOffset(TimestampLiteral::VT_TIMEZONE, timezone); - } - explicit TimestampLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - TimestampLiteralBuilder &operator=(const TimestampLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateTimestampLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t value = 0, - flatbuffers::Offset timezone = 0) { - TimestampLiteralBuilder builder_(_fbb); - builder_.add_value(value); - builder_.add_timezone(timezone); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateTimestampLiteralDirect( - flatbuffers::FlatBufferBuilder &_fbb, - int64_t value = 0, - const char *timezone = nullptr) { - auto timezone__ = timezone ? _fbb.CreateString(timezone) : 0; - return org::apache::arrow::computeir::flatbuf::CreateTimestampLiteral( - _fbb, - value, - timezone__); -} - -struct IntervalLiteralMonths FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef IntervalLiteralMonthsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_MONTHS = 4 - }; - int32_t months() const { - return GetField(VT_MONTHS, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_MONTHS) && - verifier.EndTable(); - } -}; - -struct IntervalLiteralMonthsBuilder { - typedef IntervalLiteralMonths Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_months(int32_t months) { - fbb_.AddElement(IntervalLiteralMonths::VT_MONTHS, months, 0); - } - explicit IntervalLiteralMonthsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - IntervalLiteralMonthsBuilder &operator=(const IntervalLiteralMonthsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateIntervalLiteralMonths( - flatbuffers::FlatBufferBuilder &_fbb, - int32_t months = 0) { - IntervalLiteralMonthsBuilder builder_(_fbb); - builder_.add_months(months); - return builder_.Finish(); -} - -struct IntervalLiteralDaysMilliseconds FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef IntervalLiteralDaysMillisecondsBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_DAYS = 4, - VT_MILLISECONDS = 6 - }; - int32_t days() const { - return GetField(VT_DAYS, 0); - } - int32_t milliseconds() const { - return GetField(VT_MILLISECONDS, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_DAYS) && - VerifyField(verifier, VT_MILLISECONDS) && - verifier.EndTable(); - } -}; - -struct IntervalLiteralDaysMillisecondsBuilder { - typedef IntervalLiteralDaysMilliseconds Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_days(int32_t days) { - fbb_.AddElement(IntervalLiteralDaysMilliseconds::VT_DAYS, days, 0); - } - void add_milliseconds(int32_t milliseconds) { - fbb_.AddElement(IntervalLiteralDaysMilliseconds::VT_MILLISECONDS, milliseconds, 0); - } - explicit IntervalLiteralDaysMillisecondsBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - IntervalLiteralDaysMillisecondsBuilder &operator=(const IntervalLiteralDaysMillisecondsBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateIntervalLiteralDaysMilliseconds( - flatbuffers::FlatBufferBuilder &_fbb, - int32_t days = 0, - int32_t milliseconds = 0) { - IntervalLiteralDaysMillisecondsBuilder builder_(_fbb); - builder_.add_milliseconds(milliseconds); - builder_.add_days(days); - return builder_.Finish(); -} - -struct IntervalLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef IntervalLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE_TYPE = 4, - VT_VALUE = 6 - }; - org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl value_type() const { - return static_cast(GetField(VT_VALUE_TYPE, 0)); - } - const void *value() const { - return GetPointer(VT_VALUE); - } - template const T *value_as() const; - const org::apache::arrow::computeir::flatbuf::IntervalLiteralMonths *value_as_IntervalLiteralMonths() const { - return value_type() == org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl::IntervalLiteralMonths ? static_cast(value()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::IntervalLiteralDaysMilliseconds *value_as_IntervalLiteralDaysMilliseconds() const { - return value_type() == org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl::IntervalLiteralDaysMilliseconds ? static_cast(value()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VALUE_TYPE) && - VerifyOffset(verifier, VT_VALUE) && - VerifyIntervalLiteralImpl(verifier, value(), value_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::IntervalLiteralMonths *IntervalLiteral::value_as() const { - return value_as_IntervalLiteralMonths(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::IntervalLiteralDaysMilliseconds *IntervalLiteral::value_as() const { - return value_as_IntervalLiteralDaysMilliseconds(); -} - -struct IntervalLiteralBuilder { - typedef IntervalLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value_type(org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl value_type) { - fbb_.AddElement(IntervalLiteral::VT_VALUE_TYPE, static_cast(value_type), 0); - } - void add_value(flatbuffers::Offset value) { - fbb_.AddOffset(IntervalLiteral::VT_VALUE, value); - } - explicit IntervalLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - IntervalLiteralBuilder &operator=(const IntervalLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateIntervalLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl value_type = org::apache::arrow::computeir::flatbuf::IntervalLiteralImpl::NONE, - flatbuffers::Offset value = 0) { - IntervalLiteralBuilder builder_(_fbb); - builder_.add_value(value); - builder_.add_value_type(value_type); - return builder_.Finish(); -} - -struct BinaryLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef BinaryLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - const flatbuffers::Vector *value() const { - return GetPointer *>(VT_VALUE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_VALUE) && - verifier.VerifyVector(value()) && - verifier.EndTable(); - } -}; - -struct BinaryLiteralBuilder { - typedef BinaryLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(flatbuffers::Offset> value) { - fbb_.AddOffset(BinaryLiteral::VT_VALUE, value); - } - explicit BinaryLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - BinaryLiteralBuilder &operator=(const BinaryLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateBinaryLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> value = 0) { - BinaryLiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateBinaryLiteralDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *value = nullptr) { - auto value__ = value ? _fbb.CreateVector(*value) : 0; - return org::apache::arrow::computeir::flatbuf::CreateBinaryLiteral( - _fbb, - value__); -} - -struct StringLiteral FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef StringLiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VALUE = 4 - }; - const flatbuffers::String *value() const { - return GetPointer(VT_VALUE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_VALUE) && - verifier.VerifyString(value()) && - verifier.EndTable(); - } -}; - -struct StringLiteralBuilder { - typedef StringLiteral Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_value(flatbuffers::Offset value) { - fbb_.AddOffset(StringLiteral::VT_VALUE, value); - } - explicit StringLiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - StringLiteralBuilder &operator=(const StringLiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateStringLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset value = 0) { - StringLiteralBuilder builder_(_fbb); - builder_.add_value(value); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateStringLiteralDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *value = nullptr) { - auto value__ = value ? _fbb.CreateString(value) : 0; - return org::apache::arrow::computeir::flatbuf::CreateStringLiteral( - _fbb, - value__); -} - -struct Literal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LiteralBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 - }; - org::apache::arrow::computeir::flatbuf::LiteralImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::NullLiteral *impl_as_NullLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::NullLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::BooleanLiteral *impl_as_BooleanLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::BooleanLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int8Literal *impl_as_Int8Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int8Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int16Literal *impl_as_Int16Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int16Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int32Literal *impl_as_Int32Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int32Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Int64Literal *impl_as_Int64Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Int64Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt8Literal *impl_as_UInt8Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt8Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt16Literal *impl_as_UInt16Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt16Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt32Literal *impl_as_UInt32Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt32Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::UInt64Literal *impl_as_UInt64Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::UInt64Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::DateLiteral *impl_as_DateLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::DateLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::TimeLiteral *impl_as_TimeLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::TimeLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::TimestampLiteral *impl_as_TimestampLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::TimestampLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::IntervalLiteral *impl_as_IntervalLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::IntervalLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::DecimalLiteral *impl_as_DecimalLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::DecimalLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Float16Literal *impl_as_Float16Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Float16Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Float32Literal *impl_as_Float32Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Float32Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Float64Literal *impl_as_Float64Literal() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::Float64Literal ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::ArrayLiteral *impl_as_ArrayLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::ArrayLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::StructLiteral *impl_as_StructLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::StructLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::MapLiteral *impl_as_MapLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::MapLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::StringLiteral *impl_as_StringLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::StringLiteral ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::BinaryLiteral *impl_as_BinaryLiteral() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::LiteralImpl::BinaryLiteral ? static_cast(impl()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyLiteralImpl(verifier, impl(), impl_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::NullLiteral *Literal::impl_as() const { - return impl_as_NullLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::BooleanLiteral *Literal::impl_as() const { - return impl_as_BooleanLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int8Literal *Literal::impl_as() const { - return impl_as_Int8Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int16Literal *Literal::impl_as() const { - return impl_as_Int16Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int32Literal *Literal::impl_as() const { - return impl_as_Int32Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Int64Literal *Literal::impl_as() const { - return impl_as_Int64Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt8Literal *Literal::impl_as() const { - return impl_as_UInt8Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt16Literal *Literal::impl_as() const { - return impl_as_UInt16Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt32Literal *Literal::impl_as() const { - return impl_as_UInt32Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::UInt64Literal *Literal::impl_as() const { - return impl_as_UInt64Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::DateLiteral *Literal::impl_as() const { - return impl_as_DateLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::TimeLiteral *Literal::impl_as() const { - return impl_as_TimeLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::TimestampLiteral *Literal::impl_as() const { - return impl_as_TimestampLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::IntervalLiteral *Literal::impl_as() const { - return impl_as_IntervalLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::DecimalLiteral *Literal::impl_as() const { - return impl_as_DecimalLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Float16Literal *Literal::impl_as() const { - return impl_as_Float16Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Float32Literal *Literal::impl_as() const { - return impl_as_Float32Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Float64Literal *Literal::impl_as() const { - return impl_as_Float64Literal(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::ArrayLiteral *Literal::impl_as() const { - return impl_as_ArrayLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::StructLiteral *Literal::impl_as() const { - return impl_as_StructLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::MapLiteral *Literal::impl_as() const { - return impl_as_MapLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::StringLiteral *Literal::impl_as() const { - return impl_as_StringLiteral(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::BinaryLiteral *Literal::impl_as() const { - return impl_as_BinaryLiteral(); -} - -struct LiteralBuilder { - typedef Literal Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::LiteralImpl impl_type) { - fbb_.AddElement(Literal::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(Literal::VT_IMPL, impl); - } - explicit LiteralBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - LiteralBuilder &operator=(const LiteralBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Literal::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateLiteral( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::LiteralImpl impl_type = org::apache::arrow::computeir::flatbuf::LiteralImpl::NONE, - flatbuffers::Offset impl = 0) { - LiteralBuilder builder_(_fbb); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -inline bool VerifyIntervalLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, IntervalLiteralImpl type) { - switch (type) { - case IntervalLiteralImpl::NONE: { - return true; - } - case IntervalLiteralImpl::IntervalLiteralMonths: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case IntervalLiteralImpl::IntervalLiteralDaysMilliseconds: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyIntervalLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyIntervalLiteralImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyLiteralImpl(flatbuffers::Verifier &verifier, const void *obj, LiteralImpl type) { - switch (type) { - case LiteralImpl::NONE: { - return true; - } - case LiteralImpl::NullLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::BooleanLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::Int8Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::Int16Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::Int32Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::Int64Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::UInt8Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::UInt16Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::UInt32Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::UInt64Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::DateLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::TimeLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::TimestampLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::IntervalLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::DecimalLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::Float16Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::Float32Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::Float64Literal: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::ArrayLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::StructLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::MapLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::StringLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case LiteralImpl::BinaryLiteral: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyLiteralImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyLiteralImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const org::apache::arrow::computeir::flatbuf::Literal *GetLiteral(const void *buf) { - return flatbuffers::GetRoot(buf); -} - -inline const org::apache::arrow::computeir::flatbuf::Literal *GetSizePrefixedLiteral(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyLiteralBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedLiteralBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishLiteralBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedLiteralBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_LITERAL_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/Plan_generated.h b/cpp/src/generated/Plan_generated.h deleted file mode 100644 index fddd4830c4220..0000000000000 --- a/cpp/src/generated/Plan_generated.h +++ /dev/null @@ -1,132 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_PLAN_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ -#define FLATBUFFERS_GENERATED_PLAN_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ - -#include "flatbuffers/flatbuffers.h" - -#include "Schema_generated.h" -#include "Expression_generated.h" -#include "InlineBuffer_generated.h" -#include "Literal_generated.h" -#include "Relation_generated.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { - -struct Plan; -struct PlanBuilder; - -/// A specification of a query. -struct Plan FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef PlanBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_SINKS = 4, - VT_DERIVED_FROM = 6 - }; - /// One or more output relations. - const flatbuffers::Vector> *sinks() const { - return GetPointer> *>(VT_SINKS); - } - /// If this Plan was derived from another (for example by running - /// an optimization pass), that plan may be included here to - /// provide a backtrace of derivations. - const org::apache::arrow::computeir::flatbuf::Plan *derived_from() const { - return GetPointer(VT_DERIVED_FROM); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_SINKS) && - verifier.VerifyVector(sinks()) && - verifier.VerifyVectorOfTables(sinks()) && - VerifyOffset(verifier, VT_DERIVED_FROM) && - verifier.VerifyTable(derived_from()) && - verifier.EndTable(); - } -}; - -struct PlanBuilder { - typedef Plan Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_sinks(flatbuffers::Offset>> sinks) { - fbb_.AddOffset(Plan::VT_SINKS, sinks); - } - void add_derived_from(flatbuffers::Offset derived_from) { - fbb_.AddOffset(Plan::VT_DERIVED_FROM, derived_from); - } - explicit PlanBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - PlanBuilder &operator=(const PlanBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Plan::VT_SINKS); - return o; - } -}; - -inline flatbuffers::Offset CreatePlan( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> sinks = 0, - flatbuffers::Offset derived_from = 0) { - PlanBuilder builder_(_fbb); - builder_.add_derived_from(derived_from); - builder_.add_sinks(sinks); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreatePlanDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *sinks = nullptr, - flatbuffers::Offset derived_from = 0) { - auto sinks__ = sinks ? _fbb.CreateVector>(*sinks) : 0; - return org::apache::arrow::computeir::flatbuf::CreatePlan( - _fbb, - sinks__, - derived_from); -} - -inline const org::apache::arrow::computeir::flatbuf::Plan *GetPlan(const void *buf) { - return flatbuffers::GetRoot(buf); -} - -inline const org::apache::arrow::computeir::flatbuf::Plan *GetSizePrefixedPlan(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyPlanBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedPlanBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishPlanBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedPlanBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_PLAN_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ diff --git a/cpp/src/generated/Relation_generated.h b/cpp/src/generated/Relation_generated.h deleted file mode 100644 index bf6a878a662b2..0000000000000 --- a/cpp/src/generated/Relation_generated.h +++ /dev/null @@ -1,2049 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_RELATION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ -#define FLATBUFFERS_GENERATED_RELATION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ - -#include "flatbuffers/flatbuffers.h" - -#include "Schema_generated.h" -#include "Expression_generated.h" -#include "InlineBuffer_generated.h" -#include "Literal_generated.h" - -namespace org { -namespace apache { -namespace arrow { -namespace computeir { -namespace flatbuf { - -struct Remap; -struct RemapBuilder; - -struct PassThrough; -struct PassThroughBuilder; - -struct RelBase; -struct RelBaseBuilder; - -struct Filter; -struct FilterBuilder; - -struct Project; -struct ProjectBuilder; - -struct Aggregate; -struct AggregateBuilder; - -struct CanonicalJoinKind; -struct CanonicalJoinKindBuilder; - -struct NonCanonicalJoinKind; -struct NonCanonicalJoinKindBuilder; - -struct Join; -struct JoinBuilder; - -struct OrderBy; -struct OrderByBuilder; - -struct Limit; -struct LimitBuilder; - -struct Common; -struct CommonBuilder; - -struct CanonicalSetOpKind; -struct CanonicalSetOpKindBuilder; - -struct NonCanonicalSetOpKind; -struct NonCanonicalSetOpKindBuilder; - -struct SetOperation; -struct SetOperationBuilder; - -struct LiteralRelation; -struct LiteralRelationBuilder; - -struct Custom; -struct CustomBuilder; - -struct Read; -struct ReadBuilder; - -struct Write; -struct WriteBuilder; - -struct Relation; -struct RelationBuilder; - -/// A union for the different colum remapping variants -enum class Emit : uint8_t { - NONE = 0, - Remap = 1, - PassThrough = 2, - MIN = NONE, - MAX = PassThrough -}; - -inline const Emit (&EnumValuesEmit())[3] { - static const Emit values[] = { - Emit::NONE, - Emit::Remap, - Emit::PassThrough - }; - return values; -} - -inline const char * const *EnumNamesEmit() { - static const char * const names[4] = { - "NONE", - "Remap", - "PassThrough", - nullptr - }; - return names; -} - -inline const char *EnumNameEmit(Emit e) { - if (flatbuffers::IsOutRange(e, Emit::NONE, Emit::PassThrough)) return ""; - const size_t index = static_cast(e); - return EnumNamesEmit()[index]; -} - -template struct EmitTraits { - static const Emit enum_value = Emit::NONE; -}; - -template<> struct EmitTraits { - static const Emit enum_value = Emit::Remap; -}; - -template<> struct EmitTraits { - static const Emit enum_value = Emit::PassThrough; -}; - -bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type); -bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -enum class CanonicalJoinKindId : uint8_t { - Anti = 0, - Cross = 1, - FullOuter = 2, - Inner = 3, - LeftOuter = 4, - LeftSemi = 5, - RightOuter = 6, - MIN = Anti, - MAX = RightOuter -}; - -inline const CanonicalJoinKindId (&EnumValuesCanonicalJoinKindId())[7] { - static const CanonicalJoinKindId values[] = { - CanonicalJoinKindId::Anti, - CanonicalJoinKindId::Cross, - CanonicalJoinKindId::FullOuter, - CanonicalJoinKindId::Inner, - CanonicalJoinKindId::LeftOuter, - CanonicalJoinKindId::LeftSemi, - CanonicalJoinKindId::RightOuter - }; - return values; -} - -inline const char * const *EnumNamesCanonicalJoinKindId() { - static const char * const names[8] = { - "Anti", - "Cross", - "FullOuter", - "Inner", - "LeftOuter", - "LeftSemi", - "RightOuter", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalJoinKindId(CanonicalJoinKindId e) { - if (flatbuffers::IsOutRange(e, CanonicalJoinKindId::Anti, CanonicalJoinKindId::RightOuter)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalJoinKindId()[index]; -} - -enum class JoinKind : uint8_t { - NONE = 0, - CanonicalJoinKind = 1, - NonCanonicalJoinKind = 2, - MIN = NONE, - MAX = NonCanonicalJoinKind -}; - -inline const JoinKind (&EnumValuesJoinKind())[3] { - static const JoinKind values[] = { - JoinKind::NONE, - JoinKind::CanonicalJoinKind, - JoinKind::NonCanonicalJoinKind - }; - return values; -} - -inline const char * const *EnumNamesJoinKind() { - static const char * const names[4] = { - "NONE", - "CanonicalJoinKind", - "NonCanonicalJoinKind", - nullptr - }; - return names; -} - -inline const char *EnumNameJoinKind(JoinKind e) { - if (flatbuffers::IsOutRange(e, JoinKind::NONE, JoinKind::NonCanonicalJoinKind)) return ""; - const size_t index = static_cast(e); - return EnumNamesJoinKind()[index]; -} - -template struct JoinKindTraits { - static const JoinKind enum_value = JoinKind::NONE; -}; - -template<> struct JoinKindTraits { - static const JoinKind enum_value = JoinKind::CanonicalJoinKind; -}; - -template<> struct JoinKindTraits { - static const JoinKind enum_value = JoinKind::NonCanonicalJoinKind; -}; - -bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type); -bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// The kind of set operation being performed. -enum class CanonicalSetOpKindId : uint8_t { - Union = 0, - Intersection = 1, - Difference = 2, - MIN = Union, - MAX = Difference -}; - -inline const CanonicalSetOpKindId (&EnumValuesCanonicalSetOpKindId())[3] { - static const CanonicalSetOpKindId values[] = { - CanonicalSetOpKindId::Union, - CanonicalSetOpKindId::Intersection, - CanonicalSetOpKindId::Difference - }; - return values; -} - -inline const char * const *EnumNamesCanonicalSetOpKindId() { - static const char * const names[4] = { - "Union", - "Intersection", - "Difference", - nullptr - }; - return names; -} - -inline const char *EnumNameCanonicalSetOpKindId(CanonicalSetOpKindId e) { - if (flatbuffers::IsOutRange(e, CanonicalSetOpKindId::Union, CanonicalSetOpKindId::Difference)) return ""; - const size_t index = static_cast(e); - return EnumNamesCanonicalSetOpKindId()[index]; -} - -/// The kind of set operation -enum class SetOpKind : uint8_t { - NONE = 0, - CanonicalSetOpKind = 1, - NonCanonicalSetOpKind = 2, - MIN = NONE, - MAX = NonCanonicalSetOpKind -}; - -inline const SetOpKind (&EnumValuesSetOpKind())[3] { - static const SetOpKind values[] = { - SetOpKind::NONE, - SetOpKind::CanonicalSetOpKind, - SetOpKind::NonCanonicalSetOpKind - }; - return values; -} - -inline const char * const *EnumNamesSetOpKind() { - static const char * const names[4] = { - "NONE", - "CanonicalSetOpKind", - "NonCanonicalSetOpKind", - nullptr - }; - return names; -} - -inline const char *EnumNameSetOpKind(SetOpKind e) { - if (flatbuffers::IsOutRange(e, SetOpKind::NONE, SetOpKind::NonCanonicalSetOpKind)) return ""; - const size_t index = static_cast(e); - return EnumNamesSetOpKind()[index]; -} - -template struct SetOpKindTraits { - static const SetOpKind enum_value = SetOpKind::NONE; -}; - -template<> struct SetOpKindTraits { - static const SetOpKind enum_value = SetOpKind::CanonicalSetOpKind; -}; - -template<> struct SetOpKindTraits { - static const SetOpKind enum_value = SetOpKind::NonCanonicalSetOpKind; -}; - -bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type); -bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// The varieties of relations -enum class RelationImpl : uint8_t { - NONE = 0, - Aggregate = 1, - Common = 2, - Custom = 3, - SetOperation = 4, - Filter = 5, - Limit = 6, - LiteralRelation = 7, - OrderBy = 8, - Project = 9, - Read = 10, - Write = 11, - MIN = NONE, - MAX = Write -}; - -inline const RelationImpl (&EnumValuesRelationImpl())[12] { - static const RelationImpl values[] = { - RelationImpl::NONE, - RelationImpl::Aggregate, - RelationImpl::Common, - RelationImpl::Custom, - RelationImpl::SetOperation, - RelationImpl::Filter, - RelationImpl::Limit, - RelationImpl::LiteralRelation, - RelationImpl::OrderBy, - RelationImpl::Project, - RelationImpl::Read, - RelationImpl::Write - }; - return values; -} - -inline const char * const *EnumNamesRelationImpl() { - static const char * const names[13] = { - "NONE", - "Aggregate", - "Common", - "Custom", - "SetOperation", - "Filter", - "Limit", - "LiteralRelation", - "OrderBy", - "Project", - "Read", - "Write", - nullptr - }; - return names; -} - -inline const char *EnumNameRelationImpl(RelationImpl e) { - if (flatbuffers::IsOutRange(e, RelationImpl::NONE, RelationImpl::Write)) return ""; - const size_t index = static_cast(e); - return EnumNamesRelationImpl()[index]; -} - -template struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::NONE; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Aggregate; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Common; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Custom; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::SetOperation; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Filter; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Limit; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::LiteralRelation; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::OrderBy; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Project; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Read; -}; - -template<> struct RelationImplTraits { - static const RelationImpl enum_value = RelationImpl::Write; -}; - -bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type); -bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types); - -/// A data type indicating a different mapping of columns -/// should occur in the output. -/// -/// For example: -/// -/// Given a query `SELECT a, b FROM t` where `t` has columns a, b, c -/// the mapping value for the projection would equal [0, 1]. -struct Remap FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef RemapBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_MAPPING = 4 - }; - const flatbuffers::Vector *mapping() const { - return GetPointer *>(VT_MAPPING); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_MAPPING) && - verifier.VerifyVector(mapping()) && - verifier.EndTable(); - } -}; - -struct RemapBuilder { - typedef Remap Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_mapping(flatbuffers::Offset> mapping) { - fbb_.AddOffset(Remap::VT_MAPPING, mapping); - } - explicit RemapBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - RemapBuilder &operator=(const RemapBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Remap::VT_MAPPING); - return o; - } -}; - -inline flatbuffers::Offset CreateRemap( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> mapping = 0) { - RemapBuilder builder_(_fbb); - builder_.add_mapping(mapping); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateRemapDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector *mapping = nullptr) { - auto mapping__ = mapping ? _fbb.CreateVector(*mapping) : 0; - return org::apache::arrow::computeir::flatbuf::CreateRemap( - _fbb, - mapping__); -} - -struct PassThrough FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef PassThroughBuilder Builder; - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - verifier.EndTable(); - } -}; - -struct PassThroughBuilder { - typedef PassThrough Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - explicit PassThroughBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - PassThroughBuilder &operator=(const PassThroughBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreatePassThrough( - flatbuffers::FlatBufferBuilder &_fbb) { - PassThroughBuilder builder_(_fbb); - return builder_.Finish(); -} - -/// Fields common to every relational operator -struct RelBase FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef RelBaseBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ARGUMENTS = 4, - VT_OUTPUT_MAPPING_TYPE = 6, - VT_OUTPUT_MAPPING = 8, - VT_OPTIONS = 10 - }; - /// The arguments passed to `operation`. - const flatbuffers::Vector> *arguments() const { - return GetPointer> *>(VT_ARGUMENTS); - } - org::apache::arrow::computeir::flatbuf::Emit output_mapping_type() const { - return static_cast(GetField(VT_OUTPUT_MAPPING_TYPE, 0)); - } - /// Output remapping of ordinals for a given operation - const void *output_mapping() const { - return GetPointer(VT_OUTPUT_MAPPING); - } - template const T *output_mapping_as() const; - const org::apache::arrow::computeir::flatbuf::Remap *output_mapping_as_Remap() const { - return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::Remap ? static_cast(output_mapping()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::PassThrough *output_mapping_as_PassThrough() const { - return output_mapping_type() == org::apache::arrow::computeir::flatbuf::Emit::PassThrough ? static_cast(output_mapping()) : nullptr; - } - /// Arguments for custom operations - const org::apache::arrow::computeir::flatbuf::InlineBuffer *options() const { - return GetPointer(VT_OPTIONS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_ARGUMENTS) && - verifier.VerifyVector(arguments()) && - verifier.VerifyVectorOfTables(arguments()) && - VerifyField(verifier, VT_OUTPUT_MAPPING_TYPE) && - VerifyOffsetRequired(verifier, VT_OUTPUT_MAPPING) && - VerifyEmit(verifier, output_mapping(), output_mapping_type()) && - VerifyOffset(verifier, VT_OPTIONS) && - verifier.VerifyTable(options()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Remap *RelBase::output_mapping_as() const { - return output_mapping_as_Remap(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::PassThrough *RelBase::output_mapping_as() const { - return output_mapping_as_PassThrough(); -} - -struct RelBaseBuilder { - typedef RelBase Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_arguments(flatbuffers::Offset>> arguments) { - fbb_.AddOffset(RelBase::VT_ARGUMENTS, arguments); - } - void add_output_mapping_type(org::apache::arrow::computeir::flatbuf::Emit output_mapping_type) { - fbb_.AddElement(RelBase::VT_OUTPUT_MAPPING_TYPE, static_cast(output_mapping_type), 0); - } - void add_output_mapping(flatbuffers::Offset output_mapping) { - fbb_.AddOffset(RelBase::VT_OUTPUT_MAPPING, output_mapping); - } - void add_options(flatbuffers::Offset options) { - fbb_.AddOffset(RelBase::VT_OPTIONS, options); - } - explicit RelBaseBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - RelBaseBuilder &operator=(const RelBaseBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, RelBase::VT_ARGUMENTS); - fbb_.Required(o, RelBase::VT_OUTPUT_MAPPING); - return o; - } -}; - -inline flatbuffers::Offset CreateRelBase( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset>> arguments = 0, - org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, - flatbuffers::Offset output_mapping = 0, - flatbuffers::Offset options = 0) { - RelBaseBuilder builder_(_fbb); - builder_.add_options(options); - builder_.add_output_mapping(output_mapping); - builder_.add_arguments(arguments); - builder_.add_output_mapping_type(output_mapping_type); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateRelBaseDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const std::vector> *arguments = nullptr, - org::apache::arrow::computeir::flatbuf::Emit output_mapping_type = org::apache::arrow::computeir::flatbuf::Emit::NONE, - flatbuffers::Offset output_mapping = 0, - flatbuffers::Offset options = 0) { - auto arguments__ = arguments ? _fbb.CreateVector>(*arguments) : 0; - return org::apache::arrow::computeir::flatbuf::CreateRelBase( - _fbb, - arguments__, - output_mapping_type, - output_mapping, - options); -} - -/// Filter operation -struct Filter FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef FilterBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_PREDICATE = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// The expression which will be evaluated against input rows - /// to determine whether they should be excluded from the - /// filter relation's output. - const org::apache::arrow::computeir::flatbuf::Expression *predicate() const { - return GetPointer(VT_PREDICATE); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_PREDICATE) && - verifier.VerifyTable(predicate()) && - verifier.EndTable(); - } -}; - -struct FilterBuilder { - typedef Filter Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Filter::VT_BASE, base); - } - void add_predicate(flatbuffers::Offset predicate) { - fbb_.AddOffset(Filter::VT_PREDICATE, predicate); - } - explicit FilterBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FilterBuilder &operator=(const FilterBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Filter::VT_BASE); - fbb_.Required(o, Filter::VT_PREDICATE); - return o; - } -}; - -inline flatbuffers::Offset CreateFilter( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset predicate = 0) { - FilterBuilder builder_(_fbb); - builder_.add_predicate(predicate); - builder_.add_base(base); - return builder_.Finish(); -} - -/// Projection -struct Project FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ProjectBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_EXPRESSIONS = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Expressions which will be evaluated to produce to - /// the rows of the project relation's output. - const flatbuffers::Vector> *expressions() const { - return GetPointer> *>(VT_EXPRESSIONS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_EXPRESSIONS) && - verifier.VerifyVector(expressions()) && - verifier.VerifyVectorOfTables(expressions()) && - verifier.EndTable(); - } -}; - -struct ProjectBuilder { - typedef Project Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Project::VT_BASE, base); - } - void add_expressions(flatbuffers::Offset>> expressions) { - fbb_.AddOffset(Project::VT_EXPRESSIONS, expressions); - } - explicit ProjectBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ProjectBuilder &operator=(const ProjectBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Project::VT_BASE); - fbb_.Required(o, Project::VT_EXPRESSIONS); - return o; - } -}; - -inline flatbuffers::Offset CreateProject( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> expressions = 0) { - ProjectBuilder builder_(_fbb); - builder_.add_expressions(expressions); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateProjectDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *expressions = nullptr) { - auto expressions__ = expressions ? _fbb.CreateVector>(*expressions) : 0; - return org::apache::arrow::computeir::flatbuf::CreateProject( - _fbb, - base, - expressions__); -} - -/// Aggregate operation -struct Aggregate FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef AggregateBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_AGGREGATIONS = 6, - VT_KEYS = 8 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Expressions which will be evaluated to produce to - /// the rows of the aggregate relation's output. - const flatbuffers::Vector> *aggregations() const { - return GetPointer> *>(VT_AGGREGATIONS); - } - /// Keys by which `aggregations` will be grouped. - const flatbuffers::Vector> *keys() const { - return GetPointer> *>(VT_KEYS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_AGGREGATIONS) && - verifier.VerifyVector(aggregations()) && - verifier.VerifyVectorOfTables(aggregations()) && - VerifyOffsetRequired(verifier, VT_KEYS) && - verifier.VerifyVector(keys()) && - verifier.VerifyVectorOfTables(keys()) && - verifier.EndTable(); - } -}; - -struct AggregateBuilder { - typedef Aggregate Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Aggregate::VT_BASE, base); - } - void add_aggregations(flatbuffers::Offset>> aggregations) { - fbb_.AddOffset(Aggregate::VT_AGGREGATIONS, aggregations); - } - void add_keys(flatbuffers::Offset>> keys) { - fbb_.AddOffset(Aggregate::VT_KEYS, keys); - } - explicit AggregateBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - AggregateBuilder &operator=(const AggregateBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Aggregate::VT_BASE); - fbb_.Required(o, Aggregate::VT_AGGREGATIONS); - fbb_.Required(o, Aggregate::VT_KEYS); - return o; - } -}; - -inline flatbuffers::Offset CreateAggregate( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> aggregations = 0, - flatbuffers::Offset>> keys = 0) { - AggregateBuilder builder_(_fbb); - builder_.add_keys(keys); - builder_.add_aggregations(aggregations); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateAggregateDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *aggregations = nullptr, - const std::vector> *keys = nullptr) { - auto aggregations__ = aggregations ? _fbb.CreateVector>(*aggregations) : 0; - auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; - return org::apache::arrow::computeir::flatbuf::CreateAggregate( - _fbb, - base, - aggregations__, - keys__); -} - -struct CanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalJoinKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 - }; - org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id() const { - return static_cast(GetField(VT_ID, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && - verifier.EndTable(); - } -}; - -struct CanonicalJoinKindBuilder { - typedef CanonicalJoinKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id) { - fbb_.AddElement(CanonicalJoinKind::VT_ID, static_cast(id), 0); - } - explicit CanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CanonicalJoinKindBuilder &operator=(const CanonicalJoinKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCanonicalJoinKind( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId id = org::apache::arrow::computeir::flatbuf::CanonicalJoinKindId::Anti) { - CanonicalJoinKindBuilder builder_(_fbb); - builder_.add_id(id); - return builder_.Finish(); -} - -struct NonCanonicalJoinKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalJoinKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 - }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); - } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct NonCanonicalJoinKindBuilder { - typedef NonCanonicalJoinKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME_SPACE, name_space); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalJoinKind::VT_NAME, name); - } - explicit NonCanonicalJoinKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NonCanonicalJoinKindBuilder &operator=(const NonCanonicalJoinKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalJoinKind::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateNonCanonicalJoinKind( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalJoinKindBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateNonCanonicalJoinKindDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalJoinKind( - _fbb, - name_space__, - name__); -} - -/// The contents of Relation.options will be JoinOptions -/// if Relation.operation = CanonicalOperation::Join -struct Join FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef JoinBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_ON_EXPRESSION = 6, - VT_JOIN_KIND_TYPE = 8, - VT_JOIN_KIND = 10 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// The expression which will be evaluated against rows from each - /// input to determine whether they should be included in the - /// join relation's output. - const org::apache::arrow::computeir::flatbuf::Expression *on_expression() const { - return GetPointer(VT_ON_EXPRESSION); - } - org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type() const { - return static_cast(GetField(VT_JOIN_KIND_TYPE, 0)); - } - /// The kind of join to use. - const void *join_kind() const { - return GetPointer(VT_JOIN_KIND); - } - template const T *join_kind_as() const; - const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *join_kind_as_CanonicalJoinKind() const { - return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::CanonicalJoinKind ? static_cast(join_kind()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *join_kind_as_NonCanonicalJoinKind() const { - return join_kind_type() == org::apache::arrow::computeir::flatbuf::JoinKind::NonCanonicalJoinKind ? static_cast(join_kind()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_ON_EXPRESSION) && - verifier.VerifyTable(on_expression()) && - VerifyField(verifier, VT_JOIN_KIND_TYPE) && - VerifyOffsetRequired(verifier, VT_JOIN_KIND) && - VerifyJoinKind(verifier, join_kind(), join_kind_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalJoinKind *Join::join_kind_as() const { - return join_kind_as_CanonicalJoinKind(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalJoinKind *Join::join_kind_as() const { - return join_kind_as_NonCanonicalJoinKind(); -} - -struct JoinBuilder { - typedef Join Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Join::VT_BASE, base); - } - void add_on_expression(flatbuffers::Offset on_expression) { - fbb_.AddOffset(Join::VT_ON_EXPRESSION, on_expression); - } - void add_join_kind_type(org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type) { - fbb_.AddElement(Join::VT_JOIN_KIND_TYPE, static_cast(join_kind_type), 0); - } - void add_join_kind(flatbuffers::Offset join_kind) { - fbb_.AddOffset(Join::VT_JOIN_KIND, join_kind); - } - explicit JoinBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - JoinBuilder &operator=(const JoinBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Join::VT_BASE); - fbb_.Required(o, Join::VT_ON_EXPRESSION); - fbb_.Required(o, Join::VT_JOIN_KIND); - return o; - } -}; - -inline flatbuffers::Offset CreateJoin( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset on_expression = 0, - org::apache::arrow::computeir::flatbuf::JoinKind join_kind_type = org::apache::arrow::computeir::flatbuf::JoinKind::NONE, - flatbuffers::Offset join_kind = 0) { - JoinBuilder builder_(_fbb); - builder_.add_join_kind(join_kind); - builder_.add_on_expression(on_expression); - builder_.add_base(base); - builder_.add_join_kind_type(join_kind_type); - return builder_.Finish(); -} - -/// Order by relation -struct OrderBy FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef OrderByBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_KEYS = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Define sort order for rows of output. - /// Keys with higher precedence are ordered ahead of other keys. - const flatbuffers::Vector> *keys() const { - return GetPointer> *>(VT_KEYS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_KEYS) && - verifier.VerifyVector(keys()) && - verifier.VerifyVectorOfTables(keys()) && - verifier.EndTable(); - } -}; - -struct OrderByBuilder { - typedef OrderBy Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(OrderBy::VT_BASE, base); - } - void add_keys(flatbuffers::Offset>> keys) { - fbb_.AddOffset(OrderBy::VT_KEYS, keys); - } - explicit OrderByBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - OrderByBuilder &operator=(const OrderByBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, OrderBy::VT_BASE); - fbb_.Required(o, OrderBy::VT_KEYS); - return o; - } -}; - -inline flatbuffers::Offset CreateOrderBy( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> keys = 0) { - OrderByBuilder builder_(_fbb); - builder_.add_keys(keys); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateOrderByDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *keys = nullptr) { - auto keys__ = keys ? _fbb.CreateVector>(*keys) : 0; - return org::apache::arrow::computeir::flatbuf::CreateOrderBy( - _fbb, - base, - keys__); -} - -/// Limit operation -struct Limit FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LimitBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_COUNT = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// The maximum number of rows of output. - int64_t count() const { - return GetField(VT_COUNT, 0); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyField(verifier, VT_COUNT) && - verifier.EndTable(); - } -}; - -struct LimitBuilder { - typedef Limit Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Limit::VT_BASE, base); - } - void add_count(int64_t count) { - fbb_.AddElement(Limit::VT_COUNT, count, 0); - } - explicit LimitBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - LimitBuilder &operator=(const LimitBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Limit::VT_BASE); - return o; - } -}; - -inline flatbuffers::Offset CreateLimit( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - int64_t count = 0) { - LimitBuilder builder_(_fbb); - builder_.add_count(count); - builder_.add_base(base); - return builder_.Finish(); -} - -/// Common table expresssion -struct Common FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CommonBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_NAME = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// Commons (CTEs in SQL) allow assigning a name to a stream - /// of data and reusing it, potentially multiple times and - /// potentially recursively. - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct CommonBuilder { - typedef Common Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Common::VT_BASE, base); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(Common::VT_NAME, name); - } - explicit CommonBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CommonBuilder &operator=(const CommonBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Common::VT_BASE); - fbb_.Required(o, Common::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateCommon( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset name = 0) { - CommonBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateCommonDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const char *name = nullptr) { - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateCommon( - _fbb, - base, - name__); -} - -struct CanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CanonicalSetOpKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_ID = 4 - }; - org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id() const { - return static_cast(GetField(VT_ID, 0)); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_ID) && - verifier.EndTable(); - } -}; - -struct CanonicalSetOpKindBuilder { - typedef CanonicalSetOpKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_id(org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id) { - fbb_.AddElement(CanonicalSetOpKind::VT_ID, static_cast(id), 0); - } - explicit CanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CanonicalSetOpKindBuilder &operator=(const CanonicalSetOpKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - return o; - } -}; - -inline flatbuffers::Offset CreateCanonicalSetOpKind( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId id = org::apache::arrow::computeir::flatbuf::CanonicalSetOpKindId::Union) { - CanonicalSetOpKindBuilder builder_(_fbb); - builder_.add_id(id); - return builder_.Finish(); -} - -struct NonCanonicalSetOpKind FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef NonCanonicalSetOpKindBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_NAME_SPACE = 4, - VT_NAME = 6 - }; - const flatbuffers::String *name_space() const { - return GetPointer(VT_NAME_SPACE); - } - const flatbuffers::String *name() const { - return GetPointer(VT_NAME); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffset(verifier, VT_NAME_SPACE) && - verifier.VerifyString(name_space()) && - VerifyOffsetRequired(verifier, VT_NAME) && - verifier.VerifyString(name()) && - verifier.EndTable(); - } -}; - -struct NonCanonicalSetOpKindBuilder { - typedef NonCanonicalSetOpKind Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_name_space(flatbuffers::Offset name_space) { - fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME_SPACE, name_space); - } - void add_name(flatbuffers::Offset name) { - fbb_.AddOffset(NonCanonicalSetOpKind::VT_NAME, name); - } - explicit NonCanonicalSetOpKindBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - NonCanonicalSetOpKindBuilder &operator=(const NonCanonicalSetOpKindBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, NonCanonicalSetOpKind::VT_NAME); - return o; - } -}; - -inline flatbuffers::Offset CreateNonCanonicalSetOpKind( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset name_space = 0, - flatbuffers::Offset name = 0) { - NonCanonicalSetOpKindBuilder builder_(_fbb); - builder_.add_name(name); - builder_.add_name_space(name_space); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateNonCanonicalSetOpKindDirect( - flatbuffers::FlatBufferBuilder &_fbb, - const char *name_space = nullptr, - const char *name = nullptr) { - auto name_space__ = name_space ? _fbb.CreateString(name_space) : 0; - auto name__ = name ? _fbb.CreateString(name) : 0; - return org::apache::arrow::computeir::flatbuf::CreateNonCanonicalSetOpKind( - _fbb, - name_space__, - name__); -} - -/// A set operation on two or more relations -struct SetOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef SetOperationBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_SET_OP_TYPE = 6, - VT_SET_OP = 8 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type() const { - return static_cast(GetField(VT_SET_OP_TYPE, 0)); - } - /// The kind of set operation - const void *set_op() const { - return GetPointer(VT_SET_OP); - } - template const T *set_op_as() const; - const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *set_op_as_CanonicalSetOpKind() const { - return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::CanonicalSetOpKind ? static_cast(set_op()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *set_op_as_NonCanonicalSetOpKind() const { - return set_op_type() == org::apache::arrow::computeir::flatbuf::SetOpKind::NonCanonicalSetOpKind ? static_cast(set_op()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyField(verifier, VT_SET_OP_TYPE) && - VerifyOffsetRequired(verifier, VT_SET_OP) && - VerifySetOpKind(verifier, set_op(), set_op_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::CanonicalSetOpKind *SetOperation::set_op_as() const { - return set_op_as_CanonicalSetOpKind(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::NonCanonicalSetOpKind *SetOperation::set_op_as() const { - return set_op_as_NonCanonicalSetOpKind(); -} - -struct SetOperationBuilder { - typedef SetOperation Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(SetOperation::VT_BASE, base); - } - void add_set_op_type(org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type) { - fbb_.AddElement(SetOperation::VT_SET_OP_TYPE, static_cast(set_op_type), 0); - } - void add_set_op(flatbuffers::Offset set_op) { - fbb_.AddOffset(SetOperation::VT_SET_OP, set_op); - } - explicit SetOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - SetOperationBuilder &operator=(const SetOperationBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, SetOperation::VT_BASE); - fbb_.Required(o, SetOperation::VT_SET_OP); - return o; - } -}; - -inline flatbuffers::Offset CreateSetOperation( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - org::apache::arrow::computeir::flatbuf::SetOpKind set_op_type = org::apache::arrow::computeir::flatbuf::SetOpKind::NONE, - flatbuffers::Offset set_op = 0) { - SetOperationBuilder builder_(_fbb); - builder_.add_set_op(set_op); - builder_.add_base(base); - builder_.add_set_op_type(set_op_type); - return builder_.Finish(); -} - -/// Literal relation -struct LiteralRelation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef LiteralRelationBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_COLUMNS = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// The columns of this literal relation. - const flatbuffers::Vector> *columns() const { - return GetPointer> *>(VT_COLUMNS); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_COLUMNS) && - verifier.VerifyVector(columns()) && - verifier.VerifyVectorOfTables(columns()) && - verifier.EndTable(); - } -}; - -struct LiteralRelationBuilder { - typedef LiteralRelation Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(LiteralRelation::VT_BASE, base); - } - void add_columns(flatbuffers::Offset>> columns) { - fbb_.AddOffset(LiteralRelation::VT_COLUMNS, columns); - } - explicit LiteralRelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - LiteralRelationBuilder &operator=(const LiteralRelationBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, LiteralRelation::VT_BASE); - fbb_.Required(o, LiteralRelation::VT_COLUMNS); - return o; - } -}; - -inline flatbuffers::Offset CreateLiteralRelation( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset>> columns = 0) { - LiteralRelationBuilder builder_(_fbb); - builder_.add_columns(columns); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateLiteralRelationDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const std::vector> *columns = nullptr) { - auto columns__ = columns ? _fbb.CreateVector>(*columns) : 0; - return org::apache::arrow::computeir::flatbuf::CreateLiteralRelation( - _fbb, - base, - columns__); -} - -/// A user-defined relation. -struct Custom FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef CustomBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_SCHEMA = 6 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - /// NB: the schema is optional here, since a custom relation - /// may or may not need it. - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffset(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - verifier.EndTable(); - } -}; - -struct CustomBuilder { - typedef Custom Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Custom::VT_BASE, base); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Custom::VT_SCHEMA, schema); - } - explicit CustomBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - CustomBuilder &operator=(const CustomBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Custom::VT_BASE); - return o; - } -}; - -inline flatbuffers::Offset CreateCustom( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset schema = 0) { - CustomBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_base(base); - return builder_.Finish(); -} - -/// A table read -struct Read FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef ReadBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_RESOURCE = 6, - VT_SCHEMA = 8 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - const flatbuffers::String *resource() const { - return GetPointer(VT_RESOURCE); - } - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_RESOURCE) && - verifier.VerifyString(resource()) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - verifier.EndTable(); - } -}; - -struct ReadBuilder { - typedef Read Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Read::VT_BASE, base); - } - void add_resource(flatbuffers::Offset resource) { - fbb_.AddOffset(Read::VT_RESOURCE, resource); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Read::VT_SCHEMA, schema); - } - explicit ReadBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - ReadBuilder &operator=(const ReadBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Read::VT_BASE); - fbb_.Required(o, Read::VT_RESOURCE); - fbb_.Required(o, Read::VT_SCHEMA); - return o; - } -}; - -inline flatbuffers::Offset CreateRead( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset resource = 0, - flatbuffers::Offset schema = 0) { - ReadBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_resource(resource); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateReadDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const char *resource = nullptr, - flatbuffers::Offset schema = 0) { - auto resource__ = resource ? _fbb.CreateString(resource) : 0; - return org::apache::arrow::computeir::flatbuf::CreateRead( - _fbb, - base, - resource__, - schema); -} - -/// A table write -struct Write FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef WriteBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_BASE = 4, - VT_RESOURCE = 6, - VT_SCHEMA = 8 - }; - const org::apache::arrow::computeir::flatbuf::RelBase *base() const { - return GetPointer(VT_BASE); - } - const flatbuffers::String *resource() const { - return GetPointer(VT_RESOURCE); - } - const org::apache::arrow::flatbuf::Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyOffsetRequired(verifier, VT_BASE) && - verifier.VerifyTable(base()) && - VerifyOffsetRequired(verifier, VT_RESOURCE) && - verifier.VerifyString(resource()) && - VerifyOffsetRequired(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - verifier.EndTable(); - } -}; - -struct WriteBuilder { - typedef Write Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_base(flatbuffers::Offset base) { - fbb_.AddOffset(Write::VT_BASE, base); - } - void add_resource(flatbuffers::Offset resource) { - fbb_.AddOffset(Write::VT_RESOURCE, resource); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Write::VT_SCHEMA, schema); - } - explicit WriteBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - WriteBuilder &operator=(const WriteBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Write::VT_BASE); - fbb_.Required(o, Write::VT_RESOURCE); - fbb_.Required(o, Write::VT_SCHEMA); - return o; - } -}; - -inline flatbuffers::Offset CreateWrite( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - flatbuffers::Offset resource = 0, - flatbuffers::Offset schema = 0) { - WriteBuilder builder_(_fbb); - builder_.add_schema(schema); - builder_.add_resource(resource); - builder_.add_base(base); - return builder_.Finish(); -} - -inline flatbuffers::Offset CreateWriteDirect( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset base = 0, - const char *resource = nullptr, - flatbuffers::Offset schema = 0) { - auto resource__ = resource ? _fbb.CreateString(resource) : 0; - return org::apache::arrow::computeir::flatbuf::CreateWrite( - _fbb, - base, - resource__, - schema); -} - -/// A table holding an instance of the possible relation types. -struct Relation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - typedef RelationBuilder Builder; - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_IMPL_TYPE = 4, - VT_IMPL = 6 - }; - org::apache::arrow::computeir::flatbuf::RelationImpl impl_type() const { - return static_cast(GetField(VT_IMPL_TYPE, 0)); - } - const void *impl() const { - return GetPointer(VT_IMPL); - } - template const T *impl_as() const; - const org::apache::arrow::computeir::flatbuf::Aggregate *impl_as_Aggregate() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Aggregate ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Common *impl_as_Common() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Common ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Custom *impl_as_Custom() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Custom ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::SetOperation *impl_as_SetOperation() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::SetOperation ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Filter *impl_as_Filter() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Filter ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Limit *impl_as_Limit() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Limit ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::LiteralRelation *impl_as_LiteralRelation() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::LiteralRelation ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::OrderBy *impl_as_OrderBy() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::OrderBy ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Project *impl_as_Project() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Project ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Read *impl_as_Read() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Read ? static_cast(impl()) : nullptr; - } - const org::apache::arrow::computeir::flatbuf::Write *impl_as_Write() const { - return impl_type() == org::apache::arrow::computeir::flatbuf::RelationImpl::Write ? static_cast(impl()) : nullptr; - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_IMPL_TYPE) && - VerifyOffsetRequired(verifier, VT_IMPL) && - VerifyRelationImpl(verifier, impl(), impl_type()) && - verifier.EndTable(); - } -}; - -template<> inline const org::apache::arrow::computeir::flatbuf::Aggregate *Relation::impl_as() const { - return impl_as_Aggregate(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Common *Relation::impl_as() const { - return impl_as_Common(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Custom *Relation::impl_as() const { - return impl_as_Custom(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::SetOperation *Relation::impl_as() const { - return impl_as_SetOperation(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Filter *Relation::impl_as() const { - return impl_as_Filter(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Limit *Relation::impl_as() const { - return impl_as_Limit(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::LiteralRelation *Relation::impl_as() const { - return impl_as_LiteralRelation(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::OrderBy *Relation::impl_as() const { - return impl_as_OrderBy(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Project *Relation::impl_as() const { - return impl_as_Project(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Read *Relation::impl_as() const { - return impl_as_Read(); -} - -template<> inline const org::apache::arrow::computeir::flatbuf::Write *Relation::impl_as() const { - return impl_as_Write(); -} - -struct RelationBuilder { - typedef Relation Table; - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_impl_type(org::apache::arrow::computeir::flatbuf::RelationImpl impl_type) { - fbb_.AddElement(Relation::VT_IMPL_TYPE, static_cast(impl_type), 0); - } - void add_impl(flatbuffers::Offset impl) { - fbb_.AddOffset(Relation::VT_IMPL, impl); - } - explicit RelationBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - RelationBuilder &operator=(const RelationBuilder &); - flatbuffers::Offset Finish() { - const auto end = fbb_.EndTable(start_); - auto o = flatbuffers::Offset(end); - fbb_.Required(o, Relation::VT_IMPL); - return o; - } -}; - -inline flatbuffers::Offset CreateRelation( - flatbuffers::FlatBufferBuilder &_fbb, - org::apache::arrow::computeir::flatbuf::RelationImpl impl_type = org::apache::arrow::computeir::flatbuf::RelationImpl::NONE, - flatbuffers::Offset impl = 0) { - RelationBuilder builder_(_fbb); - builder_.add_impl(impl); - builder_.add_impl_type(impl_type); - return builder_.Finish(); -} - -inline bool VerifyEmit(flatbuffers::Verifier &verifier, const void *obj, Emit type) { - switch (type) { - case Emit::NONE: { - return true; - } - case Emit::Remap: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case Emit::PassThrough: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyEmitVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyEmit( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyJoinKind(flatbuffers::Verifier &verifier, const void *obj, JoinKind type) { - switch (type) { - case JoinKind::NONE: { - return true; - } - case JoinKind::CanonicalJoinKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case JoinKind::NonCanonicalJoinKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyJoinKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyJoinKind( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifySetOpKind(flatbuffers::Verifier &verifier, const void *obj, SetOpKind type) { - switch (type) { - case SetOpKind::NONE: { - return true; - } - case SetOpKind::CanonicalSetOpKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case SetOpKind::NonCanonicalSetOpKind: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifySetOpKindVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifySetOpKind( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline bool VerifyRelationImpl(flatbuffers::Verifier &verifier, const void *obj, RelationImpl type) { - switch (type) { - case RelationImpl::NONE: { - return true; - } - case RelationImpl::Aggregate: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Common: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Custom: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::SetOperation: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Filter: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Limit: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::LiteralRelation: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::OrderBy: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Project: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Read: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - case RelationImpl::Write: { - auto ptr = reinterpret_cast(obj); - return verifier.VerifyTable(ptr); - } - default: return true; - } -} - -inline bool VerifyRelationImplVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector> *values, const flatbuffers::Vector *types) { - if (!values || !types) return !values && !types; - if (values->size() != types->size()) return false; - for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { - if (!VerifyRelationImpl( - verifier, values->Get(i), types->GetEnum(i))) { - return false; - } - } - return true; -} - -inline const org::apache::arrow::computeir::flatbuf::Relation *GetRelation(const void *buf) { - return flatbuffers::GetRoot(buf); -} - -inline const org::apache::arrow::computeir::flatbuf::Relation *GetSizePrefixedRelation(const void *buf) { - return flatbuffers::GetSizePrefixedRoot(buf); -} - -inline bool VerifyRelationBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifyBuffer(nullptr); -} - -inline bool VerifySizePrefixedRelationBuffer( - flatbuffers::Verifier &verifier) { - return verifier.VerifySizePrefixedBuffer(nullptr); -} - -inline void FinishRelationBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.Finish(root); -} - -inline void FinishSizePrefixedRelationBuffer( - flatbuffers::FlatBufferBuilder &fbb, - flatbuffers::Offset root) { - fbb.FinishSizePrefixed(root); -} - -} // namespace flatbuf -} // namespace computeir -} // namespace arrow -} // namespace apache -} // namespace org - -#endif // FLATBUFFERS_GENERATED_RELATION_ORG_APACHE_ARROW_COMPUTEIR_FLATBUF_H_ From 6f973bdd457edf0382d307f7aec32aa52fa3e075 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Aug 2021 17:48:13 -0400 Subject: [PATCH 37/96] Revert generated C++ for now --- cpp/src/generated/Message_generated.h | 2 +- cpp/src/generated/Schema_generated.h | 52 ++++++------------ cpp/src/generated/SparseTensor_generated.h | 62 ++++++++++------------ 3 files changed, 43 insertions(+), 73 deletions(-) diff --git a/cpp/src/generated/Message_generated.h b/cpp/src/generated/Message_generated.h index b08dcfd210c6b..261da03d1254b 100644 --- a/cpp/src/generated/Message_generated.h +++ b/cpp/src/generated/Message_generated.h @@ -175,7 +175,7 @@ bool VerifyMessageHeaderVector(flatbuffers::Verifier &verifier, const flatbuffer /// Metadata about a field at some level of a nested type tree (but not /// its children). /// -/// For example, a List with values `[[1, 2, 3], null, [4], [5, 6], null]` +/// For example, a List with values [[1, 2, 3], null, [4], [5, 6], null] /// would have {length: 5, null_count: 2} for its List node, and {length: 6, /// null_count: 0} for its Int16 node, as separate FieldNode structs FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) FieldNode FLATBUFFERS_FINAL_CLASS { diff --git a/cpp/src/generated/Schema_generated.h b/cpp/src/generated/Schema_generated.h index 1768b688e6aa6..830c9b1f4abc9 100644 --- a/cpp/src/generated/Schema_generated.h +++ b/cpp/src/generated/Schema_generated.h @@ -784,11 +784,10 @@ inline flatbuffers::Offset CreateFixedSizeList( /// not enforced. /// /// Map -/// ```text /// - child[0] entries: Struct /// - child[0] key: K /// - child[1] value: V -/// ``` +/// /// Neither the "entries" field nor the "key" field may be nullable. /// /// The metadata is structured so that Arrow systems without special handling @@ -838,7 +837,7 @@ inline flatbuffers::Offset CreateMap( /// A union is a complex type with children in Field /// By default ids in the type vector refer to the offsets in the children /// optionally typeIds provides an indirection between the child offset and the type id -/// for each child `typeIds[offset]` is the id used in the type vector +/// for each child typeIds[offset] is the id used in the type vector struct Union FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_MODE = 4, @@ -1179,8 +1178,8 @@ inline flatbuffers::Offset CreateBool( } /// Exact decimal value represented as an integer value in two's -/// complement. Currently only 128-bit (16-byte) and 256-bit (32-byte) integers -/// are used. The representation uses the endianness indicated +/// 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. struct Decimal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { @@ -1196,8 +1195,10 @@ struct Decimal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { int32_t scale() const { return GetField(VT_SCALE, 0); } - /// Number of bits per value. The only accepted widths are 128 and 256. - /// We use bitWidth for consistency with Int::bitWidth. + /// 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. int32_t bitWidth() const { return GetField(VT_BITWIDTH, 128); } @@ -1349,33 +1350,8 @@ inline flatbuffers::Offset