Repository navigation
[DOC-13905][AI] Correct the nested-access queries on the SQL++ versus SQL page - #4203
Draft
TimLFletcher wants to merge 1 commit into
Draft
TimLFletcher wants to merge 1 commit into
TimLFletcher wants to merge 1 commit into
Conversation
… SQL page Three examples put nested field and array access in the FROM clause and then selected the alias. The access belongs in the projection, with the keyspace in FROM. Also corrected a result key: with an AS alias the field is named by the alias, so firstjob[2] becomes firstjob. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes DOC-13905.
What changed
modules/learn/pages/data/n1ql-versus-sql.adoc, in Data Selection. Three examples put nested access in theFROMclause and selected the alias, which is the inversion of how {sqlpp} works.The third example's result also changes, because the
ASalias names the output field:Sources
FROMSELECT reviews[0] AS x FROM hotel;"The ticket carries a screenshot and a Slack link rather than the corrected text; the pattern above came from that thread.
Beyond the literal example
Two things go slightly past
SELECT reviews[0] AS x FROM hotel, so flagging them:SELECT Status.FullTime FROM HRDataapplies the same correction to dot access rather than array indexing. Same error class, same fix shape, but it is a dot-notation case and the quoted example is an array one.History[0][2]chains two subscripts to keep the example's original meaning, element 2 of the first job. The quoted example indexes once.Both read as correct {sqlpp} to me, but neither is literally what the thread showed. Worth a glance from whoever has the thread.
Noticed, not changed
Data Projection above has
SELECT Name, History, {'FullTime': true} AS 'Status', which single-quotes the alias. That is a different error from the one this ticket reports, so it is left alone.Other branches
release/8.5andrelease/7.6both carry the same page and the same queries. This PR coversrelease/8.0only.Verification
The build renders the page but does not execute the queries.
🤖 Generated with Claude Code