Skip to content

Commit 7802a2b

Browse files
eerhardtkou
authored andcommitted
ARROW-4543: [C#] Update Flat Buffers code to latest version
- Update FlatBuffers code to latest version. - Mark all FlatBuffer types as internal. Note: I didn't use the latest `.fbs` file version because it included the SparseTensor support. Using the latest `.fbs` change caused problems with the `Tensor` generation. I have a [question if the latest `.fbs` file is correct](apache/arrow#2546 (comment)). /cc @chutchinson @stephentoub - FYI Author: Eric Erhardt <eric.erhardt@microsoft.com> Closes #3637 from eerhardt/UpdateFlatBufferCode and squashes the following commits: 15e0831c <Eric Erhardt> Adding how to update FlatBuffers code to the README 043ce7e2 <Eric Erhardt> ARROW-4543: Update Flat Buffers code to latest version
1 parent f452b98 commit 7802a2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+565
-180
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,11 @@ Build from the Apache Arrow project root.
148148
dotnet test test/Apache.Arrow.Tests
149149

150150
All build artifacts are placed in the **artifacts** folder in the project root.
151+
152+
# Updating FlatBuffers code
153+
154+
See https://google.github.io/flatbuffers/flatbuffers_guide_use_java_c-sharp.html for how to get the `flatc` executable.
155+
156+
Run `flatc --csharp` on each `.fbs` file in the [format](../format) folder. And replace the checked in `.cs` files under [FlatBuf](src/Apache.Arrow/Flatbuf) with the generated files.
157+
158+
Update the non-generated [FlatBuffers](src/Apache.Arrow/Flatbuf/FlatBuffers) `.cs` files with the files from the [google/flatbuffers repo](https://github.com/google/flatbuffers/tree/master/net/FlatBuffers).

src/Apache.Arrow/Flatbuf/Block.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Apache.Arrow.Flatbuf
88
using global::System;
99
using global::FlatBuffers;
1010

11-
public struct Block : IFlatbufferObject
11+
internal struct Block : IFlatbufferObject
1212
{
1313
private Struct __p;
1414
public ByteBuffer ByteBuffer { get { return __p.bb; } }

src/Apache.Arrow/Flatbuf/Buffer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Apache.Arrow.Flatbuf
1010

1111
/// ----------------------------------------------------------------------
1212
/// A Buffer represents a single contiguous memory segment
13-
public struct Buffer : IFlatbufferObject
13+
internal struct Buffer : IFlatbufferObject
1414
{
1515
private Struct __p;
1616
public ByteBuffer ByteBuffer { get { return __p.bb; } }

src/Apache.Arrow/Flatbuf/DictionaryBatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Apache.Arrow.Flatbuf
1414
/// There is one vector / column per dictionary, but that vector / column
1515
/// may be spread across multiple dictionary batches by using the isDelta
1616
/// flag
17-
public struct DictionaryBatch : IFlatbufferObject
17+
internal struct DictionaryBatch : IFlatbufferObject
1818
{
1919
private Table __p;
2020
public ByteBuffer ByteBuffer { get { return __p.bb; } }

src/Apache.Arrow/Flatbuf/DictionaryEncoding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Apache.Arrow.Flatbuf
1010

1111
/// ----------------------------------------------------------------------
1212
/// Dictionary encoding metadata
13-
public struct DictionaryEncoding : IFlatbufferObject
13+
internal struct DictionaryEncoding : IFlatbufferObject
1414
{
1515
private Table __p;
1616
public ByteBuffer ByteBuffer { get { return __p.bb; } }

src/Apache.Arrow/Flatbuf/Enums/DateUnit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Apache.Arrow.Flatbuf
66
{
77

8-
public enum DateUnit : short
8+
internal enum DateUnit : short
99
{
1010
DAY = 0,
1111
MILLISECOND = 1,

src/Apache.Arrow/Flatbuf/Enums/Endianness.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Apache.Arrow.Flatbuf
77

88
/// ----------------------------------------------------------------------
99
/// Endianness of the platform producing the data
10-
public enum Endianness : short
10+
internal enum Endianness : short
1111
{
1212
Little = 0,
1313
Big = 1,

src/Apache.Arrow/Flatbuf/Enums/IntervalUnit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Apache.Arrow.Flatbuf
66
{
77

8-
public enum IntervalUnit : short
8+
internal enum IntervalUnit : short
99
{
1010
YEAR_MONTH = 0,
1111
DAY_TIME = 1,

src/Apache.Arrow/Flatbuf/Enums/MessageHeader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Apache.Arrow.Flatbuf
1313
/// Arrow implementations do not need to implement all of the message types,
1414
/// which may include experimental metadata types. For maximum compatibility,
1515
/// it is best to send data using RecordBatch
16-
public enum MessageHeader : byte
16+
internal enum MessageHeader : byte
1717
{
1818
NONE = 0,
1919
Schema = 1,

src/Apache.Arrow/Flatbuf/Enums/MetadataVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Apache.Arrow.Flatbuf
66
{
77

8-
public enum MetadataVersion : short
8+
internal enum MetadataVersion : short
99
{
1010
/// 0.1.0
1111
V1 = 0,

0 commit comments

Comments
 (0)