https://delta.io logo
j

Jens Waage

09/06/2023, 7:04 AM
Hello! I am using the delta-spark (v.
2.4.0
) and pyspark (v.
3.4.1
) packages to attempt to unit test our Databricks notebooks locally. I ran into a problem where the
DeltaTable.forName()
method throws a
pyspark.errors.exceptions.captured.ParseException
when using a 3-layer-namespace for the
tableOrViewName
parameter. Below is an example error:
Copy code
pyspark.errors.exceptions.captured.ParseException: 
[PARSE_SYNTAX_ERROR] Syntax error at or near '.'.(line 1, pos 21)

== SQL ==
catalog.database.test_table
---------------------^^^
The method works correctly when naming a table using a 2-layer-namespace, i.e.
database.test_table
. Given that 3-layer-namespace support was added to Spark 3.4 and delta-spark 2.4.x should be compatible with Spark 3.4, I expected the
DeltaTable.forName()
method to support this. This thread on the Databricks Community forums also discusses this issue, and the poster mentions that there may be something missing in the delta-core libraries. Is this indeed a bug/missing feature or have I misunderstood something here?