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: 

[Databricks SQL] Commented Escape Character (\) Causes Unexpected Behavior

Graham
New Contributor III

The Problem:

I've observed erratic behavior when I add a comment containing a trailing escape character (\) to a CREATE TABLE statement.

For example, this query returns data (though it shouldn't):

CREATE TABLE example_table
SELECT 1
-- This comment has an escape character: \
WHERE 1 = 0;
 
SELECT * FROM example_table;

Has anyone seen this?

1 ACCEPTED SOLUTION

Accepted Solutions

BilalAslamDbrx
Honored Contributor III
Honored Contributor III

@Graham Carman​ we're tracking this as a defect / issue on our side. For now, please don't include the escape character in comments.

View solution in original post

6 REPLIES 6

JBOCACHICA
New Contributor III

I recommend you to go to your query plan in order to understand what is happening on the background.

Regards

Kaniz_Fatma
Community Manager
Community Manager

Hi @Graham Carman​, We haven’t heard from you on the last response from @John Bocachica​, and I was checking back to see if his suggestions helped you. Or else, If you have any solution, please share it with the community as it can be helpful to others.

BilalAslamDbrx
Honored Contributor III
Honored Contributor III

@Graham Carman​ that's definitely odd, I can reproduce it. I'll follow up on this.

BilalAslamDbrx
Honored Contributor III
Honored Contributor III

@Graham Carman​ we're tracking this as a defect / issue on our side. For now, please don't include the escape character in comments.

Kaniz_Fatma
Community Manager
Community Manager

Hi @Graham Carman​ , We haven't heard from you on the last response from @Bilal Aslam​​, and I was checking back to see if their suggestions helped you. Or else, If you have any solution, please share it with the community as it can be helpful to others.

Also, please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

Hi @Graham Carman​,

Just a friendly follow-up. Did any of the responses help you to resolve your question? if it did, please mark it as best. Otherwise, please let us know if you still need help.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!