pydiverse / pydiverse.pipedag

A data pipeline orchestration library for rapid iterative development with automatic cache invalidation allowing users to focus writing their tasks in pandas, polars, sqlalchemy, ibis, and alike.
https://pydiversepipedag.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
15 stars 2 forks source link

[Fix] Cascade Schema dropping in IBM DB2 #118

Closed mheydel closed 9 months ago

mheydel commented 9 months ago

To drop a schema cascade in IBM DB2, one must first drop all the nicknames. That is not yet implemented.

I think somewhere here, one should adjust that. https://github.com/pydiverse/pydiverse.pipedag/blob/a20dc1f1de8a9070e027c7ece9c3ef4bc12869c1/src/pydiverse/pipedag/backend/table/sql/ddl.py#L569-L574C56

To get the current nicknames in a schema in IBM, one can query:

SELECT TABNAME FROM SYSCAT.TABLES WHERE TABSCHEMA='<schema>' and TYPE="N"

Drop nickname SQL command is as simple as: DROP NICKNAME <schema>.<tbl_name>

mheydel commented 9 months ago

@windiana42 @nicolasmueller

windiana42 commented 9 months ago

@MichalHeydelQC are you trying to use the DDL commands directly, or are you experiencing a failure of pipedag? In case of the latter please describe a bit more about the failure. I agree with you that drop-cascade implementation with this functionality would be nice. But pipedag probably initializes a schema by dropping database specific things before it attempts to execute drop schema.