AthenaQueryError:Athena 查询失败:“NOT_SUPPORTED:不支持的 Hive 类型”
我最近遇到以下错误“AthenaQueryError:Athena 查询失败:“NOT_SUPPORTED:不支持的 Hive 类型”,为此我遵循了此堆栈溢出链接:在 Athena 上转换为时区时间戳失败
错误:
整个问题的奇怪部分是我使用内部 python 插件时生成的 sql 查询当我在 Athena 中手动运行它时工作正常,但在 jupyter 笔记本中却不起作用
I recently ran into the following error "AthenaQueryError: Athena query failed: "NOT_SUPPORTED: Unsupported Hive type", and for this I followed this stack overflow link: converting to timestamp with time zone failed on Athena
The weird part of the whole issue is the sql query that is generated as I use an internal python plugin is working fine as I run it manually in Athena but the same doesn't work in a jupyter notebook
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定这是否与您的相同,但是当我使用 json_extract 提取一些 JSON 数据时遇到了同样的错误,它在 Athena 中工作正常,但在 Jupyter Notebook 中失败,抛出相同的错误错误如你的。
将 json_format 放在 json_extract 之前为我解决了这个问题。
将 json 转换为数组也解决了这个问题。
以下是使用
json_format
的 SQL 代码示例:这是使用
CAST
的另一个示例Not sure if this is the same as yours, But I ran into the same error when I was extracting some JSON data using
json_extract
, it works fine with Athena, but fails inside a Jupyter Notebook, throwing the same error as yours.Putting
json_format
beforejson_extract
solved it for me.casting json into an array also solved it.
Here is a example SQL code using
json_format
:Here is the other one using
CAST
就我而言,问题是我在 json 上执行
CROSS JOIN
,到目前为止一切顺利,但忘记NOT在SELECT声明。
这是我的查询:
如您所见,我进行了正确的转换,但由于
SELECT *
,我最终也从连接表中进行选择,其中包含 JSON,进而产生了相关错误。将 SELECT 语句限制为 SELECT a.* ... 当然解决了这个问题。
In my case, the issue was that I was doing a
CROSS JOIN
on json, so far so good, but forgot to NOT select it in theSELECT
statement.This was my query:
As you can see, I was casting alright, but due to
SELECT *
I ended up selecting from the joined table as well, which contained JSON and which in turn produced the error in question.Restricting the SELECT statement to
SELECT a.* ...
of course solved the issue.