6

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?

hangc
  • 4,730
  • 10
  • 33
  • 66

1 Answers1

14

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

Community
  • 1
  • 1
hangc
  • 4,730
  • 10
  • 33
  • 66