Working with column names that contain spaces in Databricks Delta tables requires a specific workaround. The process involves four steps: creating a Delta table with standard column names, upgrading the Delta protocol version to 2.5 by enabling column mapping mode (setting delta.columnMapping.mode to 'name' and adjusting minReaderVersion/minWriterVersion), renaming columns using backtick notation to include spaces, and querying those columns using backtick notation. Important caveats include that protocol version upgrades are irreversible, the feature is experimental, and enabling column mapping can break Hive-style partitioning, change data feed operations, and Delta table streaming reads.
Table of contents
A Step-by-Step Guide to Creating Delta Tables with Spaces in Column NamesGet Kuharan Bhowmik ’s stories in your inboxbookish-garbanzo/Create Delta tables with Space in Column names.py at main ·…51 Impressions