sparkmagic icon indicating copy to clipboard operation
sparkmagic copied to clipboard

parameterized %%sql queries

Open harschware opened this issue 7 years ago • 1 comments

I'm curious how I can dynamically craft the SQL query given to %%sql. e.g. in pseudo.. SELECT * FROM ${db}.${table}

A similar question would be passing parameterized values from the local context to the query. e.g. in pseudo...

%sql -p1 "The Cranberries"
SELECT artist, count(*) AS num_concerts 
FROM concerts
WHERE artist = ? 
GROUP BY artist

If it is not implemented yet, what would be the complexity?

harschware avatar Feb 13 '18 21:02 harschware

Agree, it'd be very usefull to have this parametrization

Volodymyr128 avatar Jul 07 '21 20:07 Volodymyr128