My below code does not work with Spark-submit.
sqlContext.sql(s"""
create external table if not exists landing (
date string,
referrer string)
partitioned by (partnerid string,dt string)
row format delimited fields terminated by '\t' lines terminated by '\n'
STORED AS TEXTFILE LOCATION 's3n://....'
""")
It gives error: Exception in thread "main" java.lang.RuntimeException: [1.2] failure: ``with'' expected but identifier create found
This code works in Spark-shell but not in Spark-submit. What can be the reason?
"sqlContext" in spark-shell is 'HiveContext' by default. Maybe you need to new a HiveContext instead of sqlContext in your script.
You may new it like that:
import SparkContext._
import org.apache.spark.sql.hive._
val sc = new SparkContext()
val sqlContext = new HiveContext(sc)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With