You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2018/05/21 18:37:19 UTC

[1/6] asterixdb git commit: [ASTERIXDB-2377][OTH] Fix JSON of Additional Expressions

Repository: asterixdb
Updated Branches:
  refs/heads/master 10a3f21de -> 81c80d3f9


[ASTERIXDB-2377][OTH] Fix JSON of Additional Expressions

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

Details:
- Fix JSON of additional expressions in the JSON
  plan printer of InsertDeleteUpsertOperator.

Change-Id: I2d13b91b4e5e36b156f52fbb09f0ddcffe1deda3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2627
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/6cbb8da8
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/6cbb8da8
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/6cbb8da8

Branch: refs/heads/master
Commit: 6cbb8da8958fa42377391942ce9386d4336487ef
Parents: c2d19a5
Author: Murtadha Hubail <mh...@apache.org>
Authored: Sat Apr 28 18:09:46 2018 +0300
Committer: Murtadha Hubail <mh...@apache.org>
Committed: Sun Apr 29 12:13:15 2018 -0700

----------------------------------------------------------------------
 .../prettyprint/LogicalOperatorPrettyPrintVisitorJson.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/6cbb8da8/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitorJson.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitorJson.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitorJson.java
index 1076eb5..8acf08b 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitorJson.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitorJson.java
@@ -544,9 +544,9 @@ public class LogicalOperatorPrettyPrintVisitorJson extends AbstractLogicalOperat
         addIndent(indent).append("\"from-record\": \"")
                 .append(op.getPayloadExpression().getValue().accept(exprVisitor, indent) + "\"");
         if (op.getAdditionalNonFilteringExpressions() != null) {
-            buffer.append(",\n\"meta\": \"");
+            buffer.append(",\n\"meta\": {");
             pprintExprList(op.getAdditionalNonFilteringExpressions(), 0);
-            buffer.append("\"");
+            buffer.append("}");
         }
         buffer.append(",\n");
         addIndent(indent).append("\"partitioned-by\": {");


[2/6] asterixdb git commit: [NO ISSUE][STO] Fix component switch in LSMBTreeRangeSearchCursor

Posted by mb...@apache.org.
[NO ISSUE][STO] Fix component switch in LSMBTreeRangeSearchCursor

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

Details:
- switchRequest array is used for switching memory components
  with disk components. It has the size = maximum number of
  memory components which can be greater than all the number of
  components size in certain cases (0 disk component,
  1 memory component for example). To avoid index out of bound,
  we end the loop early in this corner case.

Change-Id: If20cc671974485bf73ad05e95d681424805611d3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2633
Reviewed-by: Murtadha Hubail <mh...@apache.org>
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/e29ecfb6
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/e29ecfb6
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/e29ecfb6

Branch: refs/heads/master
Commit: e29ecfb6a053f95b1b262b99d0cd0650c6eef658
Parents: 6cbb8da
Author: Abdullah Alamoudi <ba...@gmail.com>
Authored: Thu May 3 19:45:50 2018 +0300
Committer: abdullah alamoudi <ba...@gmail.com>
Committed: Thu May 3 23:03:11 2018 -0700

----------------------------------------------------------------------
 .../storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e29ecfb6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
index a675047..361612e 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
@@ -212,7 +212,10 @@ public class LSMBTreeRangeSearchCursor extends LSMIndexSearchCursor {
         }
         opCtx.getIndex().getHarness().replaceMemoryComponentsWithDiskComponents(getOpCtx(), replaceFrom);
         // redo the search on the new component
-        for (int i = replaceFrom; i < switchRequest.length; i++) {
+        // switchRequest array has the size = number of memory components. which can be greater
+        // than operationalComponents size in certain cases (0 disk component, 1 memory component for example)
+        // To avoid index out of bound, we end the loop at the first of the two conditions
+        for (int i = replaceFrom; i < switchRequest.length && i < operationalComponents.size(); i++) {
             if (switchRequest[i]) {
                 ILSMComponent component = operationalComponents.get(i);
                 BTree btree = (BTree) component.getIndex();


[4/6] asterixdb git commit: [NO ISSUE] Move noindexonly docs to a separate file

Posted by mb...@apache.org.
[NO ISSUE] Move noindexonly docs to a separate file

Change-Id: I3be16d0381cd2d69a71ce1c5f922f0665ef6b431
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2634
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <ba...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/5c687935
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/5c687935
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/5c687935

Branch: refs/heads/master
Commit: 5c6879355e0179c80585b18cb6102eea80f4b4e3
Parents: c076968
Author: Till Westmann <ti...@apache.org>
Authored: Sat May 5 00:31:16 2018 -0700
Committer: Till Westmann <ti...@apache.org>
Committed: Sat May 5 08:25:29 2018 -0700

----------------------------------------------------------------------
 asterixdb/asterix-doc/pom.xml                   |  2 +-
 .../markdown/sqlpp/appendix_2_index_only.md     | 37 ++++++++++++++++++++
 .../markdown/sqlpp/appendix_2_parameters.md     | 20 -----------
 3 files changed, 38 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5c687935/asterixdb/asterix-doc/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-doc/pom.xml b/asterixdb/asterix-doc/pom.xml
index a5284ad..734f7a3 100644
--- a/asterixdb/asterix-doc/pom.xml
+++ b/asterixdb/asterix-doc/pom.xml
@@ -52,7 +52,7 @@
             <configuration>
               <target>
                 <concat destfile="${project.build.directory}/generated-site/markdown/sqlpp/manual.md">
-                  <filelist dir="${project.basedir}/src/main/markdown/sqlpp" files="0_toc.md,1_intro.md,2_expr_title.md,2_expr.md,3_query_title.md,3_declare_dataverse.md,3_declare_function.md,3_query.md,4_error_title.md,4_error.md,5_ddl_head.md,5_ddl_dataset_index.md,5_ddl_nonenforced_index.md,5_ddl_function_removal.md,5_ddl_dml.md,appendix_1_title.md,appendix_1_keywords.md,appendix_2_title.md,appendix_2_parameters.md" />
+                  <filelist dir="${project.basedir}/src/main/markdown/sqlpp" files="0_toc.md,1_intro.md,2_expr_title.md,2_expr.md,3_query_title.md,3_declare_dataverse.md,3_declare_function.md,3_query.md,4_error_title.md,4_error.md,5_ddl_head.md,5_ddl_dataset_index.md,5_ddl_nonenforced_index.md,5_ddl_function_removal.md,5_ddl_dml.md,appendix_1_title.md,appendix_1_keywords.md,appendix_2_title.md,appendix_2_parameters.md,appendix_2_index_only.md" />
                 </concat>
                 <concat destfile="${project.build.directory}/generated-site/markdown/sqlpp/builtins.md">
                   <filelist dir="${project.basedir}/src/main/markdown/builtins" files="0_toc.md,1_numeric_common.md,1_numeric_delta.md,2_string_common.md,2_string_delta.md,3_binary.md,4_spatial.md,5_similarity.md,6_tokenizing.md,7_temporal.md,7_allens.md,8_record.md,9_aggregate_sql.md,10_comparison.md,11_type.md,13_conditional.md,12_misc.md" />

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5c687935/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_index_only.md
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_index_only.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_index_only.md
new file mode 100644
index 0000000..7a71259
--- /dev/null
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_index_only.md
@@ -0,0 +1,37 @@
+<!--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements.  See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership.  The ASF licenses this file
+ ! to you under the Apache License, Version 2.0 (the
+ ! "License"); you may not use this file except in compliance
+ ! with the License.  You may obtain a copy of the License at
+ !
+ !   http://www.apache.org/licenses/LICENSE-2.0
+ !
+ ! Unless required by applicable law or agreed to in writing,
+ ! software distributed under the License is distributed on an
+ ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ! KIND, either express or implied.  See the License for the
+ ! specific language governing permissions and limitations
+ ! under the License.
+ !-->
+
+## <a id="Index_Only">Controlling Index-Only-Plan Parameter</a>
+By default, the system tries to build an index-only plan whenever utilizing a secondary index is possible.
+For example, if a SELECT or JOIN query can utilize an enforced B+Tree or R-Tree index on a field, the optimizer
+checks whether a secondary-index search alone can generate the result that the query asks for. It
+mainly checks two conditions: (1) predicates used in WHERE only uses the primary key field and/or secondary key field
+and (2) the result does not return any other fields. If these two conditions hold, it builds an index-only plan.
+Since an index-only plan only searches a secondary-index to answer a query, it is faster than
+a non-index-only plan that needs to search the primary index.
+However, this index-only plan can be turned off per query by setting the following parameter.
+
+*  **noindexonly**: if this is set to true, the index-only-plan will not be applied; the default value is false.
+
+##### Example
+
+    SET noindexonly 'true';
+
+    SELECT m.message AS message
+    FROM GleambookMessages m where m.message = " love product-b its shortcut-menu is awesome:)";

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5c687935/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_parameters.md
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_parameters.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_parameters.md
index 6ba6aba..1cc3cb1 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_parameters.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_2_parameters.md
@@ -91,23 +91,3 @@ If there is no user-provided suffix, "B" is the default suffix. See the followin
 
     SELECT u.name AS uname, m.message AS message
     FROM GleambookUsers u JOIN GleambookMessages m ON m.authorId = u.id;
-
-
-## <a id="Index_Only">Controlling Index-Only-Plan Parameter</a>
-By default, the system tries to build an index-only plan whenever utilizing a secondary index is possible.
-For example, if a SELECT or JOIN query can utilize an enforced B+Tree or R-Tree index on a field, the optimizer
-checks whether a secondary-index search alone can generate the result that the query asks for. It
-mainly checks two conditions: (1) predicates used in WHERE only uses the primary key field and/or secondary key field
-and (2) the result does not return any other fields. If these two conditions hold, it builds an index-only plan.
-Since an index-only plan only searches a secondary-index to answer a query, it is faster than
-a non-index-only plan that needs to search the primary index.
-However, this index-only plan can be turned off per query by setting the following parameter.
-
-*  **noindexonly**: if this is set to true, the index-only-plan will not be applied; the default value is false.
-
-##### Example
-
-    SET noindexonly 'true';
-
-    SELECT m.message AS message
-    FROM GleambookMessages m where m.message = " love product-b its shortcut-menu is awesome:)";


[3/6] asterixdb git commit: [NO ISSUE] SQL++ doc updates

Posted by mb...@apache.org.
[NO ISSUE] SQL++ doc updates

Change-Id: I3cdb400893609c578b6467586bcc2d15f2106996
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2631
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/c0769682
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/c0769682
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/c0769682

Branch: refs/heads/master
Commit: c0769682f2565e7c1d4b45b547f603c0fafe4fa8
Parents: e29ecfb
Author: Till Westmann <ti...@apache.org>
Authored: Fri May 4 22:24:46 2018 -0700
Committer: Till Westmann <ti...@apache.org>
Committed: Sat May 5 00:11:42 2018 -0700

----------------------------------------------------------------------
 .../src/main/markdown/sqlpp/2_expr.md           |  4 ++--
 .../src/main/markdown/sqlpp/3_query.md          | 21 ++++++++++----------
 .../src/main/markdown/sqlpp/4_error.md          |  9 ++++-----
 3 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c0769682/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
----------------------------------------------------------------------
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 93e2f5d..5f407ca 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
@@ -312,7 +312,7 @@ Different from standard SQL, double quotes play the same role as single quotes a
 ### <a id="Variable_references">Variable References</a>
 
     VariableReference     ::= <IDENTIFIER>|<DelimitedIdentifier>
-    <IDENTIFIER>          ::= <LETTER> (<LETTER> | <DIGIT> | "_" | "$")*
+    <IDENTIFIER>          ::= (<LETTER> | "_") (<LETTER> | <DIGIT> | "_" | "$")*
     <LETTER>              ::= ["A" - "Z", "a" - "z"]
     DelimitedIdentifier   ::= "`" (<EscapeQuot>
                                     | <EscapeBslash>
@@ -328,7 +328,7 @@ Different from standard SQL, double quotes play the same role as single quotes a
 A variable in SQL++ can be bound to any legal data model value. A variable reference refers to the value to which an in-scope variable is
 bound. (E.g., a variable binding may originate from one of the `FROM`, `WITH` or `LET` clauses of a `SELECT` statement or from an
 input parameter in the context of a function body.) Backticks, for example, \`id\`, are used for delimited identifiers. Delimiting is needed when
-a variable's desired name clashes with a SQL++ keyword or includes characters not allowed in regular identifiers.
+a variable's desired name clashes with a SQL++ keyword or includes characters not allowed in regular identifiers. More information on exactly how variable references are resolved can be found in the appendix section on Variable Resolution.
 
 ##### Examples
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c0769682/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
index 56103e5..996bb9e 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
@@ -46,7 +46,7 @@ The following shows the (rich) grammar for the `SELECT` statement in SQL++.
                            ( ( JoinType )? ( JoinClause | UnnestClause ) )*
 
     JoinClause         ::= <JOIN> Expression (( <AS> )? Variable)? <ON> Expression
-    UnnestClause       ::= ( <UNNEST> | <CORRELATE> | <FLATTEN> ) Expression
+    UnnestClause       ::= ( <UNNEST> ) Expression
                            ( <AS> )? Variable ( <AT> Variable )?
     JoinType           ::= ( <INNER> | <LEFT> ( <OUTER> )? )
 
@@ -60,8 +60,8 @@ The following shows the (rich) grammar for the `SELECT` statement in SQL++.
     GroupbyClause      ::= <GROUP> <BY> Expression ( ( (<AS>)? Variable )?
                            ( "," Expression ( (<AS>)? Variable )? )* )
                            ( <GROUP> <AS> Variable
-                             ("(" Variable <AS> VariableReference
-                             ("," Variable <AS> VariableReference )* ")")?
+                             ("(" VariableReference <AS> Identifier
+                             ("," VariableReference <AS> Identifier )* ")")?
                            )?
     HavingClause       ::= <HAVING> Expression
 
@@ -446,7 +446,7 @@ This query outputs:
 In the result, `$1` is the generated name for `substr(user.name, 1)`, while `alias` is the generated name for `user.alias`.
 
 ### <a id="Abbreviated_field_access_expressions">Abbreviated Field Access Expressions</a>
-As in standard SQL, SQL++ field access expressions can be abbreviated (not recommended) when there is no ambiguity. In the next example, the variable `user` is the only possible variable reference for fields `id`, `name` and `alias` and thus could be omitted in the query.
+As in standard SQL, SQL++ field access expressions can be abbreviated (not recommended!) when there is no ambiguity. In the next example, the variable `user` is the only possible variable reference for fields `id`, `name` and `alias` and thus could be omitted in the query. More information on abbbreviated field access can be found in the appendix section on Variable Resolution.
 
 ##### Example
 
@@ -659,6 +659,8 @@ Returns:
     Error: "Syntax error: Need an alias for the enclosed expression:\n(select element GleambookMessages\n    from GleambookMessages as GleambookMessages\n    where (GleambookMessages.authorId = GleambookUsers.id)\n )",
         "query_from_user": "use TinySocial;\n\nSELECT GleambookUsers.name, GleambookMessages.message\n    FROM GleambookUsers,\n      (\n        SELECT VALUE GleambookMessages\n        FROM GleambookMessages\n        WHERE GleambookMessages.authorId = GleambookUsers.id\n      );"
 
+More information on implicit binding variables can be found in the appendix section on Variable Resolution.
+
 ## <a id="Join_clauses">JOIN Clauses</a>
 The join clause in SQL++ supports both inner joins and left outer joins from standard SQL.
 
@@ -724,7 +726,7 @@ The SQL++ `GROUP BY` clause generalizes standard SQL's grouping and aggregation
 In a `GROUP BY` clause, in addition to the binding variable(s) defined for the grouping key(s), SQL++ allows a user to define a *group variable* by using the clause's `GROUP AS` extension to denote the resulting group.
 After grouping, then, the query's in-scope variables include the grouping key's binding variables as well as this group variable which will be bound to one collection value for each group. This per-group collection (i.e., multiset) value will be a set of nested objects in which each field of the object is the result of a renamed variable defined in parentheses following the group variable's name. The `GROUP AS` syntax is as follows:
 
-    <GROUP> <AS> Variable ("(" Variable <AS> VariableReference ("," Variable <AS> VariableReference )* ")")?
+    <GROUP> <AS> Variable ("(" VariableReference <AS> Identifier ("," VariableReference <AS> Identifier )* ")")?
 
 ##### Example
 
@@ -1228,6 +1230,7 @@ Note that if the condition expression evaluates to `NULL` or `MISSING` the input
 The `ORDER BY` clause is used to globally sort data in either ascending order (i.e., `ASC`) or descending order (i.e., `DESC`).
 During ordering, `MISSING` and `NULL` are treated as being smaller than any other value if they are encountered
 in the ordering key(s). `MISSING` is treated as smaller than `NULL` if both occur in the data being sorted.
+The ordering of values of a given type is consistent with its type's <= ordering; the ordering of values across types is implementation-defined but stable.
 The following example returns all `GleambookUsers` in descending order by their number of friends.
 
 ##### Example
@@ -1613,27 +1616,25 @@ The following matrix is a quick "SQL-92 compatibility cheat sheet" for SQL++.
 | Feature |  SQL++ | SQL-92 |  Why different?  |
 |----------|--------|-------|------------------|
 | SELECT * | Returns nested objects | Returns flattened concatenated objects | Nested collections are 1st class citizens |
-| SELECT list | order not preserved | order preserved | Fields in a JSON object is not ordered |
+| SELECT list | order not preserved | order preserved | Fields in a JSON object are not ordered |
 | Subquery | Returns a collection  | The returned collection is cast into a scalar value if the subquery appears in a SELECT list or on one side of a comparison or as input to a function | Nested collections are 1st class citizens |
-| LEFT OUTER JOIN |  Fills in `MISSING`(s) for non-matches  |   Fills in `NULL`(s) for non-matches    | "Absence" is more appropriate than "unknown" here.  |
+| LEFT OUTER JOIN |  Fills in `MISSING`(s) for non-matches  |   Fills in `NULL`(s) for non-matches    | "Absence" is more appropriate than "unknown" here  |
 | UNION ALL       | Allows heterogeneous inputs and output | Input streams must be UNION-compatible and output field names are drawn from the first input stream | Heterogenity and nested collections are common |
 | IN constant_expr | The constant expression has to be an array or multiset, i.e., [..,..,...] | The constant collection can be represented as comma-separated items in a paren pair | Nested collections are 1st class citizens |
 | String literal | Double quotes or single quotes | Single quotes only | Double quoted strings are pervasive |
 | Delimited identifiers | Backticks | Double quotes | Double quoted strings are pervasive |
 
-The following SQL-92 features are not implemented yet. However, SQL++ does not conflict those features:
+The following SQL-92 features are not implemented yet. However, SQL++ does not conflict with these features:
 
   * CROSS JOIN, NATURAL JOIN, UNION JOIN
   * RIGHT and FULL OUTER JOIN
   * INTERSECT, EXCEPT, UNION with set semantics
   * CAST expression
-  * NULLIF expression
   * COALESCE expression
   * ALL and SOME predicates for linking to subqueries
   * UNIQUE predicate (tests a collection for duplicates)
   * MATCH predicate (tests for referential integrity)
   * Row and Table constructors
-  * DISTINCT aggregates
   * Preserved order for expressions in a SELECT list
 
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c0769682/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
index e043fc2..e5cea1d 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
@@ -56,7 +56,7 @@ we will get a syntax error as follows:
 
 
 ## <a id="Identifier_resolution_errors">Identifier Resolution Errors</a>
-Referring an undefined identifier can cause an error if the identifier
+Referring to an undefined identifier can cause an error if the identifier
 cannot be successfully resolved as a valid field access.
 
 ##### Example
@@ -64,7 +64,7 @@ cannot be successfully resolved as a valid field access.
     SELECT *
     FROM GleambookUser user;
 
-Assume we have a typo in "GleambookUser" which misses the ending "s",
+If we have a typo as above in "GleambookUsers" that misses the dataset name's ending "s",
 we will get an identifier resolution error as follows:
 
     Error: Cannot find dataset GleambookUser in dataverse Default nor an alias with name GleambookUser!
@@ -74,8 +74,7 @@ we will get an identifier resolution error as follows:
     SELECT name, message
     FROM GleambookUsers u JOIN GleambookMessages m ON m.authorId = u.id;
 
-If the compiler cannot figure out all possible fields in
-`GleambookUsers` and `GleambookMessages`,
+If the compiler cannot figure out how to resolve an unqualified field name, which will occur if there is more than one variable in scope (e.g., `GleambookUsers u` and `GleambookMessages m` as above),
 we will get an identifier resolution error as follows:
 
     Error: Cannot resolve ambiguous alias reference for undefined identifier name
@@ -94,7 +93,7 @@ it processes does not satisfy the type requirement.
 Since function `abs` can only process numeric input values,
 we will get a type error as follows:
 
-    Error: Arithmetic operations are not implemented for string
+    Error: Type mismatch: function abs expects its 1st input parameter to be type tinyint, smallint, integer, bigint, float or double, but the actual input type is string
 
 
 ## <a id="Resource_errors">Resource Errors</a>


[6/6] asterixdb git commit: Merge commit 'f02b43bcff1c859b933f55df9654899d025b1ed3' from release-0.9.4-pre-rc

Posted by mb...@apache.org.
Merge commit 'f02b43bcff1c859b933f55df9654899d025b1ed3' from release-0.9.4-pre-rc

Change-Id: I2b825e2d8b5defb67fba39f4912cfaa44111233f


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/81c80d3f
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/81c80d3f
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/81c80d3f

Branch: refs/heads/master
Commit: 81c80d3f9aef4a48b6f94e530932e51af2445c08
Parents: 10a3f21 f02b43b
Author: Michael Blow <mb...@apache.org>
Authored: Mon May 21 12:32:00 2018 -0400
Committer: Michael Blow <mb...@apache.org>
Committed: Mon May 21 12:32:00 2018 -0400

----------------------------------------------------------------------
 .../asterix/app/translator/QueryTranslator.java |  8 +++++
 .../drop-primary-index.1.ddl.sqlpp              | 26 ++++++++++++++
 .../drop-primary-index.2.ddl.sqlpp              | 19 ++++++++++
 .../resources/runtimets/testsuite_sqlpp.xml     |  6 ++++
 .../asterix/common/exceptions/ErrorCode.java    |  1 +
 .../main/resources/asx_errormsg/en.properties   |  1 +
 asterixdb/asterix-doc/pom.xml                   |  2 +-
 .../src/main/markdown/sqlpp/2_expr.md           |  4 +--
 .../src/main/markdown/sqlpp/3_query.md          | 21 +++++------
 .../src/main/markdown/sqlpp/4_error.md          |  9 +++--
 .../markdown/sqlpp/appendix_2_index_only.md     | 37 ++++++++++++++++++++
 .../markdown/sqlpp/appendix_2_parameters.md     | 20 -----------
 .../LogicalOperatorPrettyPrintVisitorJson.java  |  4 +--
 13 files changed, 118 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81c80d3f/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
----------------------------------------------------------------------
diff --cc asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 6a89bda,e983763..524c684
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@@ -2823,9 -2815,9 +2825,15 @@@ public class QueryTranslator extends Ab
          rewriter.rewrite(stmt);
      }
  
+     private void ensureNonPrimaryIndexDrop(Index index) throws AlgebricksException {
+         if (index.isPrimaryIndex()) {
+             throw new MetadataException(ErrorCode.CANNOT_DROP_INDEX, index.getIndexName(), index.getDatasetName());
+         }
+     }
++
 +    protected void afterCompile() {
 +        if (sessionOutput.config().is(SessionConfig.FORMAT_HTML)) {
 +            ExecutionPlansHtmlPrintUtil.print(sessionOutput.out(), getExecutionPlans());
 +        }
 +    }
  }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81c80d3f/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81c80d3f/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81c80d3f/asterixdb/asterix-doc/src/main/markdown/sqlpp/2_expr.md
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81c80d3f/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/prettyprint/LogicalOperatorPrettyPrintVisitorJson.java
----------------------------------------------------------------------


[5/6] asterixdb git commit: [ASTERIXDB-2387][MTD] Prevent Dataset Primary Index Drop

Posted by mb...@apache.org.
[ASTERIXDB-2387][MTD] Prevent Dataset Primary Index Drop

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

Details:
- Ensure a dataset primary index cannot be dropped
  without dropping the dataset.
- Add test case.

Change-Id: Ic2256925d088fa5b5ba3b9623a29b6219b5a9b1e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2645
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/f02b43bc
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/f02b43bc
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/f02b43bc

Branch: refs/heads/master
Commit: f02b43bcff1c859b933f55df9654899d025b1ed3
Parents: 5c68793
Author: Murtadha Hubail <mh...@apache.org>
Authored: Thu May 17 01:33:02 2018 +0300
Committer: Murtadha Hubail <mh...@apache.org>
Committed: Wed May 16 19:22:29 2018 -0700

----------------------------------------------------------------------
 .../asterix/app/translator/QueryTranslator.java |  8 ++++++
 .../drop-primary-index.1.ddl.sqlpp              | 26 ++++++++++++++++++++
 .../drop-primary-index.2.ddl.sqlpp              | 19 ++++++++++++++
 .../resources/runtimets/testsuite_sqlpp.xml     |  6 +++++
 .../asterix/common/exceptions/ErrorCode.java    |  1 +
 .../main/resources/asx_errormsg/en.properties   |  1 +
 6 files changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f02b43bc/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 453bcb5..e983763 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -1468,6 +1468,7 @@ public class QueryTranslator extends AbstractLangTranslator implements IStatemen
                         throw new AlgebricksException("There is no index with this name " + indexName + ".");
                     }
                 }
+                ensureNonPrimaryIndexDrop(index);
                 // #. prepare a job to drop the index in NC.
                 jobsToExecute.add(IndexUtil.buildDropIndexJobSpec(index, metadataProvider, ds));
 
@@ -1509,6 +1510,7 @@ public class QueryTranslator extends AbstractLangTranslator implements IStatemen
                 } else if (ExternalIndexingOperations.isFileIndex(index)) {
                     throw new AlgebricksException("Dropping a dataset's files index is not allowed.");
                 }
+                ensureNonPrimaryIndexDrop(index);
                 // #. prepare a job to drop the index in NC.
                 jobsToExecute.add(IndexUtil.buildDropIndexJobSpec(index, metadataProvider, ds));
                 List<Index> datasetIndexes =
@@ -2812,4 +2814,10 @@ public class QueryTranslator extends AbstractLangTranslator implements IStatemen
         IStatementRewriter rewriter = rewriterFactory.createStatementRewriter();
         rewriter.rewrite(stmt);
     }
+
+    private void ensureNonPrimaryIndexDrop(Index index) throws AlgebricksException {
+        if (index.isPrimaryIndex()) {
+            throw new MetadataException(ErrorCode.CANNOT_DROP_INDEX, index.getIndexName(), index.getDatasetName());
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f02b43bc/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.1.ddl.sqlpp
new file mode 100644
index 0000000..2dfd4aa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.1.ddl.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop  dataverse test if exists;
+create  dataverse test;
+
+use test;
+
+create type aType as {id:int};
+create dataset ds(aType) primary key id;
+drop index ds.ds;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f02b43bc/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.2.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.2.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.2.ddl.sqlpp
new file mode 100644
index 0000000..8268a20
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/ddl/drop-primary-index/drop-primary-index.2.ddl.sqlpp
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop  dataverse test if exists;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f02b43bc/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 3823234..2ee294a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -1654,6 +1654,12 @@
         <expected-error>Syntax error: In line 53 >>create  primary index if exists sec_primary_idx1  on LineItem;&lt;&lt; Encountered "exists" at column 26.</expected-error>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="ddl">
+      <compilation-unit name="drop-primary-index">
+        <output-dir compare="Text">drop-primary-index</output-dir>
+        <expected-error>Cannot drop index "ds". Drop dataset "ds" to remove this index</expected-error>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="dml">
     <test-case FilePath="dml">

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f02b43bc/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index b9a5b29..bd84832 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -149,6 +149,7 @@ public class ErrorCode {
     public static final int CANNOT_SERIALIZE_A_VALUE = 1066;
     public static final int CANNOT_FIND_NON_MISSING_SELECT_OPERATOR = 1067;
     public static final int CANNOT_GET_CONDITIONAL_SPLIT_KEY_VARIABLE = 1068;
+    public static final int CANNOT_DROP_INDEX = 1069;
 
     // Feed errors
     public static final int DATAFLOW_ILLEGAL_STATE = 3001;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f02b43bc/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index 175f144..a0cebea 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -136,6 +136,7 @@
 1066 = Cannot serialize a value.
 1067 = Cannot find a non-missing SELECT operator in GROUP operator for a left-outer-join plan optimization.
 1068 = Cannot get the conditional split variable for the given UNNESTMAP operator.
+1069 = Cannot drop index \"%1$s\". Drop dataset \"%1$s\" to remove this index
 
 # Feed Errors
 3001 = Illegal state.