7

I ran spark.read.json(json_file_path) on a json file with a flat structure.

I got the error message:

Reference 'col' is ambiguous, could be: col#29582L, col#29632

It is possible that this is due to another column with a name of different case : Col. How could this be resolved if I cannot modify the json data?

1 Answer 1

15

After referring to the R case of the problem and searching for the configurations.

I found

spark.conf.set("spark.sql.caseSensitive", "true")

from https://databricks.com/blog/2016/08/15/how-to-use-sparksession-in-apache-spark-2-0.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.