斯卡拉错误:未发现:价值spark_partition_id

问题描述 投票:-1回答:1

spark-shell,我是不是有这个问题(1号线),当我叫2号线。

Line1: not found: value spark_partition_id
Line2: val countPerCustomPartition = businessesDataFrameCustomPartition.groupBy(spark_partition_id).count

然后,当我打电话spark-submit,我得到了这个问题。我没有在计算器上看到了这一点之前,它结束了一个简单的,但并不明显修复。

  • 2.11.8规模
  • 星火2.3.2
scala apache-spark
1个回答
1
投票

该行添加到您的斯卡拉类的顶部:

import org.apache.spark.sql.functions.spark_partition_id
© www.soinside.com 2019 - 2024. All rights reserved.