Zeppelin Dynamic Form Drop Down value in SQL

拥有回忆 提交于 2019-12-04 12:44:22

This is completely possible and here is an example with both %spark and %sql interpreters :

cell 1:

val df = Seq((1,2,"A"),(3,4,"B"),(3,2,"B")).toDF("x","y","item")
df.registerTempTable("table_name")
val instrument = z.select("Select Item", Seq(("A", "1"),("B", "2"),("C", "3")))

cell 2:

z.show(df.filter($"item"===instrument))

alternative solution using %sql :

%sql select * from table_name where item="${item=A,A|B|C}" 

PS: instrument is set on B,2

The other answers haven't really addressed the issue, the syntax you are looking for is:

where item = "${Select Item=,1(A)|2(B)|3(C)}"

Cheers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!