如何定义从Python SDK发送到Firehose的JSON的AWS胶模式?

发布于 2025-02-01 20:01:07 字数 862 浏览 3 评论 0原文

我考虑了此设置:

pythonsdk发送预定义的json-> AWS Kinesis Firehose->使用AWS Glue Schema->将数据转换为“镶木”。 是否成功)。

将数据保存到S3 ( 布尔值很容易,发送数组/结构根本不是微不足道的。 我一直收到奇怪的错误消息:

模式无效。解析模式的错误:错误:类型预期 在“ structname:string,id:bigint,is_bla:boolean”的位置0 但是找到了“结构”。

或者

模式无效。解析模式的错误:错误:类型预期 在“数组”的位置0,但找到了“数组”。

  1. 为什么我会收到这些错误消息?
  2. 架构数据类型是否有适当的文档/示例? 我只能找到 this 说列type应匹配“ 单行字符串模式”。

I have this setup in mind:

PythonSDK sending predefined JSON -> aws kinesis firehose -> convert data to "Parquet" using AWS GLUE schema -> save data to S3 (either if succeed or not).

While sending primities type like strings, ints & booleans is easy, sending array/struct isn't trivial at all.
I keep getting weird error messages of:

The schema is invalid. Error parsing the schema: Error: type expected
at the position 0 of 'STRUCTname:STRING,id:BIGINT,is_bla:BOOLEAN'
but 'STRUCT' is found.

OR

The schema is invalid. Error parsing the schema: Error: type expected
at the position 0 of 'ARRAY' but 'ARRAY' is found.

  1. Why I'm getting those error messages?
  2. Is there a proper doc/examples for schema data types?
    i could only find this saying Column Type should match the "Single-line string pattern".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奢望 2025-02-08 20:01:07

我会回答我的问题:

保存胶水模式和amp;将数据发送到Firehose。更新的JSON我发送了使用的旧架构,因此错误。

也来自 不幸的是,AWS在创建时并没有做到这一点。

I'll answer my question:

there is some delay between saving GLUE schema & sending data to firehose. updated JSONs I send used old schema hence the errors.

also from this and that we have to validate some naming conventions ourselfs, it's quite unfortunate AWS doesn't do it upon creation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文