You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "chutchinson (via GitHub)" <gi...@apache.org> on 2023/03/03 21:52:09 UTC
[GitHub] [arrow] chutchinson opened a new issue, #34443: RecordBatch.Builder does not respect field metadata
chutchinson opened a new issue, #34443:
URL: https://github.com/apache/arrow/issues/34443
### Describe the bug, including details regarding any error messages, version, and platform.
The **RecordBatch.Builder** API does not respect field metadata when calling **Append**. The field and array is added to the **RecordBatch**; however, the field does not contain any metadata.
```csharp
var metadata = new Dictionary<string, string>
{
{ "unit", "in" }
};
var field = new Field("ColumnA", Int32Type.Default, false, metadata);
var array = new Int32Array.Builder().Append(0).Build();
var recordBatch = new RecordBatch.Builder()
.Append(field, array)
.Build();
Assert.True(recordBatch.Schema.GetFieldByIndex(0).HasMetadata);
Assert.True(recordBatch.Schema.GetFieldByIndex(0).Metadata.ContainsKey("unit"));
```
The metadata is preserved when manually constructing a **RecordBatch**:
```csharp
var metadata = new Dictionary<string, string>
{
{ "unit", "in" }
};
var field = new Field("ColumnA", Int32Type.Default, false, metadata);
var array = new Int32Array.Builder().Append(0).Build();
var schema = new Schema.Builder().Field(field).Build();
var recordBatch = new RecordBatch(schema, new[] { array }, array.Length);
Assert.True(recordBatch.Schema.GetFieldByIndex(0).HasMetadata);
Assert.True(recordBatch.Schema.GetFieldByIndex(0).Metadata.ContainsKey("unit"));
```
### Component(s)
C#
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] chutchinson closed issue #34443: [C#] RecordBatch.Builder does not respect field metadata
Posted by "chutchinson (via GitHub)" <gi...@apache.org>.
chutchinson closed issue #34443: [C#] RecordBatch.Builder does not respect field metadata
URL: https://github.com/apache/arrow/issues/34443
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] chutchinson commented on issue #34443: [C#] RecordBatch.Builder does not respect field metadata
Posted by "chutchinson (via GitHub)" <gi...@apache.org>.
chutchinson commented on issue #34443:
URL: https://github.com/apache/arrow/issues/34443#issuecomment-1454175174
Please forgive me... apparently this was an extension method in our codebase and I failed to notice until I went looking in the source code. Closing the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org