Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spark database is double-quoted when it's not a valid identifier #2576

Open
2 tasks done
julijonas opened this issue Jan 4, 2025 · 0 comments · May be fixed by #2577
Open
2 tasks done

Spark database is double-quoted when it's not a valid identifier #2576

julijonas opened this issue Jan 4, 2025 · 0 comments · May be fixed by #2577
Labels
bug Something isn't working

Comments

@julijonas
Copy link
Contributor

What happens?

When your spark session database is not a valid SQL identifier, it gets double quoted (both by spark and splink) in database_api.splink_data_store and you cannot construct a linker.

`spark_catalog`.``1111``

To Reproduce

You get an error when spark uses a database name with a leading digit:

spark.sql("CREATE DATABASE IF NOT EXISTS `1111`")
spark.sql("USE DATABASE `1111`")
api = SparkAPI(spark_session=spark)
linker = Linker(df, settings, api)
ParseException: 
[PARSE_SYNTAX_ERROR] Syntax error at or near '1111'.(line 1, pos 35)

== SQL ==
show tables from `spark_catalog`.``1111`` like '__splink__input_table_0'

OS:

Mac, Linux

Splink version:

4.0.6

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
@julijonas julijonas added the bug Something isn't working label Jan 4, 2025
@julijonas julijonas linked a pull request Jan 4, 2025 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant