Details
-
Bug
-
Resolution: Done
-
Major
-
5.5.0
-
Untriaged
-
Unknown
-
CX Sprint 98, CX Sprint 99, CX Sprint 100
Description
j1. In Query 3's text: "... all of the matching user/message data ..." should instead say "... all of the matching beer/brewery data ..." (!!).
2. In Query 7 there is a stray semi-colon on the second-to-last line of the query that results in a syntax error.
3. Query 9 uses syntactic shorthand that is no longer supported - so it actually results in a semantic error message rather than running now.:
[{
|
"code": 1,
|
"msg": "Cannot resolve ambiguous alias reference for undefined identifier num_beers in [#1, $brewery_id]",
|
"query_from_user": "SELECT br.brewery_id, COUNT(*) AS num_beers\nFROM beers br\nGROUP BY br.brewery_id\nHAVING num_beers > 30\nORDER BY num_beers DESC;"
|
}]
|
A possible corrected version to offer would be:
SELECT br.brewery_id, COUNT(*) AS num_beers
|
FROM beers br
|
GROUP BY br.brewery_id
|
HAVING COUNT(*) > 30
|
ORDER BY num_beers DESC;
|
(Or we could use a LET statement to define num_beers instead.)
4. It might be nice to update the little indexing section to instruct the user to EXPLAIN the plan, look at the plan, add the index, and re-EXPLAIN to see the difference?
BTW, while I was going through all of this, the part that illustrates shadowing by doing a N1QL update got me into a weird state for a little while - for some reason, my system was in a state where the change didn't propagate. Later it self-resolved (while I took a break to give a talk in a meeting) - so it "works again" - but it was mysterious and disconcerting for a little while there...
Attachments
Issue Links
For Gerrit Dashboard: MB-28954 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
92320,6 | MB-28954, MB-28953: Fixes for introductory docs | vulcan | asterix-opt | Status: MERGED | +2 | +1 |
92341,1 | MB-28954: Fixes for beer-tutorial | master | asterix-opt | Status: ABANDONED | 0 | 0 |