How to stop Databricks adding quotes to multi-line selections

ChrisHunt
New Contributor III

I'm using a query to generate some YML code from my tables, and running into an annoying behaviour. Here's a simplified example...

Run this query in a notebook or the SQL editor:

SELECT 'foo\nbar'
FROM system.information_schema.tables
LIMIT 10

You get a result that looks like this:

foobar.png

Ten rows, each with foo (new line) bar, as expected from my query. Now select those results, copy them and paste them somewhere, you get this:

"foo
bar"
"foo
bar"
"foo
bar"
"foo
bar"
"foo
bar"
"foo
bar"
"foo
bar"
"foo
bar"
"foo
bar"
"foo
bar"

Databricks has "helpfully" added a set of double quotes to each line. I don't want these. If I had wanted them I would have put them in my original query. Is there any way to switch this behaviour off?