dbutils.notebook.run无法用于映射参数

时间:2019-06-12 04:15:39

标签: scala databricks

假设我有2个笔记本,其中第一个是主要笔记本,第二个用于测试。

主要,我有以下

dbutils.notebook.run("testing", timeoutSeconds = 60, arguments = Map("var" -> "1234"))

在测试中:

%scala
println(s"Donut price = $var")

然后在Main中运行笔记本。有错误:

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以将参数传递给DataImportNotebook,并根据DataImportNotebook的结果运行不同的笔记本(DataCleaningNotebook或ErrorHandlingNotebook)。

  

val status = dbutils.notebook.run(“ DataImportNotebook”,timeoutSeconds   = 60,参数= Map(“ x”->“ 1234”))

     

println(“状态:” +状态)

enter image description here

在scala中,变量声明如下:

以下是值定义的示例:

  

var $ price = 1234
  println(“甜甜圈价格:” + $ price)

enter image description here

有关更多详细信息,请参阅“ Scala - How to declare variables”和“ Databricks - Notebook workflows”。

希望这会有所帮助。