通过 Firehose 将地图数据传送到 Athena

Ibh*_*ati 5 boto3 amazon-athena amazon-kinesis-firehose

我在 Athena 中有一个地图类型的专栏。我已将 Glue 中的架构定义为 Map 。

我定义了一个 Firehose 流,它引用粘合模式并将其转换为镶木地板格式。但是,我在发送数据时收到以下错误

The schema is invalid. Error parsing the schema: Error: type expected at the position 0 of 'MAP <STRING, INT>' but 'MAP ' is found.

我正在使用 boto3 firehose 客户端提交数据。

这是我尝试过的

records=[{'Data': '{"id": "aac4da11-d166-42bd-83db-c670f5b5676d", "createdutc": "2019-06-27 10:25:33","tokens": {"black": 1, "spot": 1, "joint": 1, "leg": 1, "due": 1, "itchinghow": 1, "reduce": 1}'}]

firehoseClient.put_record_batch(
    DeliveryStreamName='conversations-analysis',
    Records=records)
Run Code Online (Sandbox Code Playgroud)

Ibh*_*ati 4

显然,我能够解决这个问题,用小写字母提及您架构中的所有内容,您应该能够保存地图数据。例如用地图代替 MAP

  • 抱歉,从头开始,我刚刚意识到我的架构更新不知何故第一次没有被保存。我再次检查了一遍,确保我的架构的所有嵌套列类型都是小写的,并且它有效。感谢你的回答!顺便说一句,我在 AWS 论坛上找到了相关帖子:https://forums.aws.amazon.com/thread.jspa?messageID=863428&amp;tstart=0 (3认同)