Skip to content

MERGE job: psycopg2.errors.UndefinedTable: Relation '"testdrive".d' unknown #6

Description

@amotl

Problem

Originating at dlt's SqlJobClientBase. _create_merge_followup_jobs and descendants, the usual merge job emits an SQL statement which fails on CrateDB.

RelationUnknown[Relation 'schema.table' unknown]

Details

We probed two different dialects.

PostgreSQL dialect

DELETE
FROM "testdrive"."exchange_latest" AS d
WHERE EXISTS
    (SELECT 1
     FROM "testdrive_staging"."exchange_latest" AS s
     WHERE d."date" = s."date"
       AND d."currency_code" = s."currency_code"
       AND d."base_currency" = s."base_currency");
RelationUnknown[Relation 'doc.d' unknown]

Redshift dialect

DELETE
FROM "testdrive"."exchange_latest"
WHERE EXISTS
    (SELECT 1
     FROM "testdrive_staging"."exchange_latest"
     WHERE "testdrive"."exchange_latest"."date" = "testdrive_staging"."exchange_latest"."date"
       AND "testdrive"."exchange_latest"."currency_code" = "testdrive_staging"."exchange_latest"."currency_code"
       AND "testdrive"."exchange_latest"."base_currency" = "testdrive_staging"."exchange_latest"."base_currency");
RelationUnknown[Relation 'testdrive.exchange_latest' unknown]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions