Hi Akshay,
Thanks for this. I will give it a try. The Java API for .explain returns
void. It doesn't throw any checked exception. so I guess I have to catch
the generic RuntimeException and walk through the stacktrace to see if
there is any ParseException. In short, the code just gets really
Hi Kant,
You can try "explaining" the sql query.
spark.sql(sqlText).explain(true); //the parameter true is to get more
verbose query plan and it is optional.
This is the safest way to validate sql without actually executing/creating
a df/view in spark. It validates syntax as well as schema of
Hi All,
Is there a way to validate the syntax of raw spark SQL query?
for example, I would like to know if there is any isValid API call spark
provides?
val query = "select * from table"if(isValid(query)) {
sparkSession.sql(query) } else {
log.error("Invalid Syntax")}
I tried the