您可以使用擴展表描述。例如,下麵的python代碼將打印當前視圖的定義:
table_name =“df =火花。sql(“描述表擴展{}”.format (table_name)) df.createOrReplaceTempView (“view_desription”)數據=火花。sql(" " "選擇data_type從view_desription col_name =視圖文本”" ").collect()[0][0]打印(數據)
您可以使用擴展表描述。例如,下麵的python代碼將打印當前視圖的定義:
table_name =“df =火花。sql(“描述表擴展{}”.format (table_name)) df.createOrReplaceTempView (“view_desription”)數據=火花。sql(" " "選擇data_type從view_desription col_name =視圖文本”" ").collect()[0][0]打印(數據)