Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 12:42 PM
You can first create a variable to extract the value you want. Then you can use python's string formatting to substitute the variable inside the query.
Let's say catalog is the variable name. Then you can perform
command = f"select * from {catalog}.schema.table"
spark.sql(command)