Repository navigation
docs(core): date, comparison and scalar rules as the engine answers them; examples that run - #469
Merged
Merged
Conversation
…w default since 0.24.0 Documents three 0.24.0 behaviours the reference did not carry. A search on which some shards fail answers an error, not the other shards' rows (search: the message and status; scroll: every paging path; the SQL ORDER BY note links both). search_after needs no ORDER BY: it pages on _id, which since 0.24.0 tolerates an Elasticsearch 6 index created without any mapping. ScrollConfig gains failOnWindowError, whose default now fails a statement whose window values cannot be computed. Also carries what the public site states and this reference lacked: the JOIN UNNEST key notes and the 0.24.0 stamp of the GROUP BY key conditions, POINT's argument rules, the Transact-SQL CONVERT order and three cast notes, the watcher refusal of table-qualified columns over several indices, and the GROUP BY refusal of a key formatting a bare date column on Elasticsearch 6. The DDL bullet on a narrowing cast now agrees with the / operator: a division is always a DOUBLE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Known limitations no longer says INSERT, UPDATE, CREATE, DROP and ALTER names cannot be quoted: every statement takes them since the DQL, DML and DDL name rules were unified. The function references stop documenting what the parser rejects. LN, SGN, CURRENT_DATETIME and VERSION() are not functions of this engine, and PI is a constant written without parentheses. An alias that is a reserved word (distance, now, today, current_time, min, as, at, pi) does not parse and is renamed. POINT has no standalone form and is shown inside ST_DISTANCE; a FROM-less SELECT takes no WHERE; a JOIN on a distance, which an ON clause refuses, becomes a filtered count; and GREATEST / LEAST, the trigonometry and the Euclidean-distance examples no longer pass an arithmetic expression as a function argument. The DQL function tables gain the aliases the parser accepts (CEILING, POWER, LCASE, UCASE, LEN, STRPOS, CURDATE, CURTIME) and ISNULL / ISNOTNULL, and the precedence examples print a division as the DOUBLE it is. Every rewritten statement was parsed against the parser of this tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hem; examples that run Measured on Elasticsearch 8.18.3 and 6.8.23 with the engine at main: - A date result over aggregates (MAX(d) + 1, per group or over the whole table) answers its date or timestamp, no longer epoch milliseconds. - A date aggregate compared with a date literal in HAVING keeps the right groups since 0.24.0. - On Elasticsearch 6.8 a date column compared with another date column runs; a boolean literal cast to a number (CAST(TRUE AS INT)) fails to compile there, which Known Limitations and Version Compatibility now say. - A CASE used as an operand is one value; a simple CASE keeps its values' type; NULLIF compares a DATE with a quoted date in either shape. - An undeclared date field reported as TIMESTAMP since 0.24.0. - The HAVING key paragraph states what 0.24.0 changed (refused combinations), and the date aggregate note what 0.23 did (Elasticsearch failed the search). - Mathematical functions: examples the parser refuses (an arithmetic expression as a function argument) and examples Elasticsearch fails (a function result under an arithmetic operator, some functions nested over a column) are rewritten or removed; trigonometric results give the values returned; VERSION() no longer lists inputs and an output type. - Cherry-pick leftovers: a doubled sentence in the quoted identifiers limits, a watcher paragraph that repeated the block below it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fupelaqu
marked this pull request as ready for review
November 19, 2026 10:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The reference pages now say what the engine answers for the date, comparison and scalar rules of
0.24.0, as the next release runs them, and their examples parse and run. Documentation only.
Refs #468 (the site pages follow in a separate change).
Corrections measured on Elasticsearch 8.18.3 and 6.8.23
MAX(d) + 1, per group or over the whole table) answers its date ortimestamp; the page said epoch milliseconds.
HAVING MAX(created) > '2019-01-01'keeps the right groups since 0.24.0; the page said it wasrefused.
date arithmetic of one) runs; the page warned of a 400.
CAST(TRUE AS INT)) fails to compile on Elasticsearch 6.8; aboolean column cast runs. New Known Limitations entry and a Version Compatibility note.
CASEused as an operand is one value; a simpleCASEkeeps its values' type;NULLIFcomparesa
DATEwith a quoted date in either shape; an undeclareddatefield is reportedTIMESTAMPsince 0.24.0.
Reference statements the code no longer supported (two commits from an earlier alignment branch,
rebased on main)
UNION ALL),search_afterand the_idorder onElasticsearch 6,
failOnWindowErrorand its default.LN,SGN,CURRENT_DATETIMEandVERSION()are not functions;PItakes no parentheses; the accepted aliases (CEILING,POWER,LCASE,UCASE,LEN,CURDATE,CURTIME) andISNULL/ISNOTNULLare listed.Mathematical function examples
Every example the parser refuses (an arithmetic expression as a function argument) or that
Elasticsearch fails (a
POWERorROUNDresult under an arithmetic operator, some functions nestedover a column) is rewritten or removed, and the page says so once. Trigonometric results give the
values returned (
COS(RADIANS(60))is0.5000000000000001).Testing
against the parser of main: all parse, except the ones shown as refused.
Recorded, not fixed
BETWEENwith a column as a bound fails before running (Unsupported out type for range query),and a literal plus a column bound fails in Elasticsearch.
STRPOS(col, 'a')fails to compile in Elasticsearch (POSITION('a' IN col)runs); the stringfunction page still lists
STRPOS.POWER/ROUNDresult under an arithmetic operator and some functions nested over a columnfail in Elasticsearch; Known Limitations has no entry for them yet.
ROUND(AVG(price), 2)withGROUP BYandPOWER(16, 0.5)are refused at parse.+andWHERE price > 50 = trueexamples do not parse.keywordbeside alongin an index pattern is described asVARCHAR;DESCRIBEreportsKEYWORD.DATE_FORMATon Elasticsearch 6.8, where it now runs.🤖 Generated with Claude Code