Skip to content

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

Closed
jbylund wants to merge 1 commit into
mainfrom
feat/executor-length
Closed

feat(executor): implement LENGTH [CLAUDE]#4
jbylund wants to merge 1 commit into
mainfrom
feat/executor-length

Conversation

@jbylund

@jbylund jbylund commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Opened against my own fork first for review.

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.
@jbylund

jbylund commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

Superseded — LENGTH landed upstream as tobymao#8145 and is already in this fork's main.

@jbylund jbylund closed this Aug 12, 2026
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.

1 participant