Skip to content

SCD_TYPE_2_BY_TIME fails on Redshift #5787

@cscetbon

Description

@cscetbon

I'm using something as simple as

MODEL (
  name sqlmesh_xxx.my_example,
  kind SCD_TYPE_2_BY_TIME (
    unique_key id,
  )
);

SELECT
  id,
  updated_at,
  trashed_at
FROM my_table;

and it fails with

Failed models

  "prod"."sqlmesh_xxx"."my_example"

    ProgrammingError:
      {'S': 'ERROR', 'C': '42601', 'M': 'syntax error at end of input', 'P': '142', 'F': '/opt/brazil-pkg-cache/packages/RedshiftPADB/RedshiftPADB-1.0.180974.0/AL2_x86_64/generic-flavor/src/src/pg/src/backend/parser/parser_scan.l', 'L':
'892', 'R': 'yyerror'}

Error: Plan application failed.

my_table has been created using some DDL as simple as

CREATE TABLE IF NOT EXISTS my_example
(
	id VARCHAR(36) NOT NULL  ENCODE RAW
	,updated_at TIMESTAMP WITHOUT TIME ZONE   ENCODE az64
	,trashed_at TIMESTAMP WITHOUT TIME ZONE   ENCODE az64
	,PRIMARY KEY (id)
)

I've done something similar in duckdb and I don't get any issue. Also I wasn't getting any issue when I was using SCD_TYPE_2_BY_COLUMN IIRC.

I use version 0.230.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingEngine: RedshiftIssues related to Redshift

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions