rmnlchh commented on issue #9282:
URL: https://github.com/apache/hudi/issues/9282#issuecomment-1651743365
@ad1happy2go
Kafka topic record schema:
{
"type": "record",
"name": "Creative",
"namespace": "Cardlytics.Ops.Messages.Portal",
"fields": [
{
"name": "CreativeId",
"type": "string"
},
{
"name": "PreMessageImpression",
"type": "string",
"default": ""
},
{
"name": "PostMessageImpression",
"type": "string",
"default": ""
},
{
"name": "Assets",
"type": {
"type": "array",
"items": {
"type": "record",
"name": "AdAsset",
"fields": [
{
"name": "Type",
"type": {
"type": "enum",
"name": "AssetType",
"symbols": [
"Other",
"Text",
"Image",
"Video",
"Link"
],
"default": "Other"
}
},
{
"name": "Slot",
"type": "string"
},
{
"name": "Label",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "Value",
"type": "string"
}
]
}
}
}
]
}
DS transform query
SELECT
'Creative' Entity
,o.CreativeId
,o.PreMessageImpression
,o.PostMessageImpression
,o.Assets.Type AssetType
,o.Assets.Slot AssetSlot
,o.Assets.Label AssetLabel
,o.Assets.Value AssetValue
FROM
(SELECT a.CreativeId, a.PreMessageImpression, a.PostMessageImpression,
explode(a.Assets) Assets
FROM
<SRC> a) o
expected result table schema:
{
"type": "record",
"name": "Creative",
"namespace": "Cardlytics.Ops.Messages.Portal",
"fields": [
{
"name": "Entity",
"type": "string"
},
{
"name": "CreativeId",
"type": "string"
},
{
"name": "PreMessageImpression",
"type": "string",
"default": ""
},
{
"name": "PostMessageImpression",
"type": "string",
"default": ""
},
{
"name": "AssetType",
"type": "string"
},
{
"name": "AssetSlot",
"type": "string"
},
{
"name": "AssetLabel",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "AssetValue",
"type": "string"
}
]
}
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]