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: 

Got an empty query file when cloning Query file.

kyeongmin_baek
New Contributor II
Hello Community,

In our AWS Databricks environment, we’ve encountered some behavior we don’t understand while performing the following operation.

When we clone a query file that already has content, a new file is created with the same name and “(clone)” added.
The problem is that the content of this cloned file is empty.

Currently, when a job is linked to this query, we receive the following error, which appears to be related:
Query text can not be empty: BAD_REQUEST: Query text can not be empty

We would appreciate it if you could share your thoughts or guidance regarding this issue.

1 ACCEPTED SOLUTION

Accepted Solutions

KaushalVachhani
Databricks Employee
Databricks Employee

Hi @kyeongmin_baek  Just checking in, are you manually saving the original query? If you haven't yet, you might want to open the original query, attach a warehouse, and then click on save. Once you've done that, try cloning it again.

KaushalVachhani_0-1763526662615.png

I followed these steps, and when I cloned it, the process worked perfectly without creating an empty clone. Let me know if that helps!

View solution in original post

4 REPLIES 4

KaushalVachhani
Databricks Employee
Databricks Employee

Hi @kyeongmin_baek  Just checking in, are you manually saving the original query? If you haven't yet, you might want to open the original query, attach a warehouse, and then click on save. Once you've done that, try cloning it again.

KaushalVachhani_0-1763526662615.png

I followed these steps, and when I cloned it, the process worked perfectly without creating an empty clone. Let me know if that helps!

kyeongmin_baek
New Contributor II

Hello @KaushalVachhani ,

Thank you for your response. After checking, I confirmed that what you pointed out was indeed correct.
I had assumed the content was saved (I mistakenly thought Ctrl + S was working), and I didn’t realize there was a separate save button.

I’ve now confirmed that the cloning works properly, and I am running the Jobs again.

Thank you very much for your help!

KaushalVachhani
Databricks Employee
Databricks Employee

Glad to help @kyeongmin_baek !

Raman_Unifeye
Contributor III

@kyeongmin_baek - There is no aut-save or CMD+S for Query as it get saved only once it is attached to a cluster AND 'SAVE' icon is used. However, it still stays in cache as unsaved in that 'query' window but cloning or other file operations may lose it unless saved explicitily.

Driving Business Outcomes with Data Intelligence