admin管理员组

文章数量:1134247

I came from traditional database development and currently working with databricks. In SQL Server, I can right click to the table or functions then generate the SQL scripts that created these objects for reference. However, I do not see the same functionality when working in the databricks workspace. I know that I can check the table/functions details in the Unity Catalog but it still required me to type in the syntax, parameter details for the SQL script.

Is there any way to automatically generate the SQL scripts that created SQL UDF or delta lake table in databricks workspace?

I came from traditional database development and currently working with databricks. In SQL Server, I can right click to the table or functions then generate the SQL scripts that created these objects for reference. However, I do not see the same functionality when working in the databricks workspace. I know that I can check the table/functions details in the Unity Catalog but it still required me to type in the syntax, parameter details for the SQL script.

Is there any way to automatically generate the SQL scripts that created SQL UDF or delta lake table in databricks workspace?

Share Improve this question edited Jan 8 at 5:28 Dale K 27.1k15 gold badges55 silver badges82 bronze badges asked Jan 8 at 4:39 Ken MastersKen Masters 2811 gold badge8 silver badges19 bronze badges 3
  • what you tried so far add those details and any error you facing? – JayashankarGS Commented Jan 8 at 5:12
  • 2 For tables you can use the SHOW CREATE TABLE <table_name> command. – Anupam Chand Commented Jan 8 at 6:57
  • Okay, I can get the SQL script with SHOW CREATE TABLE for table creation. However, it seems like SHOW CREATE FUNCTION does not work in this case – Ken Masters Commented Jan 8 at 16:45
Add a comment  | 

1 Answer 1

Reset to default 1

You can use the below command to check the create statement -

show create table databasename.tablename

To check the table columns and its datatypes -

describe databasename.tablename

本文标签: