[使用JDBC的SQL数据库+参数化SQL查询+数据块

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

在Databricks中,将SQL表读取为

val TransformationRules = spark.read.jdbc(jdbcUrl, "ADF.TransformationRules", connectionProperties)
.select("RuleCode","SourceSystem","PrimaryTable", "PrimaryColumn", "SecondaryColumn", "NewColumnName","CurrentFlag")
.where("SourceSystem = 'QWDS' AND RuleCode = 'STD00003' ")

如何在SourceSystem子句中参数化RuleCodeWhere

指:https://docs.microsoft.com/en-us/azure/databricks/data/data-sources/sql-databases

python sql scala jdbc databricks
1个回答
0
投票

据我所知,您想在where子句字符串中插入值?也许下面的解决方案可以为您工作:

© www.soinside.com 2019 - 2024. All rights reserved.