usql icon indicating copy to clipboard operation
usql copied to clipboard

Retrieving the Properties Field using the Avro Extractor

Open NoraBo opened this issue 7 years ago • 2 comments

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""
		]
	}
]

} ");

NoraBo avatar Sep 10 '18 07:09 NoraBo

Could you please let me know if you have any update on the above request?

NoraBo avatar Sep 18 '18 10:09 NoraBo

Please take a look at #147. This PR should solve the issue.

flmader avatar Jan 02 '19 11:01 flmader