sqlmesh icon indicating copy to clipboard operation
sqlmesh copied to clipboard

Can not parse Trino-specific sql

Open Sinter01 opened this issue 9 months ago • 2 comments

Sqlmesh can not parse part of trino-specific SQL dialect (probably SQLGlot related):

MODEL (
  name stage.test,
  kind FULL,
  cron '@daily',
  start '2026-01-01',
);

SELECT
    jt.val
FROM (SELECT '{"a": [1,2,3]}' as data) AS s
CROSS JOIN JSON_TABLE(
    s.data,
    'strict $' COLUMNS (
        val VARCHAR FORMAT JSON PATH 'strict $.a'
    )
) AS jt;
Error: Failed to load model from file 'model_name.sql':

  Expecting ). Line 18, Col: 26.
    ,3]}' as data) AS s
  CROSS JOIN JSON_TABLE(
      s.data,
      'strict $' COLUMNS (
          val VARCHAR FORMAT JSON PATH 'strict $.a'
      )

Trino version :476 sqlmesh version: 0.228.5

Sinter01 avatar Feb 10 '26 13:02 Sinter01

@Sinter01 is this still an issue with a newer sqlmesh version? I think we upgraded Sqlglot recently

yuki-kakegawa avatar May 31 '26 22:05 yuki-kakegawa

@Sinter01 feel free to open again if still an issue.

mday-io avatar Jun 12 '26 14:06 mday-io