cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Issue with query editor - auto suggest does not respect the casing of columns in CTE

Ram_Sundar
New Contributor

This behaviour (see image) of auto-suggest in the new editor makes the usage of auto-suggest pretty much useless to me.

I prefer PascalCase for column names in CTEs. Auto-suggest defaults to lowercase.

I need to type out everything. The older version of the editor supported this. 

Is there a workaround?

cte-column-case.png

2 REPLIES 2

Satyasai
New Contributor III

@Ram_Sundar 

Workaround 1: Use Backticks (`) as a Casing Anchor
When you wrap your column name in backticks, the Monaco auto-suggest engine suppresses its default lowercase catalog completion and respects your typed casing:

SQL
WITH ProcessedData AS (
SELECT
id AS `CustomerID`, -- Backticks force editor to honor PascalCase
amount AS `TotalAmount`
FROM main.default.raw_orders
)
SELECT `CustomerID`, `TotalAmount` FROM ProcessedData;
Bonus: Once a column is defined with backticks in your CTE, subsequent references elsewhere in the notebook will auto-suggest in exact PascalCase.

Workaround 2: Disable Automatic "As You Type" Auto-Completion
If auto-suggest routinely overwrites your typed PascalCase with lowercase defaults upon pressing Enter or Space:

Go to Settings (Click your profile icon in the top right corner).

Navigate to Developer (or Developer Settings).

Scroll down to the Code Editor section:

Toggle Enter key accepts autocomplete suggestions to OFF.

(Optional) Toggle Autocomplete as you type to OFF if you prefer invoking suggestions manually only when needed using Ctrl + Space.

data_pulse
New Contributor III

@Ram_Sundar 

+1, 

I am seeing the same behaviour as-well. I tried the available editor settings (Autocomplete as you type, Automatic Genie Code Autocomplete, and the keyword/function casing options) and none of them changes the casing of CTE column suggestions. Can also Disable Auto Complete entirely, but that removes suggestions rather than fixing case.

Declaring the names in an explicit column list e.g. WITH test (ColumnOne, ColumnTwo) AS (...), and backtick-quoting aliases didnโ€™t help either and suggestions still come back lowercase. Tried this at Notebook level too, still the same issue.

data_pulse_0-1792057614028.png

Genie suggested that when the editor's autocomplete reads the CTE's schema, Spark normalizes column names to lowercase internally, so the suggestions appear lowercase regardless of how you alias them.

My understanding is that the legacy editor has been retired as per latest docs, so reverting isnโ€™t an option anymore. I tried developer settings and SQL editor settings, but couldn't find any to revert too.

It looks like it needs a product side change or a setting, so it would be great if someone from Databricks could confirm whether a fix is planned.