File: README.md

package info (click to toggle)
apache-arrow 23.0.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 76,220 kB
  • sloc: cpp: 654,608; python: 70,522; ruby: 45,964; ansic: 18,742; sh: 7,365; makefile: 669; javascript: 125; xml: 41
file content (553 lines) | stat: -rw-r--r-- 20,258 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
<!---
  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.
-->

This directory contains a vendored version of Flatbuffers
(v24.3.6), with a patch for ARROW-17280.

```diff
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/allocator.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/allocator.h
index 30427190b..f0e91d0a3 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/allocator.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/allocator.h
@@ -17,9 +17,15 @@
 #ifndef FLATBUFFERS_ALLOCATOR_H_
 #define FLATBUFFERS_ALLOCATOR_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/base.h"
 
-namespace flatbuffers {
+namespace arrow_vendored_private::flatbuffers {
 
 // Allocator interface. This is flatbuffers-specific and meant only for
 // `vector_downward` usage.
@@ -63,6 +69,6 @@ class Allocator {
   }
 };
 
-}  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_ALLOCATOR_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/array.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/array.h
index f4bfbf054..f8e78243a 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/array.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/array.h
@@ -17,6 +17,12 @@
 #ifndef FLATBUFFERS_ARRAY_H_
 #define FLATBUFFERS_ARRAY_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include <cstdint>
 #include <memory>
 
@@ -24,7 +30,7 @@
 #include "flatbuffers/stl_emulation.h"
 #include "flatbuffers/vector.h"
 
-namespace flatbuffers {
+namespace arrow_vendored_private::flatbuffers {
 
 // This is used as a helper type for accessing arrays.
 template<typename T, uint16_t length> class Array {
@@ -251,6 +257,6 @@ bool operator==(const Array<T, length> &lhs,
           std::memcmp(lhs.Data(), rhs.Data(), rhs.size() * sizeof(T)) == 0);
 }
 
-}  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_ARRAY_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/base.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/base.h
index 5c4cae791..1b0c7d987 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/base.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/base.h
@@ -1,6 +1,12 @@
 #ifndef FLATBUFFERS_BASE_H_
 #define FLATBUFFERS_BASE_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 // clang-format off
 
 // If activate should be declared and included first.
@@ -144,10 +150,13 @@
 #define FLATBUFFERS_VERSION_REVISION 26
 #define FLATBUFFERS_STRING_EXPAND(X) #X
 #define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
+
+namespace arrow_vendored_private {
 namespace flatbuffers {
   // Returns version as string  "MAJOR.MINOR.REVISION".
   const char* FLATBUFFERS_VERSION();
 }
+}
 
 #if (!defined(_MSC_VER) || _MSC_VER > 1600) && \
     (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 407)) || \
@@ -222,14 +231,14 @@ namespace flatbuffers {
     // Check for std::string_view (in c++17)
     #if __has_include(<string_view>) && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17))
       #include <string_view>
-      namespace flatbuffers {
+      namespace arrow_vendored_private::flatbuffers {
         typedef std::string_view string_view;
       }
       #define FLATBUFFERS_HAS_STRING_VIEW 1
     // Check for std::experimental::string_view (in c++14, compiler-dependent)
     #elif __has_include(<experimental/string_view>) && (__cplusplus >= 201411)
       #include <experimental/string_view>
-      namespace flatbuffers {
+      namespace arrow_vendored_private::flatbuffers {
         typedef std::experimental::string_view string_view;
       }
       #define FLATBUFFERS_HAS_STRING_VIEW 1
@@ -240,7 +249,7 @@ namespace flatbuffers {
       #include "absl/base/config.h"
       #if !defined(ABSL_USES_STD_STRING_VIEW)
         #include "absl/strings/string_view.h"
-        namespace flatbuffers {
+        namespace arrow_vendored_private::flatbuffers {
           typedef absl::string_view string_view;
         }
         #define FLATBUFFERS_HAS_STRING_VIEW 1
@@ -317,6 +326,7 @@ template<typename T> FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) {
 /// @endcond
 
 /// @file
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 /// @cond FLATBUFFERS_INTERNAL
@@ -492,4 +502,6 @@ inline bool IsInRange(const T &v, const T &low, const T &high) {
 }
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
+
 #endif  // FLATBUFFERS_BASE_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer.h
index 94d4f7903..e791c3007 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer.h
@@ -17,11 +17,17 @@
 #ifndef FLATBUFFERS_BUFFER_H_
 #define FLATBUFFERS_BUFFER_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include <algorithm>
 
 #include "flatbuffers/base.h"
 
-namespace flatbuffers {
+namespace arrow_vendored_private::flatbuffers {
 
 // Wrapper for uoffset_t to allow safe template specialization.
 // Value is allowed to be 0 to indicate a null object (see e.g. AddOffset).
@@ -194,6 +200,6 @@ const T *GetSizePrefixedRoot(const void *buf) {
   return GetRoot<T>(reinterpret_cast<const uint8_t *>(buf) + sizeof(SizeT));
 }
 
-}  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_BUFFER_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer_ref.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer_ref.h
index f70941fc6..8a4a43f81 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer_ref.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/buffer_ref.h
@@ -17,10 +17,16 @@
 #ifndef FLATBUFFERS_BUFFER_REF_H_
 #define FLATBUFFERS_BUFFER_REF_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/base.h"
 #include "flatbuffers/verifier.h"
 
-namespace flatbuffers {
+namespace arrow_vendored_private::flatbuffers {
 
 // Convenient way to bundle a buffer and its length, to pass it around
 // typed by its root.
@@ -48,6 +54,6 @@ template<typename T> struct BufferRef : BufferRefBase {
   bool must_free;
 };
 
-}  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_BUFFER_REF_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/default_allocator.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/default_allocator.h
index d4724122c..fd2dc60a9 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/default_allocator.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/default_allocator.h
@@ -17,10 +17,16 @@
 #ifndef FLATBUFFERS_DEFAULT_ALLOCATOR_H_
 #define FLATBUFFERS_DEFAULT_ALLOCATOR_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/allocator.h"
 #include "flatbuffers/base.h"
 
-namespace flatbuffers {
+namespace arrow_vendored_private::flatbuffers {
 
 // DefaultAllocator uses new/delete to allocate memory regions
 class DefaultAllocator : public Allocator {
@@ -59,6 +65,6 @@ inline uint8_t *ReallocateDownward(Allocator *allocator, uint8_t *old_p,
                          old_p, old_size, new_size, in_use_back, in_use_front);
 }
 
-}  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_DEFAULT_ALLOCATOR_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/detached_buffer.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/detached_buffer.h
index 5e900baeb..4779545b3 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/detached_buffer.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/detached_buffer.h
@@ -17,11 +17,17 @@
 #ifndef FLATBUFFERS_DETACHED_BUFFER_H_
 #define FLATBUFFERS_DETACHED_BUFFER_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/allocator.h"
 #include "flatbuffers/base.h"
 #include "flatbuffers/default_allocator.h"
 
-namespace flatbuffers {
+namespace arrow_vendored_private::flatbuffers {
 
 // DetachedBuffer is a finished flatbuffer memory region, detached from its
 // builder. The original memory region and allocator are also stored so that
@@ -109,6 +115,6 @@ class DetachedBuffer {
   }
 };
 
-}  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_DETACHED_BUFFER_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffer_builder.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffer_builder.h
index 0a38b4ac3..5825cc05c 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffer_builder.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffer_builder.h
@@ -17,6 +17,12 @@
 #ifndef FLATBUFFERS_FLATBUFFER_BUILDER_H_
 #define FLATBUFFERS_FLATBUFFER_BUILDER_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include <algorithm>
 #include <cstdint>
 #include <functional>
@@ -38,6 +44,7 @@
 #include "flatbuffers/vector_downward.h"
 #include "flatbuffers/verifier.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 // Converts a Field ID to a virtual table offset.
@@ -1461,5 +1468,6 @@ const T *GetTemporaryPointer(FlatBufferBuilder &fbb, Offset<T> offset) {
 }
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_FLATBUFFER_BUILDER_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffers.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffers.h
index bc828a313..8aa19a65c 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffers.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffers.h
@@ -17,6 +17,12 @@
 #ifndef FLATBUFFERS_H_
 #define FLATBUFFERS_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include <algorithm>
 
 // TODO: These includes are for mitigating the pains of users editing their
@@ -35,6 +41,7 @@
 #include "flatbuffers/vector_downward.h"
 #include "flatbuffers/verifier.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 /// @brief This can compute the start of a FlatBuffer from a root pointer, i.e.
@@ -278,6 +285,7 @@ inline const char *flatbuffers_version_string() {
     }
 /// @endcond
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 // clang-format on
 
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/stl_emulation.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/stl_emulation.h
index fd3a8cda7..dcbe23347 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/stl_emulation.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/stl_emulation.h
@@ -26,6 +26,12 @@
 #include <memory>
 #include <limits>
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #ifndef FLATBUFFERS_USE_STD_OPTIONAL
   // Detect C++17 compatible compiler.
   // __cplusplus >= 201703L - a compiler has support of 'static inline' variables.
@@ -64,6 +70,7 @@
 #endif // defined(FLATBUFFERS_USE_STD_SPAN)
 
 // This header provides backwards compatibility for older versions of the STL.
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 #if defined(FLATBUFFERS_TEMPLATES_ALIASES)
@@ -509,5 +516,6 @@ flatbuffers::span<const ElementType, dynamic_extent> make_span(const ElementType
 #endif // !defined(FLATBUFFERS_SPAN_MINIMAL)
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_STL_EMULATION_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/string.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/string.h
index 97e399fd6..1cdba4588 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/string.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/string.h
@@ -17,9 +17,16 @@
 #ifndef FLATBUFFERS_STRING_H_
 #define FLATBUFFERS_STRING_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/base.h"
 #include "flatbuffers/vector.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 struct String : public Vector<char> {
@@ -60,5 +67,6 @@ static inline flatbuffers::string_view GetStringView(const String *str) {
 #endif  // FLATBUFFERS_HAS_STRING_VIEW
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_STRING_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/struct.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/struct.h
index abacc8a9a..92a8e80bf 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/struct.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/struct.h
@@ -17,8 +17,15 @@
 #ifndef FLATBUFFERS_STRUCT_H_
 #define FLATBUFFERS_STRUCT_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/base.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 // "structs" are flat structures that do not have an offset table, thus
@@ -49,5 +56,6 @@ class Struct FLATBUFFERS_FINAL_CLASS {
 };
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_STRUCT_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/table.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/table.h
index e92d8ae8e..762563daf 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/table.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/table.h
@@ -17,9 +17,16 @@
 #ifndef FLATBUFFERS_TABLE_H_
 #define FLATBUFFERS_TABLE_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/base.h"
 #include "flatbuffers/verifier.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 // "tables" use an offset table (possibly shared) that allows fields to be
@@ -184,5 +191,6 @@ inline flatbuffers::Optional<bool> Table::GetOptional<uint8_t, bool>(
 }
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_TABLE_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/vector.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/vector.h
index ae52b9382..94591859a 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/vector.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/vector.h
@@ -17,10 +17,17 @@
 #ifndef FLATBUFFERS_VECTOR_H_
 #define FLATBUFFERS_VECTOR_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/base.h"
 #include "flatbuffers/buffer.h"
 #include "flatbuffers/stl_emulation.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 struct String;
@@ -393,5 +400,6 @@ template<typename T> static inline size_t VectorLength(const Vector<T> *v) {
 }
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_VERIFIER_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/vector_downward.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/vector_downward.h
index 2b5a92cf1..a87b17b66 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/vector_downward.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/vector_downward.h
@@ -17,6 +17,12 @@
 #ifndef FLATBUFFERS_VECTOR_DOWNWARD_H_
 #define FLATBUFFERS_VECTOR_DOWNWARD_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include <algorithm>
 #include <cstdint>
 
@@ -24,6 +30,7 @@
 #include "flatbuffers/default_allocator.h"
 #include "flatbuffers/detached_buffer.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 // This is a minimal replication of std::vector<uint8_t> functionality,
@@ -285,5 +292,6 @@ template<typename SizeT = uoffset_t> class vector_downward {
 };
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_VECTOR_DOWNWARD_H_
diff --git a/cpp/thirdparty/flatbuffers/include/flatbuffers/verifier.h b/cpp/thirdparty/flatbuffers/include/flatbuffers/verifier.h
index de1146be9..f6f5ac7f2 100644
--- a/cpp/thirdparty/flatbuffers/include/flatbuffers/verifier.h
+++ b/cpp/thirdparty/flatbuffers/include/flatbuffers/verifier.h
@@ -17,9 +17,16 @@
 #ifndef FLATBUFFERS_VERIFIER_H_
 #define FLATBUFFERS_VERIFIER_H_
 
+// Move this vendored copy of flatbuffers to a private namespace,
+// but continue to access it through the "flatbuffers" alias.
+namespace arrow_vendored_private::flatbuffers {
+}
+namespace flatbuffers = arrow_vendored_private::flatbuffers;
+
 #include "flatbuffers/base.h"
 #include "flatbuffers/vector.h"
 
+namespace arrow_vendored_private {
 namespace flatbuffers {
 
 // Helper class to verify the integrity of a FlatBuffer
@@ -328,5 +335,6 @@ inline size_t Verifier::VerifyOffset<uoffset64_t>(const size_t start) const {
 }
 
 }  // namespace flatbuffers
+}  // namespace arrow_vendored_private
 
 #endif  // FLATBUFFERS_VERIFIER_H_
-- 
2.34.1

```