Forum Discussion
Mismatch Between Table Name Case in Lakehouse Explorer and SQL Analytics Endpoint
- 10 months ago
Hello Jher12
I replicated your scenario, I'm also gettign the same. It's due to Spark internally normalizes the tables names to lower case unless you used it in quotes explcitly. Bcz spark handles the table identifers internally. I would recommend you to create the tables with quotes and later you can use Spark SQL to run the table.
I believe this behaviour not only in Microsoft Fabric, it's across all the spark enviuronments.
Please let me know if it helps you.
Thank you!!
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
Thank you suparnababu8, your quick response helped guide me to a solution. I was able to resolve the issue by recreating the tables loading them from another data lakehouse while ensuring the table names retained their original casing by using the code below to create the tables.
Code:
df.write.format("delta").mode("overwrite").save(path)
spark.sql(f"CREATE TABLE `{table_name}` USING DELTA LOCATION '{path}'")
Great Jher12 Thank you!