Hussain Towaileb has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/3095

Change subject: [ASTERIXDB-2498][DOC] List slice documentation for SQL++
......................................................................

[ASTERIXDB-2498][DOC] List slice documentation for SQL++

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Added list slice syntax documentation.

Change-Id: Iff9bb0e82f31cefcdd19ace0d02fc07e7d00025f
---
M asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
1 file changed, 20 insertions(+), 13 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/95/3095/1

diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md 
b/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
index 41cf1d8..8422531 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
@@ -208,21 +208,24 @@
 
     PathExpression  ::= PrimaryExpression ( Field | Index )*
     Field           ::= "." Identifier
-    Index           ::= "[" Expression "]"
+    Index           ::= "[" Expression (":" ( Expression )? )? "]"
 
-Components of complex types in the data model are accessed via path 
expressions.
-Path access can be applied to the result of a query expression that yields an 
instance of a complex type, for example, a
-object or array instance.
-For objects, path access is based on field names.
-For arrays, path access is based on (zero-based) array-style indexing.
-Attempts to access non-existent fields or out-of-bound array elements produce 
the special value `MISSING`.
-For multisets path access is also zero-based and returns an arbitrary multiset 
element if the index is within the size
-of the multiset or `MISSING` otherwise.
-Type errors will be raised for inappropriate use of a path expression, such as 
applying a field accessor to a numeric
-value.
+Components of complex types in the data model are accessed via path 
expressions. Path access can be applied to the 
+result of a query expression that yields an instance of a complex type, for 
example, an object or an array instance.
 
-The following examples illustrate field access for a object, index-based 
element access for an array, and also a
-composition thereof.
+For objects, path access is based on field names, and it accesses the field 
whose name was specified.\
+For arrays, path access is based on (zero-based) array-style indexing. Array 
indexes can be used to retrieve either a 
+single element from an array, or a whole subset of an array. Accessing a 
single element is achieved by 
+providing a single index argument (zero-based element position), while 
obtaining a subset of an array is achieved by
+providing the `start` and `end` (zero-based) index positions; the returned 
subset is from position `start` to position 
+`end - 1`; the `end` position argument is optional. Multisets have similar 
behavior to arrays, except for retrieving 
+arbitrary items as order of items is not fixed in multisets.
+
+Attempts to access non-existent fields or out-of-bound array elements produce 
the special value `MISSING`. Type errors 
+will be raised for inappropriate use of a path expression, such as applying a 
field accessor to a numeric value.
+
+The following examples illustrate field access for an object, index-based 
element access or subset retrieval of an array, 
+and also a composition thereof.
 
 ##### Examples
 
@@ -231,6 +234,10 @@
     (["a", "b", "c"])[2]
 
     ({"name": "MyABCs", "array": [ "a", "b", "c"]}).array[2]
+    
+    (["a", "b", "c"])[0:2]
+    
+    (["a", "b", "c"])[0:]
 
 
 ## <a id="Primary_expressions">Primary Expressions</a>

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/3095
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff9bb0e82f31cefcdd19ace0d02fc07e7d00025f
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Hussain Towaileb <[email protected]>

Reply via email to