Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User does not have privileges for ALTERTABLE_ADDCOLS while using spark.sql to read the data

Select query in spark.sql is resulting in the following error:

User *username* does not have privileges for ALTERTABLE_ADDCOLS

Spark version - 2.1.0

Trying to execute the following query:

dig = spark.sql("""select col1, col2 from dbname.tablename""")
like image 247
ComputerVisionEngineer Avatar asked Aug 31 '25 18:08

ComputerVisionEngineer


1 Answers

It's caused by the spark.sql.hive.caseSensitiveInferenceMode propertie. By default, spark tries to infer the table's schema and then change its properties.

To avoid these messages you can alter the default configuration to INFER_ONLY. Considering a spark session named spark, the code below should work:

spark.conf.set("spark.sql.hive.caseSensitiveInferenceMode", "INFER_ONLY")
like image 159
Uriel Calvi Avatar answered Sep 07 '25 14:09

Uriel Calvi