Ask Your Question

How can I save a table in C# Apache Arrow to a file on disk?

asked 2022-07-22 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-02 02:00:00 +0000

devzero gravatar image

To save a table in C# Apache Arrow to a file on disk, you can use the ArrowStreamWriter class. Here's an example code snippet:

using(var stream = new FileStream("data.arrow", FileMode.Create))
using(var writer = new ArrowStreamWriter(stream, table.Schema))

In this code, table refers to the Table object that you want to save, and data.arrow is the file name of the output file.

First, a FileStream object is created to specify the output file and the FileMode as Create to create a new file.

Next, an ArrowStreamWriter object is created by passing in the FileStream object and the schema of the Table.

Then, the WriteTable method of the ArrowStreamWriter object is called to write the Table to the output file.

Once the write operation is completed, the file is saved on disk.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer

Question Tools


Asked: 2022-07-22 11:00:00 +0000

Seen: 17 times

Last updated: Jun 02 '21