Azure / Azure/usql

Retrieving the Properties Field using the Avro Extractor

Open
#144 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
231
Forks
666
PR merge metrics
No merged PRs in 30d

Description

How could we query the **Properties** field of type **map** in U-SQL statement when using the Avro extractor as shown below:

The **Properties** field is required to differentiate between different type of records being stored.

@rs =
EXTRACT
EnqueuedTimeUtc string,
SequenceNumber long,
Offset string,
Body byte[]

FROM @input_file
**USING new Microsoft.Analytics.Samples.Formats.ApacheAvro.AvroExtractor**(@"
{
""type"": ""record"",
""name"": ""EventData"",
""namespace"": ""Microsoft.ServiceBus.Messaging"",
""fields"": [
{
""name"": ""SequenceNumber"",
""type"": ""long""
},
{
""name"": ""Offset"",
""type"": ""string""
},
{
""name"": ""EnqueuedTimeUtc"",
""type"": ""string""
},
{
""name"": ""SystemProperties"",
""type"": {
""type"": ""map"",
""values"": [
""long"",
""double"",
""string"",
""bytes""
]
}
},
{
""name"": ""**Properties**"",
""type"": {
""type"": ""map"",
""values"": [
""long"",
""double"",
""string"",
""bytes"",
""null""
]
}
},
{
""name"": ""Body"",
""type"": [
""null"",
""bytes""
]
}
]
}
");

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.