Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2021 08:24 PM
1 ACCEPTED SOLUTION
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2021 02:20 PM
You can use the extended table description. For example, the following python code will print the current definition of the view:
table_name = ""
df = spark.sql("describe table extended {}".format(table_name))
df.createOrReplaceTempView("view_desription")
data = spark.sql(
"""
select data_type
from view_desription
where col_name = 'View Text'
"""
).collect()[0][0]
print(data)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2021 02:20 PM
You can use the extended table description. For example, the following python code will print the current definition of the view:
table_name = ""
df = spark.sql("describe table extended {}".format(table_name))
df.createOrReplaceTempView("view_desription")
data = spark.sql(
"""
select data_type
from view_desription
where col_name = 'View Text'
"""
).collect()[0][0]
print(data)

