Forum Discussion
Mismatch Between Table Name Case in Lakehouse Explorer and SQL Analytics Endpoint
- 9 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!
Hi,
Thank you for the response. Is there any way to rename the tables without dropping and recreating them with quotes?
I don't think there is chance!! But, don;t drop your existing table create dummy table and try it once.
Thank you!!
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Jher129 months agoFrequent Visitor
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:spark.conf.set('spark.sql.caseSensitive', True)df.write.format("delta").mode("overwrite").save(path)
spark.sql(f"CREATE TABLE `{table_name}` USING DELTA LOCATION '{path}'")- suparnababu89 months ago
Super User
Great Jher12 Thank you!