Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 02:18 AM
dbutils.widgets.text('table', 'product')
%sql
select *
from ds_data.$tableHello, the above will work.
But how can I do something like:
dbutils.widgets.text('table', 'product')
%sql
select *
from ds_data.$table_v3in that example, $table is still my table name, and I want to add a suffix.
I could go in python
dbutils.widgets.text('table', 'product')
tab = dbutils.widgets.get('table')
spark.sql(f'select * from ds_data.{tab}_v3')but would love doing it in SQL.
Any idea?
thanks!