val BusinessDate = '2019-02-06'
val query = """(SELECT *
|FROM
| v_Account AS a left join v_Customer AS c
| ON c.CustomerID = a.CustomerID AND c.Businessdate = a.Businessdate
|WHERE
| a.Category = 'Deposit' AND
| c.Businessdate= '2019-02-06' AND a.Balance IS NOT NULL AND
| isnull(a.Classification,'N/A') IN ('Contractual Account','Non-Term Deposit','Term Deposit')) tmp """.stripMargin
val responseWithSelectedColumns = spark
.read
.format("jdbc")
.option("url", url)
.option("driver", driver)
.option("dbtable", query)
.load()
print("TOTAL: "+responseWithSelectedColumns.count())
c.Businessdate= '2019-02-06'
,
我希望将BusinessDate作为参数传递,而不是像这样直接传递。
我该怎么做?