我们可以在 Impala Cloudera 中使用枢纽关键字吗?

发布于 2025-01-14 19:51:46 字数 986 浏览 0 评论 0原文

此代码给出错误

-- 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 技术交流群。

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

发布评论

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

评论(1

凉世弥音 2025-01-21 19:51:46

您不能按照 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

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