我们可以在 Impala Cloudera 中使用枢纽关键字吗?
此代码给出错误
-- HADOOP IMPALA VISION 1
SELECT * FROM
(
SELECT
K.XID,
K.KAMPUS,
K.CIHAZTIPI,
K.CIHAZMODELI,
K.SISTEM,
K.CIHAZMARKASI,
K.SAHAEKIPMANKODU
FROM ODAK_STAGE.ENERGY_SAVING_KLIMA_UNPIVOT K
)
PIVOT
(
SUM(DEGER)
FOR DEGERTIPI
IN (
'sahaekipmankodu',
'Basinc',
)
)
ORDER BY DEGERTIPI
SQL Error [500051] [HY000]: [Cloudera]ImpalaJDBCDriver ERROR 处理查询/语句。错误代码:0,SQL 状态:TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:ParseException: 第 14 行语法错误:¶( ¶^¶遇到:(¶预期:CROSS、FROM、FULL、GROUP、HAVING、INNER 、连接、左、限制、偏移、开、顺序、右、 STRAIGHT_JOIN、TABLESAMPLE、UNION、USING、WHERE、COMMA¶¶引起于:异常:语法错误¶)、查询:SELECT * FROM¶(¶ SELECT ¶ K.XID,¶ K.KAMPUS,¶ K.CIHAZTIPI,¶ K. CIHAZMODELI,¶ K.SISTEM,¶ K.CIHAZMARKASI,¶ K.SAHAEKIPMANKODU¶ 来自ODAK_STAGE.ENERGY_SAVING_KLIMA_UNPIVOT K¶)¶PIVOT ¶( ¶ SUM(DEGER) ¶ FOR DEGERTIPI¶ IN ( ¶ 'sahaekipmankodu',¶ 'Basinc', ¶ ) ¶)¶按 DEGERTIPI 排序。
This code is giving error
-- HADOOP IMPALA VISION 1
SELECT * FROM
(
SELECT
K.XID,
K.KAMPUS,
K.CIHAZTIPI,
K.CIHAZMODELI,
K.SISTEM,
K.CIHAZMARKASI,
K.SAHAEKIPMANKODU
FROM ODAK_STAGE.ENERGY_SAVING_KLIMA_UNPIVOT K
)
PIVOT
(
SUM(DEGER)
FOR DEGERTIPI
IN (
'sahaekipmankodu',
'Basinc',
)
)
ORDER BY DEGERTIPI
SQL Error [500051] [HY000]: [Cloudera]ImpalaJDBCDriver ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:ParseException: Syntax error in line 14:¶( ¶^¶Encountered: (¶Expected: CROSS, FROM, FULL, GROUP, HAVING, INNER, JOIN, LEFT, LIMIT, OFFSET, ON, ORDER, RIGHT, STRAIGHT_JOIN, TABLESAMPLE, UNION, USING, WHERE, COMMA¶¶CAUSED BY: Exception: Syntax error¶), Query: SELECT * FROM¶(¶ SELECT ¶ K.XID,¶ K.KAMPUS,¶ K.CIHAZTIPI,¶ K.CIHAZMODELI,¶ K.SISTEM,¶ K.CIHAZMARKASI,¶ K.SAHAEKIPMANKODU¶ FROM ODAK_STAGE.ENERGY_SAVING_KLIMA_UNPIVOT K¶)¶PIVOT ¶( ¶ SUM(DEGER) ¶ FOR DEGERTIPI¶ IN ( ¶ 'sahaekipmankodu',¶ 'Basinc', ¶ ) ¶)¶ORDER BY DEGERTIPI.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能按照 6.1 文档,PIVOT 不是当前功能。
<一href="https://If%20you%20are%20trying%20to%20do%20a%20pivot%20in%20imapla%20in%20一般,%20you%20can%27t%20per%20the%206.1%20文档,%20PIV OT%20is%20not%20a%20current%20功能。%20%20%20%20https://www.cloudera.com/documentation/enterprise/6/6.1/topics/impala_reserved_words.html” rel="nofollow noreferrer">https://www.cloudera.com/documentation/enterprise/6/6.1/topics/impala_reserved_words.html
You can't per the 6.1 documentation, PIVOT is not a current functionality.
https://www.cloudera.com/documentation/enterprise/6/6.1/topics/impala_reserved_words.html