spark-redshift icon indicating copy to clipboard operation
spark-redshift copied to clipboard

TableName assumes PUBLIC schema when no schema is set

Open emmanueljob opened this issue 9 years ago • 6 comments

https://github.com/databricks/spark-redshift/blob/master/src/main/scala/com/databricks/spark/redshift/TableName.scala#L42

Shouldn't this follow the rules of Redshift and respect the search_path of the logged in user:

http://docs.aws.amazon.com/redshift/latest/dg/r_search_path.html

emmanueljob avatar Nov 11 '16 23:11 emmanueljob

Good catch. If I'm reading the linked documentation correctly, it sounds like the right fix is to pass through non-schema-qualified table names as-is without assuming PUBLIC.

Which version of spark-redshift are you using / against which releases should I target a patch?

JoshRosen avatar Nov 11 '16 23:11 JoshRosen

Ping @emmanueljob, would be great to know in which maintenance branches you would like this fixed.

JoshRosen avatar Dec 09 '16 16:12 JoshRosen

I have no specific urgent need, we can work around the issue for now. If it's in whatever your next release is whenever that is we'll take advantage of it.

emmanueljob avatar Dec 16 '16 22:12 emmanueljob

@JoshRosen any chance this can be patched up in v2.0.1.

sboora avatar Jan 24 '17 19:01 sboora

I am taking a stab at this here, https://github.com/databricks/spark-redshift/pull/324

sboora avatar Jan 24 '17 21:01 sboora

We're also running into the same bug, working around it by explicitly specifying the schema name. It'll be reasonable to default to search_path if no schema is set.

venkatvb avatar May 01 '24 19:05 venkatvb