Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2019 06:44 AM
you can use widget
1- Create widget
Python
dbutils.widgets.text("y",'3')
or
SQL
CREATE WIDGET TEXT y DEFAULT '3'
2- Access the current value of the widget
Python
dbutils.widgets.get("y")
or
SQL
SELECT * FROM test_table WHERE key=getArgument("y") --key=$y -- The old way of creating widgets in SQL queries with the $<parameter> syntax still works as before
For more information about widgets. please check this link
https://docs.databricks.com/user-guide/notebooks/widgets.html