Skip to content

Missing Redshift constructs #2408

Description

@ramnes

RedshiftSqlDialect on version 0.62.0 fails to parse a few core Redshift statements that the real engine accepts (tested on Redshift 1.0.347559):

-- 1. APPROXIMATE COUNT(DISTINCT)
SELECT APPROXIMATE COUNT(DISTINCT id) FROM t;
-- Expected: end of statement, found: (

-- 2. Column-level ENCODE in CREATE TABLE
CREATE TABLE t (id INT ENCODE az64, name VARCHAR(20) ENCODE lzo);
-- Expected: ',' or ')' after column definition, found: ENCODE

-- 3. CREATE EXTERNAL SCHEMA (Spectrum)
CREATE EXTERNAL SCHEMA s FROM DATA CATALOG DATABASE 'db' IAM_ROLE 'arn:...';
-- Expected: TABLE, found: SCHEMA

Each is documented, common Redshift syntax:

  • APPROXIMATE COUNT(DISTINCT ...): HyperLogLog cardinality (docs)
  • column-level compression ENCODE <encoding> in CREATE TABLE (docs)
  • CREATE EXTERNAL SCHEMA ... FROM DATA CATALOG: Redshift Spectrum (docs)

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