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:ย 

How to write same code in different locations in the DB notebook?

kodvakare
New Contributor III

The old version of the notebook had this feature, where you could Ctrl+click on different positions in a notebook cell to bring the cursor there, and type to update the code in both the positions like in JupyterLab. The newer version is awesome but seems to lack this feature.

Is there any alternative way to do this?

  1. Old Databricks version, where you could simultaneously update the code in multiple positions like a Jupyter notebookOld DataBricks version, update in multiple positions like Jupyter IDE
  2. New Databricks version, can only update at a single position at once

imageThanks

1 ACCEPTED SOLUTION

Accepted Solutions

UmaMahesh1
Honored Contributor III

Hi @Ashwath Kodvakareโ€‹ 

Apologies for my previous answer. I was a bit slow in using out the experimental features...lol.

As for your issue, it is happening because you are using an experimental feature where databricks is trying to use Monaco editor, which is the same as VS code.

In this editor, instead of Ctrl+click, you have to use Alt key and click in each location to achieve what you are trying to do.

Do read the documentation for more help.

https://docs.databricks.com/notebooks/notebook-editor.html

Hope this helps. Also please don't forget to mark this as an answer if you found what you are expecting.

Cheers..

Uma Mahesh D

View solution in original post

5 REPLIES 5

UmaMahesh1
Honored Contributor III

Hi @Ashwath Kodvakareโ€‹ 

I guess that is not dependent on the DBR versions.

However, using all the versions available till now, I'm still able to do a multi line select.

imageBut I'm still a bit interested in why you are facing this issue. Can you please paste the entire databricks window snapshot along with the cluster configuration you are using ?

Seeing the strings in brown color is what I want to verify once. Also verify if you are able to do a multi line select in some other application.

Do let me know the above status..

Cheers...

Uma Mahesh D

UmaMahesh1
Honored Contributor III

Hi @Ashwath Kodvakareโ€‹ 

Apologies for my previous answer. I was a bit slow in using out the experimental features...lol.

As for your issue, it is happening because you are using an experimental feature where databricks is trying to use Monaco editor, which is the same as VS code.

In this editor, instead of Ctrl+click, you have to use Alt key and click in each location to achieve what you are trying to do.

Do read the documentation for more help.

https://docs.databricks.com/notebooks/notebook-editor.html

Hope this helps. Also please don't forget to mark this as an answer if you found what you are expecting.

Cheers..

Uma Mahesh D

kodvakare
New Contributor III

Hi, @Uma Maheswara Rao Desulaโ€‹,

Thank you for the reply.

Alt + Click worked with the new editor. I will surely check out the Monaco editor.

SS2
Valued Contributor

I was looking for the same.. great thqโ€‹

SS2
Valued Contributor

Alt+click is working fine โ€‹

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group