0

Hi I'm runnig this SQL statment with Spark 2.4.0 :

val qry = " WITH tab1 as (select nu_operation from schema.table_001 ) select nu_operation from tab1"

and I'm getting

com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'WITH'.

Thanks in advance,

Striped
  • 2,544
  • 3
  • 25
  • 31
Francisco
  • 1
  • 1
  • 1
  • The error is from DB . so, pushdown query that reached db creates this trouble. here is relevant talk i had earlier that explains how spark jdbc read interprets the SQL request we place and other spark jdbc read types that may help. https://stackoverflow.com/questions/55193501/with-clause-in-spark-sql-context-not-supported/55195481#55195481 – Karthick Apr 10 '19 at 18:14

1 Answers1

0

Try this

val qry = " WITH tab1 (nu_operation) as (select nu_operation from schema.table_001 ) select nu_operation from tab1"
Ranga Vure
  • 1,922
  • 3
  • 16
  • 23