{"record":{"id":"3b1c87b1243d4d4c","repo":"hasura/graphql-engine","slug":"unsupported-path-on-comparisoncolumn-path","errorCode":null,"errorMessage":"Unsupported path on ComparisonColumn: ${[...path, selector].join('.')}","messagePattern":"Unsupported path on ComparisonColumn: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"dc-agents/sqlite/src/query.ts","lineNumber":336,"sourceCode":"      `${sourceTablePrefix}${escapeIdentifier(sourceColumnName)} = ${targetTableAlias}.${escapeIdentifier(targetColumnName as string)}`,\n  );\n}\n\nfunction generateComparisonColumnFragment(\n  comparisonColumn: ComparisonColumn,\n  queryTableAlias: string,\n  currentTableAlias: string,\n): string {\n  const path = comparisonColumn.path ?? [];\n  const queryTablePrefix = queryTableAlias ? `${queryTableAlias}.` : '';\n  const currentTablePrefix = currentTableAlias ? `${currentTableAlias}.` : '';\n  const selector = getColumnSelector(comparisonColumn.name);\n  if (path.length === 0) {\n    return `${currentTablePrefix}${escapeIdentifier(selector)}`;\n  } else if (path.length === 1 && path[0] === '$') {\n    return `${queryTablePrefix}${escapeIdentifier(selector)}`;\n  } else {\n    throw new Error(\n      `Unsupported path on ComparisonColumn: ${[...path, selector].join('.')}`,\n    );\n  }\n}\n\nfunction generateComparisonValueFragment(\n  comparisonValue: ComparisonValue,\n  queryTableAlias: string,\n  currentTableAlias: string,\n): string {\n  switch (comparisonValue.type) {\n    case 'column':\n      return generateComparisonColumnFragment(\n        comparisonValue.column,\n        queryTableAlias,\n        currentTableAlias,\n      );\n    case 'scalar':","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/dc-agents/sqlite/src/query.ts#L318-L354","documentation":"generateComparisonColumnFragment builds the SQL expression for a ComparisonColumn in a filter. Only two path shapes are allowed: an empty path (column on the current table) or the single-element path `['$']` (column on the query's root table). Any other path — e.g. `['someRelation']` or `['a','b']` — is not supported and throws with the offending joined path.","triggerScenarios":"Sending a where/expression tree where a ComparisonColumn's `path` refers to relationships or nested paths, e.g. `{ type: 'column', path: ['artist'], name: 'name' }`, which this engine cannot resolve to a join prefix.","commonSituations":"Clients used to engines with path-based comparisons across relationships (Postgres/Hasura style `path` in expressions); converting filters from another connector; deeper nesting introduced by newer query API versions.","solutions":["Drop relationship paths from comparisons; filter only on columns of the queried table (`path: []`) or the root table (`path: ['$']`)","Rewrite relationship-based filters as separate relationship queries with their own filter","If you need cross-table filtering, use an interpolated target with a CTE that pre-joins the tables"],"exampleFix":"// before\n{ type: 'column', path: ['artist'], name: 'name', operand: ... }\n// after\n{ type: 'column', path: [], name: 'artist_name', operand: ... }","handlingStrategy":"validation","validationCode":"const okPath = (p: unknown[]) => p.length === 0 || (p.length === 1 && p[0] === '$'); if (!okPath(comp.path ?? [])) throw new Error('Only empty or [\"$\"] paths supported');","typeGuard":"const isSupportedComparisonPath = (p: unknown): p is [] | ['$'] => Array.isArray(p) && (p.length === 0 || (p.length === 1 && p[0] === '$'));","tryCatchPattern":null,"preventionTips":["Filter only on columns of the queried or root table","Push relationship-based filtering into nested relationship queries instead of paths"],"tags":["sqlite","filter","expression","path","query-builder"],"backgroundTag":"unsupported-filter-path","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}