繁体   English   中英

无法从 Spark 创建 Hive 表

[英]Unable to create Hive table from spark

我正在尝试使用 Spark 创建配置单元表。 我收到以下错误 -

 +- TungstenAggregate(key=[rpt_prd#244,country_code#240,product_code#242], functions=[(count(1),mode=Partial,isDistinct=false)], output=[rpt_prd#244,co
untry_code#240,product_code#242,count#832L])
                     +- HiveTableScan [rpt_prd#244,country_code#240,product_code#242], MetastoreRelation gfrrtnsd_standardization, pln_arrg_dim, None, [(country_code#24
0 = HK)]

org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
TungstenExchange hashpartitioning(rpt_prd#236,200), None
+- Sort [rpt_prd#236 ASC], true, 0
   +- ConvertToUnsafe
      +- Exchange rangepartitioning(rpt_prd#236 ASC,200), None
         +- ConvertToSafe
            +- TungstenAggregate(key=[rpt_prd#244,country_code#240,product_code#242], functions=[(count(1),mode=Final,isDistinct=false)], output=[rpt_prd#236,Dim_countr
y_code#237,Dim_product_code#238,Dim_recordCount#239L])
               +- TungstenExchange hashpartitioning(rpt_prd#244,country_code#240,product_code#242,200), None
                  +- TungstenAggregate(key=[rpt_prd#244,country_code#240,product_code#242], functions=[(count(1),mode=Partial,isDistinct=false)], output=[rpt_prd#244,co
untry_code#240,product_c`enter code here`ode#242,count#832L])
                     +- HiveTableScan [rpt_prd#244,country_code#240,product_code#242], MetastoreRelation gfrrtnsd_standardization, pln_arrg_dim, None, [(country_code#24
0 = HK)]

请协助从火花创建一个蜂巢表。

大多数树节点异常将在接下来的secnario 中发生。

假设您有一个数据帧 df1 并通过应用一些转换创建了一个新的数据帧 df2,而后者将 df1 与 df2 连接会导致最新版本中的树节点异常。

所以解决方案可能是

您必须创建数据帧 df1 并创建与 df1 相同的新数据帧 df2 并在 df2 上应用转换并创建 df3 然后使用 df3 和 df1 进行连接操作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM