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)
RedshiftSqlDialecton version 0.62.0 fails to parse a few core Redshift statements that the real engine accepts (tested on Redshift 1.0.347559):Each is documented, common Redshift syntax:
APPROXIMATE COUNT(DISTINCT ...): HyperLogLog cardinality (docs)ENCODE <encoding>inCREATE TABLE(docs)CREATE EXTERNAL SCHEMA ... FROM DATA CATALOG: Redshift Spectrum (docs)