This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new d353826b30 GH-38053: [C++][Go] Re-generate sources from Schema.fbs 
(#38054)
d353826b30 is described below

commit d353826b30ce5a500c90d7a9fcc6c7c454c33a19
Author: Felipe Oliveira Carvalho <[email protected]>
AuthorDate: Mon Oct 9 11:19:34 2023 -0300

    GH-38053: [C++][Go] Re-generate sources from Schema.fbs (#38054)
    
    ### Rationale for this change
    
    Re-generate Go and C++ sources from Flatbuffers specs now including 
string-view and list-view types.
    
    ### What changes are included in this PR?
    
    Documentation fixes on the .fbs files and the generated C++ and Go source 
files.
    
    ### Are these changes tested?
    
    The files should be correct by construction. Existing tests guarantee that 
no mistake was made in re-generating the files.
    * Closes: #38053
    
    Authored-by: Felipe Oliveira Carvalho <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 cpp/src/generated/File_generated.h         |  10 +-
 cpp/src/generated/Message_generated.h      |  45 ++++-
 cpp/src/generated/Schema_generated.h       | 264 ++++++++++++++++++++++++++++-
 cpp/src/generated/SparseTensor_generated.h |  32 ++++
 cpp/src/generated/Tensor_generated.h       |  30 ++++
 cpp/src/generated/feather_generated.h      |   7 +
 format/Message.fbs                         |   4 +-
 format/Schema.fbs                          |   2 +-
 go/arrow/internal/flatbuf/BinaryView.go    |  57 +++++++
 go/arrow/internal/flatbuf/LargeListView.go |  52 ++++++
 go/arrow/internal/flatbuf/ListView.go      |  53 ++++++
 go/arrow/internal/flatbuf/RecordBatch.go   |  62 ++++++-
 go/arrow/internal/flatbuf/Type.go          |  12 ++
 go/arrow/internal/flatbuf/Utf8View.go      |  57 +++++++
 14 files changed, 662 insertions(+), 25 deletions(-)

diff --git a/cpp/src/generated/File_generated.h 
b/cpp/src/generated/File_generated.h
index 5b219f1eb0..06953c4a04 100644
--- a/cpp/src/generated/File_generated.h
+++ b/cpp/src/generated/File_generated.h
@@ -26,18 +26,15 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Block 
FLATBUFFERS_FINAL_CLASS {
   int64_t bodyLength_;
 
  public:
-  Block()
-      : offset_(0),
-        metaDataLength_(0),
-        padding0__(0),
-        bodyLength_(0) {
-    (void)padding0__;
+  Block() {
+    memset(static_cast<void *>(this), 0, sizeof(Block));
   }
   Block(int64_t _offset, int32_t _metaDataLength, int64_t _bodyLength)
       : offset_(flatbuffers::EndianScalar(_offset)),
         metaDataLength_(flatbuffers::EndianScalar(_metaDataLength)),
         padding0__(0),
         bodyLength_(flatbuffers::EndianScalar(_bodyLength)) {
+    (void)padding0__;
   }
   /// Index to the start of the RecordBlock (note this is past the Message 
header)
   int64_t offset() const {
@@ -122,6 +119,7 @@ struct FooterBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  FooterBuilder &operator=(const FooterBuilder &);
   flatbuffers::Offset<Footer> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Footer>(end);
diff --git a/cpp/src/generated/Message_generated.h 
b/cpp/src/generated/Message_generated.h
index d0c71e0429..55c6f33769 100644
--- a/cpp/src/generated/Message_generated.h
+++ b/cpp/src/generated/Message_generated.h
@@ -188,9 +188,8 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) FieldNode 
FLATBUFFERS_FINAL_CLASS {
   int64_t null_count_;
 
  public:
-  FieldNode()
-      : length_(0),
-        null_count_(0) {
+  FieldNode() {
+    memset(static_cast<void *>(this), 0, sizeof(FieldNode));
   }
   FieldNode(int64_t _length, int64_t _null_count)
       : length_(flatbuffers::EndianScalar(_length)),
@@ -250,6 +249,7 @@ struct BodyCompressionBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  BodyCompressionBuilder &operator=(const BodyCompressionBuilder &);
   flatbuffers::Offset<BodyCompression> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<BodyCompression>(end);
@@ -276,7 +276,8 @@ struct RecordBatch FLATBUFFERS_FINAL_CLASS : private 
flatbuffers::Table {
     VT_LENGTH = 4,
     VT_NODES = 6,
     VT_BUFFERS = 8,
-    VT_COMPRESSION = 10
+    VT_COMPRESSION = 10,
+    VT_VARIADICBUFFERCOUNTS = 12
   };
   /// number of records / rows. The arrays in the batch should all have this
   /// length
@@ -300,6 +301,23 @@ struct RecordBatch FLATBUFFERS_FINAL_CLASS : private 
flatbuffers::Table {
   const org::apache::arrow::flatbuf::BodyCompression *compression() const {
     return GetPointer<const org::apache::arrow::flatbuf::BodyCompression 
*>(VT_COMPRESSION);
   }
+  /// Some types such as Utf8View are represented using a variable number of 
buffers.
+  /// For each such Field in the pre-ordered flattened logical schema, there 
will be
+  /// an entry in variadicBufferCounts to indicate the number of number of 
variadic
+  /// buffers which belong to that Field in the current RecordBatch.
+  ///
+  /// For example, the schema
+  ///     col1: Struct<alpha: Int32, beta: BinaryView, gamma: Float64>
+  ///     col2: Utf8View
+  /// contains two Fields with variadic buffers so variadicBufferCounts will 
have
+  /// two entries, the first counting the variadic buffers of `col1.beta` and 
the
+  /// second counting `col2`'s.
+  ///
+  /// This field may be omitted if and only if the schema contains no Fields 
with
+  /// a variable number of buffers, such as BinaryView and Utf8View.
+  const flatbuffers::Vector<int64_t> *variadicBufferCounts() const {
+    return GetPointer<const flatbuffers::Vector<int64_t> 
*>(VT_VARIADICBUFFERCOUNTS);
+  }
   bool Verify(flatbuffers::Verifier &verifier) const {
     return VerifyTableStart(verifier) &&
            VerifyField<int64_t>(verifier, VT_LENGTH) &&
@@ -309,6 +327,8 @@ struct RecordBatch FLATBUFFERS_FINAL_CLASS : private 
flatbuffers::Table {
            verifier.VerifyVector(buffers()) &&
            VerifyOffset(verifier, VT_COMPRESSION) &&
            verifier.VerifyTable(compression()) &&
+           VerifyOffset(verifier, VT_VARIADICBUFFERCOUNTS) &&
+           verifier.VerifyVector(variadicBufferCounts()) &&
            verifier.EndTable();
   }
 };
@@ -329,10 +349,14 @@ struct RecordBatchBuilder {
   void 
add_compression(flatbuffers::Offset<org::apache::arrow::flatbuf::BodyCompression>
 compression) {
     fbb_.AddOffset(RecordBatch::VT_COMPRESSION, compression);
   }
+  void 
add_variadicBufferCounts(flatbuffers::Offset<flatbuffers::Vector<int64_t>> 
variadicBufferCounts) {
+    fbb_.AddOffset(RecordBatch::VT_VARIADICBUFFERCOUNTS, variadicBufferCounts);
+  }
   explicit RecordBatchBuilder(flatbuffers::FlatBufferBuilder &_fbb)
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  RecordBatchBuilder &operator=(const RecordBatchBuilder &);
   flatbuffers::Offset<RecordBatch> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<RecordBatch>(end);
@@ -345,9 +369,11 @@ inline flatbuffers::Offset<RecordBatch> CreateRecordBatch(
     int64_t length = 0,
     flatbuffers::Offset<flatbuffers::Vector<const 
org::apache::arrow::flatbuf::FieldNode *>> nodes = 0,
     flatbuffers::Offset<flatbuffers::Vector<const 
org::apache::arrow::flatbuf::Buffer *>> buffers = 0,
-    flatbuffers::Offset<org::apache::arrow::flatbuf::BodyCompression> 
compression = 0) {
+    flatbuffers::Offset<org::apache::arrow::flatbuf::BodyCompression> 
compression = 0,
+    flatbuffers::Offset<flatbuffers::Vector<int64_t>> variadicBufferCounts = 
0) {
   RecordBatchBuilder builder_(_fbb);
   builder_.add_length(length);
+  builder_.add_variadicBufferCounts(variadicBufferCounts);
   builder_.add_compression(compression);
   builder_.add_buffers(buffers);
   builder_.add_nodes(nodes);
@@ -359,15 +385,18 @@ inline flatbuffers::Offset<RecordBatch> 
CreateRecordBatchDirect(
     int64_t length = 0,
     const std::vector<org::apache::arrow::flatbuf::FieldNode> *nodes = nullptr,
     const std::vector<org::apache::arrow::flatbuf::Buffer> *buffers = nullptr,
-    flatbuffers::Offset<org::apache::arrow::flatbuf::BodyCompression> 
compression = 0) {
+    flatbuffers::Offset<org::apache::arrow::flatbuf::BodyCompression> 
compression = 0,
+    const std::vector<int64_t> *variadicBufferCounts = nullptr) {
   auto nodes__ = nodes ? 
_fbb.CreateVectorOfStructs<org::apache::arrow::flatbuf::FieldNode>(*nodes) : 0;
   auto buffers__ = buffers ? 
_fbb.CreateVectorOfStructs<org::apache::arrow::flatbuf::Buffer>(*buffers) : 0;
+  auto variadicBufferCounts__ = variadicBufferCounts ? 
_fbb.CreateVector<int64_t>(*variadicBufferCounts) : 0;
   return org::apache::arrow::flatbuf::CreateRecordBatch(
       _fbb,
       length,
       nodes__,
       buffers__,
-      compression);
+      compression,
+      variadicBufferCounts__);
 }
 
 /// For sending dictionary encoding information. Any Field can be
@@ -422,6 +451,7 @@ struct DictionaryBatchBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  DictionaryBatchBuilder &operator=(const DictionaryBatchBuilder &);
   flatbuffers::Offset<DictionaryBatch> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<DictionaryBatch>(end);
@@ -538,6 +568,7 @@ struct MessageBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  MessageBuilder &operator=(const MessageBuilder &);
   flatbuffers::Offset<Message> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Message>(end);
diff --git a/cpp/src/generated/Schema_generated.h 
b/cpp/src/generated/Schema_generated.h
index 89204c894a..a8165f0a89 100644
--- a/cpp/src/generated/Schema_generated.h
+++ b/cpp/src/generated/Schema_generated.h
@@ -23,6 +23,12 @@ struct ListBuilder;
 struct LargeList;
 struct LargeListBuilder;
 
+struct ListView;
+struct ListViewBuilder;
+
+struct LargeListView;
+struct LargeListViewBuilder;
+
 struct FixedSizeList;
 struct FixedSizeListBuilder;
 
@@ -50,6 +56,12 @@ struct LargeUtf8Builder;
 struct LargeBinary;
 struct LargeBinaryBuilder;
 
+struct Utf8View;
+struct Utf8ViewBuilder;
+
+struct BinaryView;
+struct BinaryViewBuilder;
+
 struct FixedSizeBinary;
 struct FixedSizeBinaryBuilder;
 
@@ -386,11 +398,15 @@ enum class Type : uint8_t {
   LargeUtf8 = 20,
   LargeList = 21,
   RunEndEncoded = 22,
+  BinaryView = 23,
+  Utf8View = 24,
+  ListView = 25,
+  LargeListView = 26,
   MIN = NONE,
-  MAX = RunEndEncoded
+  MAX = LargeListView
 };
 
-inline const Type (&EnumValuesType())[23] {
+inline const Type (&EnumValuesType())[27] {
   static const Type values[] = {
     Type::NONE,
     Type::Null,
@@ -414,13 +430,17 @@ inline const Type (&EnumValuesType())[23] {
     Type::LargeBinary,
     Type::LargeUtf8,
     Type::LargeList,
-    Type::RunEndEncoded
+    Type::RunEndEncoded,
+    Type::BinaryView,
+    Type::Utf8View,
+    Type::ListView,
+    Type::LargeListView
   };
   return values;
 }
 
 inline const char * const *EnumNamesType() {
-  static const char * const names[24] = {
+  static const char * const names[28] = {
     "NONE",
     "Null",
     "Int",
@@ -444,13 +464,17 @@ inline const char * const *EnumNamesType() {
     "LargeUtf8",
     "LargeList",
     "RunEndEncoded",
+    "BinaryView",
+    "Utf8View",
+    "ListView",
+    "LargeListView",
     nullptr
   };
   return names;
 }
 
 inline const char *EnumNameType(Type e) {
-  if (flatbuffers::IsOutRange(e, Type::NONE, Type::RunEndEncoded)) return "";
+  if (flatbuffers::IsOutRange(e, Type::NONE, Type::LargeListView)) return "";
   const size_t index = static_cast<size_t>(e);
   return EnumNamesType()[index];
 }
@@ -547,6 +571,22 @@ template<> struct 
TypeTraits<org::apache::arrow::flatbuf::RunEndEncoded> {
   static const Type enum_value = Type::RunEndEncoded;
 };
 
+template<> struct TypeTraits<org::apache::arrow::flatbuf::BinaryView> {
+  static const Type enum_value = Type::BinaryView;
+};
+
+template<> struct TypeTraits<org::apache::arrow::flatbuf::Utf8View> {
+  static const Type enum_value = Type::Utf8View;
+};
+
+template<> struct TypeTraits<org::apache::arrow::flatbuf::ListView> {
+  static const Type enum_value = Type::ListView;
+};
+
+template<> struct TypeTraits<org::apache::arrow::flatbuf::LargeListView> {
+  static const Type enum_value = Type::LargeListView;
+};
+
 bool VerifyType(flatbuffers::Verifier &verifier, const void *obj, Type type);
 bool VerifyTypeVector(flatbuffers::Verifier &verifier, const 
flatbuffers::Vector<flatbuffers::Offset<void>> *values, const 
flatbuffers::Vector<uint8_t> *types);
 
@@ -622,9 +662,8 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Buffer 
FLATBUFFERS_FINAL_CLASS {
   int64_t length_;
 
  public:
-  Buffer()
-      : offset_(0),
-        length_(0) {
+  Buffer() {
+    memset(static_cast<void *>(this), 0, sizeof(Buffer));
   }
   Buffer(int64_t _offset, int64_t _length)
       : offset_(flatbuffers::EndianScalar(_offset)),
@@ -663,6 +702,7 @@ struct NullBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  NullBuilder &operator=(const NullBuilder &);
   flatbuffers::Offset<Null> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Null>(end);
@@ -695,6 +735,7 @@ struct Struct_Builder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  Struct_Builder &operator=(const Struct_Builder &);
   flatbuffers::Offset<Struct_> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Struct_>(end);
@@ -724,6 +765,7 @@ struct ListBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  ListBuilder &operator=(const ListBuilder &);
   flatbuffers::Offset<List> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<List>(end);
@@ -755,6 +797,7 @@ struct LargeListBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  LargeListBuilder &operator=(const LargeListBuilder &);
   flatbuffers::Offset<LargeList> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<LargeList>(end);
@@ -768,6 +811,71 @@ inline flatbuffers::Offset<LargeList> CreateLargeList(
   return builder_.Finish();
 }
 
+/// Represents the same logical types that List can, but contains offsets and
+/// sizes allowing for writes in any order and sharing of child values among
+/// list values.
+struct ListView FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
+  typedef ListViewBuilder Builder;
+  bool Verify(flatbuffers::Verifier &verifier) const {
+    return VerifyTableStart(verifier) &&
+           verifier.EndTable();
+  }
+};
+
+struct ListViewBuilder {
+  typedef ListView Table;
+  flatbuffers::FlatBufferBuilder &fbb_;
+  flatbuffers::uoffset_t start_;
+  explicit ListViewBuilder(flatbuffers::FlatBufferBuilder &_fbb)
+        : fbb_(_fbb) {
+    start_ = fbb_.StartTable();
+  }
+  ListViewBuilder &operator=(const ListViewBuilder &);
+  flatbuffers::Offset<ListView> Finish() {
+    const auto end = fbb_.EndTable(start_);
+    auto o = flatbuffers::Offset<ListView>(end);
+    return o;
+  }
+};
+
+inline flatbuffers::Offset<ListView> CreateListView(
+    flatbuffers::FlatBufferBuilder &_fbb) {
+  ListViewBuilder builder_(_fbb);
+  return builder_.Finish();
+}
+
+/// Same as ListView, but with 64-bit offsets and sizes, allowing to represent
+/// extremely large data values.
+struct LargeListView FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
+  typedef LargeListViewBuilder Builder;
+  bool Verify(flatbuffers::Verifier &verifier) const {
+    return VerifyTableStart(verifier) &&
+           verifier.EndTable();
+  }
+};
+
+struct LargeListViewBuilder {
+  typedef LargeListView Table;
+  flatbuffers::FlatBufferBuilder &fbb_;
+  flatbuffers::uoffset_t start_;
+  explicit LargeListViewBuilder(flatbuffers::FlatBufferBuilder &_fbb)
+        : fbb_(_fbb) {
+    start_ = fbb_.StartTable();
+  }
+  LargeListViewBuilder &operator=(const LargeListViewBuilder &);
+  flatbuffers::Offset<LargeListView> Finish() {
+    const auto end = fbb_.EndTable(start_);
+    auto o = flatbuffers::Offset<LargeListView>(end);
+    return o;
+  }
+};
+
+inline flatbuffers::Offset<LargeListView> CreateLargeListView(
+    flatbuffers::FlatBufferBuilder &_fbb) {
+  LargeListViewBuilder builder_(_fbb);
+  return builder_.Finish();
+}
+
 struct FixedSizeList FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
   typedef FixedSizeListBuilder Builder;
   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
@@ -795,6 +903,7 @@ struct FixedSizeListBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  FixedSizeListBuilder &operator=(const FixedSizeListBuilder &);
   flatbuffers::Offset<FixedSizeList> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<FixedSizeList>(end);
@@ -862,6 +971,7 @@ struct MapBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  MapBuilder &operator=(const MapBuilder &);
   flatbuffers::Offset<Map> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Map>(end);
@@ -916,6 +1026,7 @@ struct UnionBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  UnionBuilder &operator=(const UnionBuilder &);
   flatbuffers::Offset<Union> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Union>(end);
@@ -978,6 +1089,7 @@ struct IntBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  IntBuilder &operator=(const IntBuilder &);
   flatbuffers::Offset<Int> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Int>(end);
@@ -1021,6 +1133,7 @@ struct FloatingPointBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  FloatingPointBuilder &operator=(const FloatingPointBuilder &);
   flatbuffers::Offset<FloatingPoint> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<FloatingPoint>(end);
@@ -1053,6 +1166,7 @@ struct Utf8Builder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  Utf8Builder &operator=(const Utf8Builder &);
   flatbuffers::Offset<Utf8> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Utf8>(end);
@@ -1083,6 +1197,7 @@ struct BinaryBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  BinaryBuilder &operator=(const BinaryBuilder &);
   flatbuffers::Offset<Binary> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Binary>(end);
@@ -1114,6 +1229,7 @@ struct LargeUtf8Builder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  LargeUtf8Builder &operator=(const LargeUtf8Builder &);
   flatbuffers::Offset<LargeUtf8> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<LargeUtf8>(end);
@@ -1145,6 +1261,7 @@ struct LargeBinaryBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  LargeBinaryBuilder &operator=(const LargeBinaryBuilder &);
   flatbuffers::Offset<LargeBinary> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<LargeBinary>(end);
@@ -1158,6 +1275,80 @@ inline flatbuffers::Offset<LargeBinary> 
CreateLargeBinary(
   return builder_.Finish();
 }
 
+/// Logically the same as Utf8, but the internal representation uses a view
+/// struct that contains the string length and either the string's entire data
+/// inline (for small strings) or an inlined prefix, an index of another 
buffer,
+/// and an offset pointing to a slice in that buffer (for non-small strings).
+///
+/// Since it uses a variable number of data buffers, each Field with this type
+/// must have a corresponding entry in `variadicBufferCounts`.
+struct Utf8View FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
+  typedef Utf8ViewBuilder Builder;
+  bool Verify(flatbuffers::Verifier &verifier) const {
+    return VerifyTableStart(verifier) &&
+           verifier.EndTable();
+  }
+};
+
+struct Utf8ViewBuilder {
+  typedef Utf8View Table;
+  flatbuffers::FlatBufferBuilder &fbb_;
+  flatbuffers::uoffset_t start_;
+  explicit Utf8ViewBuilder(flatbuffers::FlatBufferBuilder &_fbb)
+        : fbb_(_fbb) {
+    start_ = fbb_.StartTable();
+  }
+  Utf8ViewBuilder &operator=(const Utf8ViewBuilder &);
+  flatbuffers::Offset<Utf8View> Finish() {
+    const auto end = fbb_.EndTable(start_);
+    auto o = flatbuffers::Offset<Utf8View>(end);
+    return o;
+  }
+};
+
+inline flatbuffers::Offset<Utf8View> CreateUtf8View(
+    flatbuffers::FlatBufferBuilder &_fbb) {
+  Utf8ViewBuilder builder_(_fbb);
+  return builder_.Finish();
+}
+
+/// Logically the same as Binary, but the internal representation uses a view
+/// struct that contains the string length and either the string's entire data
+/// inline (for small strings) or an inlined prefix, an index of another 
buffer,
+/// and an offset pointing to a slice in that buffer (for non-small strings).
+///
+/// Since it uses a variable number of data buffers, each Field with this type
+/// must have a corresponding entry in `variadicBufferCounts`.
+struct BinaryView FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
+  typedef BinaryViewBuilder Builder;
+  bool Verify(flatbuffers::Verifier &verifier) const {
+    return VerifyTableStart(verifier) &&
+           verifier.EndTable();
+  }
+};
+
+struct BinaryViewBuilder {
+  typedef BinaryView Table;
+  flatbuffers::FlatBufferBuilder &fbb_;
+  flatbuffers::uoffset_t start_;
+  explicit BinaryViewBuilder(flatbuffers::FlatBufferBuilder &_fbb)
+        : fbb_(_fbb) {
+    start_ = fbb_.StartTable();
+  }
+  BinaryViewBuilder &operator=(const BinaryViewBuilder &);
+  flatbuffers::Offset<BinaryView> Finish() {
+    const auto end = fbb_.EndTable(start_);
+    auto o = flatbuffers::Offset<BinaryView>(end);
+    return o;
+  }
+};
+
+inline flatbuffers::Offset<BinaryView> CreateBinaryView(
+    flatbuffers::FlatBufferBuilder &_fbb) {
+  BinaryViewBuilder builder_(_fbb);
+  return builder_.Finish();
+}
+
 struct FixedSizeBinary FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
   typedef FixedSizeBinaryBuilder Builder;
   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
@@ -1185,6 +1376,7 @@ struct FixedSizeBinaryBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  FixedSizeBinaryBuilder &operator=(const FixedSizeBinaryBuilder &);
   flatbuffers::Offset<FixedSizeBinary> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<FixedSizeBinary>(end);
@@ -1216,6 +1408,7 @@ struct BoolBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  BoolBuilder &operator=(const BoolBuilder &);
   flatbuffers::Offset<Bool> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Bool>(end);
@@ -1250,6 +1443,7 @@ struct RunEndEncodedBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  RunEndEncodedBuilder &operator=(const RunEndEncodedBuilder &);
   flatbuffers::Offset<RunEndEncoded> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<RunEndEncoded>(end);
@@ -1313,6 +1507,7 @@ struct DecimalBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  DecimalBuilder &operator=(const DecimalBuilder &);
   flatbuffers::Offset<Decimal> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Decimal>(end);
@@ -1364,6 +1559,7 @@ struct DateBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  DateBuilder &operator=(const DateBuilder &);
   flatbuffers::Offset<Date> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Date>(end);
@@ -1427,6 +1623,7 @@ struct TimeBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  TimeBuilder &operator=(const TimeBuilder &);
   flatbuffers::Offset<Time> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Time>(end);
@@ -1594,6 +1791,7 @@ struct TimestampBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  TimestampBuilder &operator=(const TimestampBuilder &);
   flatbuffers::Offset<Timestamp> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Timestamp>(end);
@@ -1648,6 +1846,7 @@ struct IntervalBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  IntervalBuilder &operator=(const IntervalBuilder &);
   flatbuffers::Offset<Interval> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Interval>(end);
@@ -1689,6 +1888,7 @@ struct DurationBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  DurationBuilder &operator=(const DurationBuilder &);
   flatbuffers::Offset<Duration> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Duration>(end);
@@ -1743,6 +1943,7 @@ struct KeyValueBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  KeyValueBuilder &operator=(const KeyValueBuilder &);
   flatbuffers::Offset<KeyValue> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<KeyValue>(end);
@@ -1835,6 +2036,7 @@ struct DictionaryEncodingBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  DictionaryEncodingBuilder &operator=(const DictionaryEncodingBuilder &);
   flatbuffers::Offset<DictionaryEncoding> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<DictionaryEncoding>(end);
@@ -1952,6 +2154,18 @@ struct Field FLATBUFFERS_FINAL_CLASS : private 
flatbuffers::Table {
   const org::apache::arrow::flatbuf::RunEndEncoded *type_as_RunEndEncoded() 
const {
     return type_type() == org::apache::arrow::flatbuf::Type::RunEndEncoded ? 
static_cast<const org::apache::arrow::flatbuf::RunEndEncoded *>(type()) : 
nullptr;
   }
+  const org::apache::arrow::flatbuf::BinaryView *type_as_BinaryView() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::BinaryView ? 
static_cast<const org::apache::arrow::flatbuf::BinaryView *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::Utf8View *type_as_Utf8View() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::Utf8View ? 
static_cast<const org::apache::arrow::flatbuf::Utf8View *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::ListView *type_as_ListView() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::ListView ? 
static_cast<const org::apache::arrow::flatbuf::ListView *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::LargeListView *type_as_LargeListView() 
const {
+    return type_type() == org::apache::arrow::flatbuf::Type::LargeListView ? 
static_cast<const org::apache::arrow::flatbuf::LargeListView *>(type()) : 
nullptr;
+  }
   /// Present only if the field is dictionary encoded.
   const org::apache::arrow::flatbuf::DictionaryEncoding *dictionary() const {
     return GetPointer<const org::apache::arrow::flatbuf::DictionaryEncoding 
*>(VT_DICTIONARY);
@@ -2073,6 +2287,22 @@ template<> inline const 
org::apache::arrow::flatbuf::RunEndEncoded *Field::type_
   return type_as_RunEndEncoded();
 }
 
+template<> inline const org::apache::arrow::flatbuf::BinaryView 
*Field::type_as<org::apache::arrow::flatbuf::BinaryView>() const {
+  return type_as_BinaryView();
+}
+
+template<> inline const org::apache::arrow::flatbuf::Utf8View 
*Field::type_as<org::apache::arrow::flatbuf::Utf8View>() const {
+  return type_as_Utf8View();
+}
+
+template<> inline const org::apache::arrow::flatbuf::ListView 
*Field::type_as<org::apache::arrow::flatbuf::ListView>() const {
+  return type_as_ListView();
+}
+
+template<> inline const org::apache::arrow::flatbuf::LargeListView 
*Field::type_as<org::apache::arrow::flatbuf::LargeListView>() const {
+  return type_as_LargeListView();
+}
+
 struct FieldBuilder {
   typedef Field Table;
   flatbuffers::FlatBufferBuilder &fbb_;
@@ -2102,6 +2332,7 @@ struct FieldBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  FieldBuilder &operator=(const FieldBuilder &);
   flatbuffers::Offset<Field> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Field>(end);
@@ -2213,6 +2444,7 @@ struct SchemaBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  SchemaBuilder &operator=(const SchemaBuilder &);
   flatbuffers::Offset<Schema> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Schema>(end);
@@ -2344,6 +2576,22 @@ inline bool VerifyType(flatbuffers::Verifier &verifier, 
const void *obj, Type ty
       auto ptr = reinterpret_cast<const 
org::apache::arrow::flatbuf::RunEndEncoded *>(obj);
       return verifier.VerifyTable(ptr);
     }
+    case Type::BinaryView: {
+      auto ptr = reinterpret_cast<const 
org::apache::arrow::flatbuf::BinaryView *>(obj);
+      return verifier.VerifyTable(ptr);
+    }
+    case Type::Utf8View: {
+      auto ptr = reinterpret_cast<const org::apache::arrow::flatbuf::Utf8View 
*>(obj);
+      return verifier.VerifyTable(ptr);
+    }
+    case Type::ListView: {
+      auto ptr = reinterpret_cast<const org::apache::arrow::flatbuf::ListView 
*>(obj);
+      return verifier.VerifyTable(ptr);
+    }
+    case Type::LargeListView: {
+      auto ptr = reinterpret_cast<const 
org::apache::arrow::flatbuf::LargeListView *>(obj);
+      return verifier.VerifyTable(ptr);
+    }
     default: return true;
   }
 }
diff --git a/cpp/src/generated/SparseTensor_generated.h 
b/cpp/src/generated/SparseTensor_generated.h
index b3fa2dbff4..514bc0704d 100644
--- a/cpp/src/generated/SparseTensor_generated.h
+++ b/cpp/src/generated/SparseTensor_generated.h
@@ -204,6 +204,7 @@ struct SparseTensorIndexCOOBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  SparseTensorIndexCOOBuilder &operator=(const SparseTensorIndexCOOBuilder &);
   flatbuffers::Offset<SparseTensorIndexCOO> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<SparseTensorIndexCOO>(end);
@@ -338,6 +339,7 @@ struct SparseMatrixIndexCSXBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  SparseMatrixIndexCSXBuilder &operator=(const SparseMatrixIndexCSXBuilder &);
   flatbuffers::Offset<SparseMatrixIndexCSX> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<SparseMatrixIndexCSX>(end);
@@ -492,6 +494,7 @@ struct SparseTensorIndexCSFBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  SparseTensorIndexCSFBuilder &operator=(const SparseTensorIndexCSFBuilder &);
   flatbuffers::Offset<SparseTensorIndexCSF> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<SparseTensorIndexCSF>(end);
@@ -626,6 +629,18 @@ struct SparseTensor FLATBUFFERS_FINAL_CLASS : private 
flatbuffers::Table {
   const org::apache::arrow::flatbuf::RunEndEncoded *type_as_RunEndEncoded() 
const {
     return type_type() == org::apache::arrow::flatbuf::Type::RunEndEncoded ? 
static_cast<const org::apache::arrow::flatbuf::RunEndEncoded *>(type()) : 
nullptr;
   }
+  const org::apache::arrow::flatbuf::BinaryView *type_as_BinaryView() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::BinaryView ? 
static_cast<const org::apache::arrow::flatbuf::BinaryView *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::Utf8View *type_as_Utf8View() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::Utf8View ? 
static_cast<const org::apache::arrow::flatbuf::Utf8View *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::ListView *type_as_ListView() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::ListView ? 
static_cast<const org::apache::arrow::flatbuf::ListView *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::LargeListView *type_as_LargeListView() 
const {
+    return type_type() == org::apache::arrow::flatbuf::Type::LargeListView ? 
static_cast<const org::apache::arrow::flatbuf::LargeListView *>(type()) : 
nullptr;
+  }
   /// The dimensions of the tensor, optionally named.
   const 
flatbuffers::Vector<flatbuffers::Offset<org::apache::arrow::flatbuf::TensorDim>>
 *shape() const {
     return GetPointer<const 
flatbuffers::Vector<flatbuffers::Offset<org::apache::arrow::flatbuf::TensorDim>>
 *>(VT_SHAPE);
@@ -760,6 +775,22 @@ template<> inline const 
org::apache::arrow::flatbuf::RunEndEncoded *SparseTensor
   return type_as_RunEndEncoded();
 }
 
+template<> inline const org::apache::arrow::flatbuf::BinaryView 
*SparseTensor::type_as<org::apache::arrow::flatbuf::BinaryView>() const {
+  return type_as_BinaryView();
+}
+
+template<> inline const org::apache::arrow::flatbuf::Utf8View 
*SparseTensor::type_as<org::apache::arrow::flatbuf::Utf8View>() const {
+  return type_as_Utf8View();
+}
+
+template<> inline const org::apache::arrow::flatbuf::ListView 
*SparseTensor::type_as<org::apache::arrow::flatbuf::ListView>() const {
+  return type_as_ListView();
+}
+
+template<> inline const org::apache::arrow::flatbuf::LargeListView 
*SparseTensor::type_as<org::apache::arrow::flatbuf::LargeListView>() const {
+  return type_as_LargeListView();
+}
+
 template<> inline const org::apache::arrow::flatbuf::SparseTensorIndexCOO 
*SparseTensor::sparseIndex_as<org::apache::arrow::flatbuf::SparseTensorIndexCOO>()
 const {
   return sparseIndex_as_SparseTensorIndexCOO();
 }
@@ -801,6 +832,7 @@ struct SparseTensorBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  SparseTensorBuilder &operator=(const SparseTensorBuilder &);
   flatbuffers::Offset<SparseTensor> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<SparseTensor>(end);
diff --git a/cpp/src/generated/Tensor_generated.h 
b/cpp/src/generated/Tensor_generated.h
index 572b922e20..d3393553fa 100644
--- a/cpp/src/generated/Tensor_generated.h
+++ b/cpp/src/generated/Tensor_generated.h
@@ -59,6 +59,7 @@ struct TensorDimBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  TensorDimBuilder &operator=(const TensorDimBuilder &);
   flatbuffers::Offset<TensorDim> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<TensorDim>(end);
@@ -171,6 +172,18 @@ struct Tensor FLATBUFFERS_FINAL_CLASS : private 
flatbuffers::Table {
   const org::apache::arrow::flatbuf::RunEndEncoded *type_as_RunEndEncoded() 
const {
     return type_type() == org::apache::arrow::flatbuf::Type::RunEndEncoded ? 
static_cast<const org::apache::arrow::flatbuf::RunEndEncoded *>(type()) : 
nullptr;
   }
+  const org::apache::arrow::flatbuf::BinaryView *type_as_BinaryView() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::BinaryView ? 
static_cast<const org::apache::arrow::flatbuf::BinaryView *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::Utf8View *type_as_Utf8View() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::Utf8View ? 
static_cast<const org::apache::arrow::flatbuf::Utf8View *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::ListView *type_as_ListView() const {
+    return type_type() == org::apache::arrow::flatbuf::Type::ListView ? 
static_cast<const org::apache::arrow::flatbuf::ListView *>(type()) : nullptr;
+  }
+  const org::apache::arrow::flatbuf::LargeListView *type_as_LargeListView() 
const {
+    return type_type() == org::apache::arrow::flatbuf::Type::LargeListView ? 
static_cast<const org::apache::arrow::flatbuf::LargeListView *>(type()) : 
nullptr;
+  }
   /// The dimensions of the tensor, optionally named
   const 
flatbuffers::Vector<flatbuffers::Offset<org::apache::arrow::flatbuf::TensorDim>>
 *shape() const {
     return GetPointer<const 
flatbuffers::Vector<flatbuffers::Offset<org::apache::arrow::flatbuf::TensorDim>>
 *>(VT_SHAPE);
@@ -287,6 +300,22 @@ template<> inline const 
org::apache::arrow::flatbuf::RunEndEncoded *Tensor::type
   return type_as_RunEndEncoded();
 }
 
+template<> inline const org::apache::arrow::flatbuf::BinaryView 
*Tensor::type_as<org::apache::arrow::flatbuf::BinaryView>() const {
+  return type_as_BinaryView();
+}
+
+template<> inline const org::apache::arrow::flatbuf::Utf8View 
*Tensor::type_as<org::apache::arrow::flatbuf::Utf8View>() const {
+  return type_as_Utf8View();
+}
+
+template<> inline const org::apache::arrow::flatbuf::ListView 
*Tensor::type_as<org::apache::arrow::flatbuf::ListView>() const {
+  return type_as_ListView();
+}
+
+template<> inline const org::apache::arrow::flatbuf::LargeListView 
*Tensor::type_as<org::apache::arrow::flatbuf::LargeListView>() const {
+  return type_as_LargeListView();
+}
+
 struct TensorBuilder {
   typedef Tensor Table;
   flatbuffers::FlatBufferBuilder &fbb_;
@@ -310,6 +339,7 @@ struct TensorBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  TensorBuilder &operator=(const TensorBuilder &);
   flatbuffers::Offset<Tensor> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Tensor>(end);
diff --git a/cpp/src/generated/feather_generated.h 
b/cpp/src/generated/feather_generated.h
index 3696188b0f..b925eb2bc6 100644
--- a/cpp/src/generated/feather_generated.h
+++ b/cpp/src/generated/feather_generated.h
@@ -324,6 +324,7 @@ struct PrimitiveArrayBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  PrimitiveArrayBuilder &operator=(const PrimitiveArrayBuilder &);
   flatbuffers::Offset<PrimitiveArray> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<PrimitiveArray>(end);
@@ -386,6 +387,7 @@ struct CategoryMetadataBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  CategoryMetadataBuilder &operator=(const CategoryMetadataBuilder &);
   flatbuffers::Offset<CategoryMetadata> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<CategoryMetadata>(end);
@@ -440,6 +442,7 @@ struct TimestampMetadataBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  TimestampMetadataBuilder &operator=(const TimestampMetadataBuilder &);
   flatbuffers::Offset<TimestampMetadata> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<TimestampMetadata>(end);
@@ -484,6 +487,7 @@ struct DateMetadataBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  DateMetadataBuilder &operator=(const DateMetadataBuilder &);
   flatbuffers::Offset<DateMetadata> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<DateMetadata>(end);
@@ -523,6 +527,7 @@ struct TimeMetadataBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  TimeMetadataBuilder &operator=(const TimeMetadataBuilder &);
   flatbuffers::Offset<TimeMetadata> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<TimeMetadata>(end);
@@ -630,6 +635,7 @@ struct ColumnBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  ColumnBuilder &operator=(const ColumnBuilder &);
   flatbuffers::Offset<Column> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<Column>(end);
@@ -739,6 +745,7 @@ struct CTableBuilder {
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
   }
+  CTableBuilder &operator=(const CTableBuilder &);
   flatbuffers::Offset<CTable> Finish() {
     const auto end = fbb_.EndTable(start_);
     auto o = flatbuffers::Offset<CTable>(end);
diff --git a/format/Message.fbs b/format/Message.fbs
index 92a629f3f9..be57533d88 100644
--- a/format/Message.fbs
+++ b/format/Message.fbs
@@ -106,10 +106,10 @@ table RecordBatch {
   /// buffers which belong to that Field in the current RecordBatch.
   ///
   /// For example, the schema
-  ///     col1: Struct<a: Int32, b: BinaryView, c: Float64>
+  ///     col1: Struct<alpha: Int32, beta: BinaryView, gamma: Float64>
   ///     col2: Utf8View
   /// contains two Fields with variadic buffers so variadicBufferCounts will 
have
-  /// two entries, the first counting the variadic buffers of `col1.b` and the
+  /// two entries, the first counting the variadic buffers of `col1.beta` and 
the
   /// second counting `col2`'s.
   ///
   /// This field may be omitted if and only if the schema contains no Fields 
with
diff --git a/format/Schema.fbs b/format/Schema.fbs
index 70d9634463..6adbcb115c 100644
--- a/format/Schema.fbs
+++ b/format/Schema.fbs
@@ -194,7 +194,7 @@ table LargeBinary {
 table Utf8View {
 }
 
-/// Logically the same as Binary, but the internal representation uses a header
+/// Logically the same as Binary, but the internal representation uses a view
 /// struct that contains the string length and either the string's entire data
 /// inline (for small strings) or an inlined prefix, an index of another 
buffer,
 /// and an offset pointing to a slice in that buffer (for non-small strings).
diff --git a/go/arrow/internal/flatbuf/BinaryView.go 
b/go/arrow/internal/flatbuf/BinaryView.go
new file mode 100644
index 0000000000..09ca5e7db9
--- /dev/null
+++ b/go/arrow/internal/flatbuf/BinaryView.go
@@ -0,0 +1,57 @@
+// 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.
+
+// Code generated by the FlatBuffers compiler. DO NOT EDIT.
+
+package flatbuf
+
+import (
+       flatbuffers "github.com/google/flatbuffers/go"
+)
+
+/// Logically the same as Binary, but the internal representation uses a view
+/// struct that contains the string length and either the string's entire data
+/// inline (for small strings) or an inlined prefix, an index of another 
buffer,
+/// and an offset pointing to a slice in that buffer (for non-small strings).
+///
+/// Since it uses a variable number of data buffers, each Field with this type
+/// must have a corresponding entry in `variadicBufferCounts`.
+type BinaryView struct {
+       _tab flatbuffers.Table
+}
+
+func GetRootAsBinaryView(buf []byte, offset flatbuffers.UOffsetT) *BinaryView {
+       n := flatbuffers.GetUOffsetT(buf[offset:])
+       x := &BinaryView{}
+       x.Init(buf, n+offset)
+       return x
+}
+
+func (rcv *BinaryView) Init(buf []byte, i flatbuffers.UOffsetT) {
+       rcv._tab.Bytes = buf
+       rcv._tab.Pos = i
+}
+
+func (rcv *BinaryView) Table() flatbuffers.Table {
+       return rcv._tab
+}
+
+func BinaryViewStart(builder *flatbuffers.Builder) {
+       builder.StartObject(0)
+}
+func BinaryViewEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
+       return builder.EndObject()
+}
diff --git a/go/arrow/internal/flatbuf/LargeListView.go 
b/go/arrow/internal/flatbuf/LargeListView.go
new file mode 100644
index 0000000000..5b1df149cd
--- /dev/null
+++ b/go/arrow/internal/flatbuf/LargeListView.go
@@ -0,0 +1,52 @@
+// 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.
+
+// Code generated by the FlatBuffers compiler. DO NOT EDIT.
+
+package flatbuf
+
+import (
+       flatbuffers "github.com/google/flatbuffers/go"
+)
+
+/// Same as ListView, but with 64-bit offsets and sizes, allowing to represent
+/// extremely large data values.
+type LargeListView struct {
+       _tab flatbuffers.Table
+}
+
+func GetRootAsLargeListView(buf []byte, offset flatbuffers.UOffsetT) 
*LargeListView {
+       n := flatbuffers.GetUOffsetT(buf[offset:])
+       x := &LargeListView{}
+       x.Init(buf, n+offset)
+       return x
+}
+
+func (rcv *LargeListView) Init(buf []byte, i flatbuffers.UOffsetT) {
+       rcv._tab.Bytes = buf
+       rcv._tab.Pos = i
+}
+
+func (rcv *LargeListView) Table() flatbuffers.Table {
+       return rcv._tab
+}
+
+func LargeListViewStart(builder *flatbuffers.Builder) {
+       builder.StartObject(0)
+}
+func LargeListViewEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
+       return builder.EndObject()
+}
diff --git a/go/arrow/internal/flatbuf/ListView.go 
b/go/arrow/internal/flatbuf/ListView.go
new file mode 100644
index 0000000000..46b1e0b3cb
--- /dev/null
+++ b/go/arrow/internal/flatbuf/ListView.go
@@ -0,0 +1,53 @@
+// 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.
+
+// Code generated by the FlatBuffers compiler. DO NOT EDIT.
+
+package flatbuf
+
+import (
+       flatbuffers "github.com/google/flatbuffers/go"
+)
+
+/// Represents the same logical types that List can, but contains offsets and
+/// sizes allowing for writes in any order and sharing of child values among
+/// list values.
+type ListView struct {
+       _tab flatbuffers.Table
+}
+
+func GetRootAsListView(buf []byte, offset flatbuffers.UOffsetT) *ListView {
+       n := flatbuffers.GetUOffsetT(buf[offset:])
+       x := &ListView{}
+       x.Init(buf, n+offset)
+       return x
+}
+
+func (rcv *ListView) Init(buf []byte, i flatbuffers.UOffsetT) {
+       rcv._tab.Bytes = buf
+       rcv._tab.Pos = i
+}
+
+func (rcv *ListView) Table() flatbuffers.Table {
+       return rcv._tab
+}
+
+func ListViewStart(builder *flatbuffers.Builder) {
+       builder.StartObject(0)
+}
+func ListViewEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
+       return builder.EndObject()
+}
diff --git a/go/arrow/internal/flatbuf/RecordBatch.go 
b/go/arrow/internal/flatbuf/RecordBatch.go
index bb6aca9a06..c50f4a6e86 100644
--- a/go/arrow/internal/flatbuf/RecordBatch.go
+++ b/go/arrow/internal/flatbuf/RecordBatch.go
@@ -128,8 +128,62 @@ func (rcv *RecordBatch) Compression(obj *BodyCompression) 
*BodyCompression {
 }
 
 /// Optional compression of the message body
+/// Some types such as Utf8View are represented using a variable number of 
buffers.
+/// For each such Field in the pre-ordered flattened logical schema, there 
will be
+/// an entry in variadicBufferCounts to indicate the number of number of 
variadic
+/// buffers which belong to that Field in the current RecordBatch.
+///
+/// For example, the schema
+///     col1: Struct<alpha: Int32, beta: BinaryView, gamma: Float64>
+///     col2: Utf8View
+/// contains two Fields with variadic buffers so variadicBufferCounts will have
+/// two entries, the first counting the variadic buffers of `col1.beta` and the
+/// second counting `col2`'s.
+///
+/// This field may be omitted if and only if the schema contains no Fields with
+/// a variable number of buffers, such as BinaryView and Utf8View.
+func (rcv *RecordBatch) VariadicBufferCounts(j int) int64 {
+       o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
+       if o != 0 {
+               a := rcv._tab.Vector(o)
+               return rcv._tab.GetInt64(a + flatbuffers.UOffsetT(j*8))
+       }
+       return 0
+}
+
+func (rcv *RecordBatch) VariadicBufferCountsLength() int {
+       o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
+       if o != 0 {
+               return rcv._tab.VectorLen(o)
+       }
+       return 0
+}
+
+/// Some types such as Utf8View are represented using a variable number of 
buffers.
+/// For each such Field in the pre-ordered flattened logical schema, there 
will be
+/// an entry in variadicBufferCounts to indicate the number of number of 
variadic
+/// buffers which belong to that Field in the current RecordBatch.
+///
+/// For example, the schema
+///     col1: Struct<alpha: Int32, beta: BinaryView, gamma: Float64>
+///     col2: Utf8View
+/// contains two Fields with variadic buffers so variadicBufferCounts will have
+/// two entries, the first counting the variadic buffers of `col1.beta` and the
+/// second counting `col2`'s.
+///
+/// This field may be omitted if and only if the schema contains no Fields with
+/// a variable number of buffers, such as BinaryView and Utf8View.
+func (rcv *RecordBatch) MutateVariadicBufferCounts(j int, n int64) bool {
+       o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
+       if o != 0 {
+               a := rcv._tab.Vector(o)
+               return rcv._tab.MutateInt64(a+flatbuffers.UOffsetT(j*8), n)
+       }
+       return false
+}
+
 func RecordBatchStart(builder *flatbuffers.Builder) {
-       builder.StartObject(4)
+       builder.StartObject(5)
 }
 func RecordBatchAddLength(builder *flatbuffers.Builder, length int64) {
        builder.PrependInt64Slot(0, length, 0)
@@ -149,6 +203,12 @@ func RecordBatchStartBuffersVector(builder 
*flatbuffers.Builder, numElems int) f
 func RecordBatchAddCompression(builder *flatbuffers.Builder, compression 
flatbuffers.UOffsetT) {
        builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(compression), 0)
 }
+func RecordBatchAddVariadicBufferCounts(builder *flatbuffers.Builder, 
variadicBufferCounts flatbuffers.UOffsetT) {
+       builder.PrependUOffsetTSlot(4, 
flatbuffers.UOffsetT(variadicBufferCounts), 0)
+}
+func RecordBatchStartVariadicBufferCountsVector(builder *flatbuffers.Builder, 
numElems int) flatbuffers.UOffsetT {
+       return builder.StartVector(8, numElems, 8)
+}
 func RecordBatchEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
        return builder.EndObject()
 }
diff --git a/go/arrow/internal/flatbuf/Type.go 
b/go/arrow/internal/flatbuf/Type.go
index 707444b8e1..ab2bce9c63 100644
--- a/go/arrow/internal/flatbuf/Type.go
+++ b/go/arrow/internal/flatbuf/Type.go
@@ -49,6 +49,10 @@ const (
        TypeLargeUtf8       Type = 20
        TypeLargeList       Type = 21
        TypeRunEndEncoded   Type = 22
+       TypeBinaryView      Type = 23
+       TypeUtf8View        Type = 24
+       TypeListView        Type = 25
+       TypeLargeListView   Type = 26
 )
 
 var EnumNamesType = map[Type]string{
@@ -75,6 +79,10 @@ var EnumNamesType = map[Type]string{
        TypeLargeUtf8:       "LargeUtf8",
        TypeLargeList:       "LargeList",
        TypeRunEndEncoded:   "RunEndEncoded",
+       TypeBinaryView:      "BinaryView",
+       TypeUtf8View:        "Utf8View",
+       TypeListView:        "ListView",
+       TypeLargeListView:   "LargeListView",
 }
 
 var EnumValuesType = map[string]Type{
@@ -101,6 +109,10 @@ var EnumValuesType = map[string]Type{
        "LargeUtf8":       TypeLargeUtf8,
        "LargeList":       TypeLargeList,
        "RunEndEncoded":   TypeRunEndEncoded,
+       "BinaryView":      TypeBinaryView,
+       "Utf8View":        TypeUtf8View,
+       "ListView":        TypeListView,
+       "LargeListView":   TypeLargeListView,
 }
 
 func (v Type) String() string {
diff --git a/go/arrow/internal/flatbuf/Utf8View.go 
b/go/arrow/internal/flatbuf/Utf8View.go
new file mode 100644
index 0000000000..9cf8214901
--- /dev/null
+++ b/go/arrow/internal/flatbuf/Utf8View.go
@@ -0,0 +1,57 @@
+// 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.
+
+// Code generated by the FlatBuffers compiler. DO NOT EDIT.
+
+package flatbuf
+
+import (
+       flatbuffers "github.com/google/flatbuffers/go"
+)
+
+/// Logically the same as Utf8, but the internal representation uses a view
+/// struct that contains the string length and either the string's entire data
+/// inline (for small strings) or an inlined prefix, an index of another 
buffer,
+/// and an offset pointing to a slice in that buffer (for non-small strings).
+///
+/// Since it uses a variable number of data buffers, each Field with this type
+/// must have a corresponding entry in `variadicBufferCounts`.
+type Utf8View struct {
+       _tab flatbuffers.Table
+}
+
+func GetRootAsUtf8View(buf []byte, offset flatbuffers.UOffsetT) *Utf8View {
+       n := flatbuffers.GetUOffsetT(buf[offset:])
+       x := &Utf8View{}
+       x.Init(buf, n+offset)
+       return x
+}
+
+func (rcv *Utf8View) Init(buf []byte, i flatbuffers.UOffsetT) {
+       rcv._tab.Bytes = buf
+       rcv._tab.Pos = i
+}
+
+func (rcv *Utf8View) Table() flatbuffers.Table {
+       return rcv._tab
+}
+
+func Utf8ViewStart(builder *flatbuffers.Builder) {
+       builder.StartObject(0)
+}
+func Utf8ViewEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
+       return builder.EndObject()
+}

Reply via email to