Skip to content

feat(executor): implement LENGTH [CLAUDE] - #8145

Merged
georgesittas merged 1 commit into
tobymao:mainfrom
jbylund:feat/executor-length
Aug 12, 2026
Merged

feat(executor): implement LENGTH [CLAUDE]#8145
georgesittas merged 1 commit into
tobymao:mainfrom
jbylund:feat/executor-length

Conversation

@jbylund

@jbylund jbylund commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

LENGTH is absent from the executor's ENV, so any query calling it raises rather than answering:

>>> execute("SELECT length(s) FROM t", tables=t).rows
ExecuteError: Step 'Join: t (...)' failed: name 'LENGTH' is not defined

char_length() parses to the same node, so it was unavailable too.

null_if_any(len) matches Postgres on all three cases — checked against a real PostgreSQL 18:

length('abc') -> 3
length('')    -> 0
length(NULL)  -> NULL

One line, plus a test covering both spellings. Full suite: 1318 tests, OK.

LENGTH was absent from the executor's ENV, so any query calling it raised
`name 'LENGTH' is not defined` rather than answering. char_length() parses to
the same node, so it was unavailable too.

null_if_any(len) matches Postgres on all three cases: 3 for 'abc', 0 for the
empty string, and NULL for NULL.
@georgesittas
georgesittas merged commit 9a8129b into tobymao:main Aug 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants