{"record":{"id":"30cafc4b9e2a4281","repo":"pathwaycom/pathway","slug":"key-repr-not-supported","errorCode":null,"errorMessage":"{key}: {repr} not supported.","messagePattern":"(.+?): (.+?) not supported\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/sql/processing.py","lineNumber":649,"sourceCode":") -> tuple[table.Table, ContextType]:\n    if (alias_field := node.args.pop(\"alias\", None)) is not None:\n        alias = _run(alias_field, context)\n        assert isinstance(alias, str)\n        context = context.copy()\n        tab = tab.copy()\n        context[alias] = tab\n    return tab, context\n\n\ndef _check_work_done(node: sql_expr.Expression) -> None:\n    for key, obj in node.args.items():\n        if obj is None:\n            continue\n        try:\n            repr = obj.sql()\n        except AttributeError:\n            repr = str(obj)\n        raise NotImplementedError(f\"{key}: {repr} not supported.\")\n","sourceCodeStart":631,"sourceCodeEnd":650,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/sql/processing.py#L631-L650","documentation":"Every handler in Pathway's SQL translator pops the args it understands from the sqlglot node; before returning, _check_work_done scans node.args for anything left over. Any non-None remaining arg causes NotImplementedError('{key}: {repr} not supported.') naming the unhandled clause. It is Pathway's safety net for query clauses it parses but does not translate.","triggerScenarios":"pw.sql with clauses the specific handler doesn't consume: e.g. ORDER BY in contexts Pathway ignores, WITH (CTE) attachments on particular nodes, HAVING in unsupported positions, FETCH/ OFFSET variants, hints, or dialect-specific qualifiers on a sub-node.","commonSituations":"Complex analytical SQL ported from another engine; sqlglot version changes that move a clause into an arg position Pathway's handler doesn't pop; queries that parse fine but use a corner-of-the-grammar feature.","solutions":["Use the {key} in the message to identify which clause is unhandled, and remove or rewrite that clause","Split the query: run the supported part in pw.sql and do ordering/limiting/reshaping with Pathway native operations","Check the Pathway SQL docs for supported clauses; if a sqlglot upgrade shifted parsing, pin the version Pathway was tested with"],"exampleFix":"-- before (ORDER BY left unconsumed in this position)\nSELECT k FROM t UNION SELECT k FROM u ORDER BY k;\n\n# after: sort outside SQL\nimport pathway as pw\nt = pw.sql(\"SELECT k FROM t UNION SELECT k FROM u\")\nsorted_t = t.sort(pw.this.k)","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    tab = pw.sql(query)\nexcept NotImplementedError as e:\n    logUnsupportedClause(str(e))  # record which {key} clause failed, feed back to query author\n    raise","preventionTips":["Keep SQL minimal: select/from/where/group-by/join only","Move ordering, limits, and exotic clauses into native Pathway operations"],"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"}