Skip to content

Retrieving the Properties Field using the Avro Extractor #144

Description

@NoraBo

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.

Olivier Poitrey (@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""
		]
	}
]

}
");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions