com.microsoft.sqlserver.jdbc.SQLServerException:“应用”附近的语法不正确

时间:2018-11-15 07:17:55

标签: sql-server azure apache-spark apache-spark-sql databricks

我试图在Azure Data Bricks Notebook中使用交叉应用,但在SQL Server中相同查询正常工作时会抛出错误的语法,即接近Apply的错误.Azure Data Bricks Notebook不支持Apply运算符吗?

enter ## Connection parameters ##
sqlserver = 'servername'
port = '1433'
database = 'dbname'
user = 'username'
pswd = "pwd"
query = "(select * from repair_detail a\
cross apply (select  top 1 * from order c where a.RO_NO=c.RO_NO) b\
     ) AS CustSales"


## Load Data Frame ##
df1 = spark.read \
.option('user', user) \
.option('password', pswd) \
.jdbc('jdbc:sqlserver://' + sqlserver + ':' + port + ';database=' +database, 
 query)

# Show the resulting DataFrame
df1.show()

0 个答案:

没有答案