为什么Scala加入超时?

时间:2018-07-02 18:26:42

标签: scala apache-spark apache-spark-sql

我正在尝试将表连接到自身。我正在获取一个表的行,然后,在第二个请求下,再次获取行(因此它们可能是或不是同一行),并将它们中的每一个限制为10行。我可以显示每个结果集,但是当我加入它们时,Scala只是挂起然后超时。可能是什么问题?

override def joinMe(): Unit = {
val conf: Config = ConfigFactory.load()

val options = SparkOptions.createOptions(conf.getString("dashDb.driver"),
  conf.getString("dashDb.url"),
  conf.getString("dashDb.username"),
  conf.getString("dashDb.password"),
  "1000",
  conf.getString("dashDb.dbTable")
)
val sourceDF = JdbcRepository.read(options).limit(10)

sourceDF.show()

val targetDF = sourceDF

targetDF.show()

sourceDF.join(
  targetDF,
  sourceDF("EMPLOYEE_CNUM_ID") === targetDF("EMPLOYEE_CNUM_ID")
).show(10)
}

但我收到此错误:

Exception in thread "main" java.util.concurrent.TimeoutException: Futures timed out after [300 seconds]

感谢您的时间!

0 个答案:

没有答案
相关问题