{"record":{"id":"8becb15a75de529f","repo":"pathwaycom/pathway","slug":"node-sql-not-supported","errorCode":null,"errorMessage":"{node.sql()} not supported.","messagePattern":"(.+?) not supported\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/sql/processing.py","lineNumber":43,"sourceCode":"    contains_reducers: bool\n\n    def __init__(self):\n        self.contains_reducers = False\n\n    def eval_reducer(\n        self, expression: expr.ReducerExpression, **kwargs\n    ) -> expr.ReducerExpression:\n        self.contains_reducers = True\n        return super().eval_reducer(expression, **kwargs)\n\n\n_expression_handlers: dict[type[sql_expr.Expression], Callable] = {}\n\n\ndef _run(node: sql_expr.Expression, context: ContextType) -> Any:\n    handler = _expression_handlers.get(type(node))\n    if handler is None:\n        raise NotImplementedError(f\"{node.sql()} not supported.\")\n    return handler(node, context)\n\n\ndef register(nodetype):\n    def wrapper(func):\n        def inner(node, context):\n            assert isinstance(node, nodetype), nodetype\n            return func(node, context)\n\n        _expression_handlers[nodetype] = inner\n        return inner\n\n    return wrapper\n\n\n@register(nodetype=sql_expr.If)\ndef _if(\n    node: sql_expr.If, context: ContextType","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/sql/processing.py#L25-L61","documentation":"Pathway implements SQL by walking the sqlglot expression tree and dispatching each node type to a registered handler (_expression_handlers). NotImplementedError('{node.sql()} not supported.') means the parsed query contains an expression type for which no handler is registered — i.e. the construct is outside Pathway's supported SQL subset, even though sqlglot can parse it.","triggerScenarios":"Calling pw.sql() with constructs Pathway has not implemented: exotic window functions, certain literals/JSON operators, specific date/time functions, or dialect-specific syntax that parses to an unhandled sqlglot node.","commonSituations":"Porting a query from another engine (Postgres/Spark/Snowflake) that uses functions Pathway's SQL layer doesn't cover yet; upgrading sqlglot, which may parse previously-failing syntax into new node types Pathway doesn't handle.","solutions":["Read the printed node SQL (node.sql()) to identify the unsupported construct","Rewrite that part of the query using Pathway's native column expressions (table.select/derive) and keep pw.sql for the rest","Check the Pathway SQL coverage docs/changelog for supported syntax and pin a known-good sqlglot version if an upgrade introduced the issue"],"exampleFix":"-- before\nSELECT date_trunc('week', ts) FROM t;  -- if unhandled -> NotImplementedError\n\n# after: express unsupported part natively\nimport pathway as pw\nt = pw.sql(\"SELECT ts FROM t\")\nout = t.select(week=pw.this.ts.dt_truncate(\"W\"))","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    tab = pw.sql(query)\nexcept NotImplementedError:\n    tab = native_pathway_equivalent(t)  # pre-written native expression version","preventionTips":["Keep queries within Pathway's documented SQL subset","Wrap pw.sql calls so unsupported constructs fall back to native Pathway expressions"],"tags":["sql","pathway","not-implemented"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}