High level API with array properties #421
Answered
by
adamreeve
Pragmateek
asked this question in
Q&A
|
Hi all, |
Answered by
adamreeve
Feb 7, 2024
Replies: 1 comment 1 reply
|
Hi @Pragmateek, you can use the var columns = new Column[]
{
new Column<int[]>("int_arrays"),
new Column<string[]>("string_arrays"),
};
using var writer = new ParquetFileWriter(outputPath, columns);
using var rowGroupWriter = writer.AppendRowGroup();
using var intArrayWriter = rowGroupWriter.NextColumn().LogicalWriter<int[]>();
intArrayWriter.WriteBatch(new int[][]
{
new [] {0, 1, 2},
new [] {3, 4},
new [] {5, 6, 7, 8},
});
using var stringArrayWriter = rowGroupWriter.NextColumn().LogicalWriter<string[]>();
stringArrayWriter.WriteBatch(new string[][]
{
new [] {"abc", "def"},
new [] {"ghi"},
new [] {"jkl", "mno"},
});
writer.Close(); |
1 reply
Answer selected by
Pragmateek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Pragmateek, you can use the
ColumnAPI with array values. For example, this works: