OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Allow 1-click option to copy table DDL statement

Open trillhaa opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. Today, users who want to re-create a table need to write down the entire DDL statement to create a table. This can be various tedious activity, especially for tables with many column. Often there are other tables with similar schema from where it would be useful to extract the DDL statement to then modify it and execute it for the new table.

Describe the solution you'd like Provide a one-click option to extract the table DDL statement for a table. Since OM already has the table schema, it has all the information needed.

CREATE TABLE {schemaName}.{tableName} (
    column1 numeric(38,0) NOT NULL ENCODE lzo,
    column2 character varying(765) NOT NULL ENCODE lzo distkey,
    column3 integer NOT NULL ENCODE lzo,
    PRIMARY KEY (column1)
)
DISTSTYLE KEY;

trillhaa avatar May 01 '23 23:05 trillhaa

We should extract the DML for a given table and push it into dataModel and to differentiate between DBT or source we should introduce dataModelProvider

harshach avatar Jul 29 '23 21:07 harshach

@OnkarVO7 lets prioritize for the next release. Asked by our customers as well.

harshach avatar Jan 26 '24 00:01 harshach

i will be working on this

SumanMaharana avatar Apr 08 '24 12:04 SumanMaharana

Handling 10 most used connectors as part of the first iteration:

  • [ ] Mysql
  • [ ] Postgres
  • [ ] Oracle
  • [ ] Redshift
  • [ ] Bigquery
  • [ ] Snowflake
  • [ ] Databricks
  • [ ] Clickhouse
  • [ ] Mssql
  • [ ] Hive

cc: @SumanMaharana

ayush-shah avatar Apr 08 '24 12:04 ayush-shah

UI

  • [x] Include DDL checkbox
  • [x] Table Details Page > DDL tab

ayush-shah avatar Apr 08 '24 13:04 ayush-shah