- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 08:01 AM
Hi all,
i am using below to code to query table but query returns rows having column names as values
spark.read
.format("jdbc")
.option("url", "jdbc:databricks://acme.cloud.databricks.com:443/myschema;transportMode=http;ssl=1;httpPath=<httppath>;AuthMech=3;UID=token;PWD=<token>;")
.option("dbtable", "mytable")
.load().show()
+---+---------+
|key|value|
+---+---------+
|key|value|
|key|value|
|key|value|
|key|value|
jdbc driver version is 2.6.36
note that odbc driver works but i dont support struct, map, array as column names .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 09:25 AM
any idea what causing this? please note that above query i am running from standalone spark application also when i run above in databricks notebook i see expected result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 06:41 PM
This seems to be issue with spark and was able to fix issue by following posts
https://stackoverflow.com/questions/47020379/bigquery-simba-jdbc-error-with-spark
fix is to update function in JdbcDialects.scala
def quoteIdentifier(colName: String): String = {
colName
}