You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Yingyi Bu (Code Review)" <do...@asterixdb.incubator.apache.org> on 2016/10/03 17:27:29 UTC

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Yingyi Bu has uploaded a new change for review.

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

Change subject: Add documentation for errors and reserved keywords.
......................................................................

Add documentation for errors and reserved keywords.

Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
---
M asterixdb/asterix-doc/pom.xml
M asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
R asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
5 files changed, 131 insertions(+), 2 deletions(-)


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

diff --git a/asterixdb/asterix-doc/pom.xml b/asterixdb/asterix-doc/pom.xml
index 27a6095..f674f7f 100644
--- a/asterixdb/asterix-doc/pom.xml
+++ b/asterixdb/asterix-doc/pom.xml
@@ -54,7 +54,7 @@
               <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.md,3_query.md,4_ddl.md"/>
+                         files="0_toc.md,1_intro.md,2_expr.md,3_query.md,4_error.md,5_ddl.md,appendix_1_keywords.md"/>
                 </concat>
                 <concat destfile="${project.build.directory}/generated-site/markdown/sqlpp/builtins.md">
                   <filelist dir="${project.basedir}/src/main/markdown/builtins"
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
index bbe0566..ba4931c 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
@@ -73,7 +73,12 @@
       * [LET clauses](#Let_clauses)
       * [UNION ALL](#Union_all)
       * [SQL++ Vs. SQL-92](#Vs_SQL-92)
-* [4. DDL and DML statements](#DDL_and_DML_statements)
+* [4. Errors](#Errors)
+      * [Parsing errors](#Parsing_errors)
+      * [Identifier resolution errors](#Parsing_errors)
+      * [Typing errors](#Typing_errors)
+      * [Resource errors](#Resource_errors)
+* [5. DDL and DML statements](#DDL_and_DML_statements)
       * [Declarations](#Declarations)
       * [Lifecycle management statements](#Lifecycle_management_statements)
            * [Dataverses](#Dataverses)
@@ -84,4 +89,5 @@
            * [Inserts](#Inserts)
            * [Upserts](#Upserts)
            * [Deletes](#Deletes)
+* [Appendix 1. Reserved keywords](#Reserved_keywords)
 
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
new file mode 100644
index 0000000..5d47e53
--- /dev/null
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
@@ -0,0 +1,97 @@
+# <a id="Errors">4. Errors</a>
+A SQL++ query can potentially result in one of the following errors:
+
+ * parsing error,
+ * identifier resolution error,
+ * typing error,
+ * resource error.
+
+If the query processor runs into any error, it will
+terminate the ongoing processing of the query and
+immediately return an error message to the client.
+
+## <a id="Parsing_errors">Parsing Errors</a>
+An valid SQL++ query must satisfy the SQL++ grammar rules.
+Otherwise, a parsing error will be raised.
+
+##### Example
+
+    SELECT *
+    FROM GleambookUsers user
+
+Since the ending semi-colon is mandatory for any SQL++ query,
+we will get a parsing error as follows:
+
+    Error: Syntax error: In line 2 >>FROM GleambookUsers user<< Encountered <EOF> at column 24.
+    ==> FROM GleambookUsers user
+
+##### Example
+
+    SELECT *
+    FROM GleambookUsers user
+    WHERE type="advertiser";
+
+Since "type" a [reserved keyword](#Reserved_keywords) in the SQL++ parser,
+we will get a parsing error as follows:
+
+    Error: Syntax error: In line 3 >>WHERE type="advertiser";<< Encountered 'type' "type" at column 7.
+    ==> WHERE type="advertiser";
+
+
+## <a id="Identifier_resolution_errors">Identifier Resolution Errors</a>
+Referring an undefined identifier can cause an error if the identifier
+cannot be successfully resolved as a valid field access.
+
+##### Example
+
+    SELECT *
+    FROM GleambookUser user;
+
+Assume we have a typo in "GleambookUser" which misses the 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!
+
+##### Example
+
+    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`,
+we will get an identifier resolution error as follows:
+
+    Error: Cannot resolve ambiguous alias reference for undefined identifier name
+
+
+## <a id="Typing_errors">Typing Errors</a>
+
+The SQL++ compiler does type checks based on its available type information.
+In addition, the SQL++ runtime also reports type errors if a data model instance
+it processes does not satisfy the type requirement.
+
+##### Example
+
+    abs("123");
+
+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
+
+
+## <a id="Resource_errors">Resource Errors</a>
+A query can potentially exhaust system resources, such
+as the number of open files and disk spaces.
+For instance, the following two resource errors could be potentially
+be seen when running the system:
+
+    Error: no space left on device
+    Error: too many open files
+
+The "no space left on device" issue usually can be fixed by
+cleaning up disk spaces and reserving more disk spaces for the system.
+The "too many open files" issue usually can be fixed by a system
+administrator, following the instructions
+[here](https://easyengine.io/tutorials/linux/increase-open-files-limit/).
+
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_ddl.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
similarity index 100%
rename from asterixdb/asterix-doc/src/main/markdown/sqlpp/4_ddl.md
rename to asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
new file mode 100644
index 0000000..b61528c
--- /dev/null
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
@@ -0,0 +1,26 @@
+# <a id="Reserved_keywords">Appendix 1. Reserved keywords</a>
+All reserved keywords are listed in the following table:
+
+|     |     |       |    |     |    |
+| ----|-----|-------|----|-----|----|
+| AND | ANY | APPLY | AS | ASC | AT |
+| AUTOGENERATED | BETWEEN | BTREE | BY | CASE | CLOSED |
+| CREATE | COMPACTION | COMPACT | CONNECT | CORRELATE | DATASET |
+| COLLECTION | DATAVERSE | DECLARE | DEFINITION | DECLARE | DEFINITION |
+| DELETE | DESC | DISCONNECT | DISTINCT | DROP | ELEMENT |
+| ELEMENT | EXPLAIN | ELSE | ENFORCED | END | EVERY |
+| EXCEPT | EXIST | EXTERNAL | FEED | FILTER | FLATTEN |
+| FOR | EXIST | EXTERNAL | FEED | FILTER | FLATTEN |
+| FROM | FULL | FUNCTION | GROUP | HAVING | HINTS |
+| IF | INTO | IN | INDEX | INGESTION | INNER |
+| INSERT | INTERNAL | INTERSECT | IS | JOIN | KEYWORD |
+| LEFT | LETTING | LET | LIKE | LIMIT | LOAD |
+| NODEGROUP | NGRAM | NOT | OFFSET | ON | OPEN |
+| OR | ORDER | OUTER | OUTPUT | PATH | POLICY |
+| PRE-SORTED | PRIMARY | RAW | REFRESH | RETURN | RTREE |
+| RUN | SATISFIES | SECONDARY | SELECT | SET | SOME |
+| TEMPORARY | THEN | TYPE | UNKNOWN | UNNEST | UPDATE |
+| USE | USING | VALUE | WHEN | WHERE | WITH |
+| WRITE |     |       |      |       |      |
+
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Yingyi Bu (Code Review)" <do...@asterixdb.incubator.apache.org>.
Hello Till Westmann, Jenkins,

I'd like you to reexamine a change.  Please visit

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

to look at the new patch set (#3).

Change subject: Add documentation for errors and reserved keywords.
......................................................................

Add documentation for errors and reserved keywords.

Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
---
M asterixdb/asterix-doc/pom.xml
M asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
R asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
5 files changed, 131 insertions(+), 2 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/39/1239/3
-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1239
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Till Westmann (Code Review)" <do...@asterixdb.incubator.apache.org>.
Till Westmann has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 1:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/2882/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 2:

Integration Tests Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/820/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 2:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/2883/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 3:

Integration Tests Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/822/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Till Westmann (Code Review)" <do...@asterixdb.incubator.apache.org>.
Till Westmann has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 1:

(2 comments)

https://asterix-gerrit.ics.uci.edu/#/c/1239/1/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
File asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md:

Line 4:  * parsing error,
Should we call those "syntax errors"? That's what we use in the error message :)


Line 6:  * typing error,
Just "type error"?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: Yes

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Yingyi Bu (Code Review)" <do...@asterixdb.incubator.apache.org>.
Yingyi Bu has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 1:

(2 comments)

https://asterix-gerrit.ics.uci.edu/#/c/1239/1/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
File asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md:

Line 4:  * parsing error,
> Should we call those "syntax errors"? That's what we use in the error messa
Done


Line 6:  * typing error,
> Just "type error"?
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: Yes

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 2: Integration-Tests+1

Integration Tests Successful

https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/820/ : SUCCESS

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 3:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/2885/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Yingyi Bu (Code Review)" <do...@asterixdb.incubator.apache.org>.
Hello Jenkins,

I'd like you to reexamine a change.  Please visit

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

to look at the new patch set (#2).

Change subject: Add documentation for errors and reserved keywords.
......................................................................

Add documentation for errors and reserved keywords.

Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
---
M asterixdb/asterix-doc/pom.xml
M asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
R asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
5 files changed, 131 insertions(+), 2 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/39/1239/2
-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1239
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 3:

Integration Tests Timed Out

https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/822/ : ABORTED

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Yingyi Bu (Code Review)" <do...@asterixdb.incubator.apache.org>.
Yingyi Bu has submitted this change and it was merged.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Add documentation for errors and reserved keywords.

Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1239
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <bu...@gmail.com>
---
M asterixdb/asterix-doc/pom.xml
M asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
R asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
A asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
5 files changed, 131 insertions(+), 2 deletions(-)

Approvals:
  Yingyi Bu: Looks good to me, approved
  Jenkins: Verified; No violations found



diff --git a/asterixdb/asterix-doc/pom.xml b/asterixdb/asterix-doc/pom.xml
index 27a6095..f674f7f 100644
--- a/asterixdb/asterix-doc/pom.xml
+++ b/asterixdb/asterix-doc/pom.xml
@@ -54,7 +54,7 @@
               <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.md,3_query.md,4_ddl.md"/>
+                         files="0_toc.md,1_intro.md,2_expr.md,3_query.md,4_error.md,5_ddl.md,appendix_1_keywords.md"/>
                 </concat>
                 <concat destfile="${project.build.directory}/generated-site/markdown/sqlpp/builtins.md">
                   <filelist dir="${project.basedir}/src/main/markdown/builtins"
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
index bbe0566..b04ea6a 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md
@@ -73,7 +73,12 @@
       * [LET clauses](#Let_clauses)
       * [UNION ALL](#Union_all)
       * [SQL++ Vs. SQL-92](#Vs_SQL-92)
-* [4. DDL and DML statements](#DDL_and_DML_statements)
+* [4. Errors](#Errors)
+      * [Syntax errors](#Syntax_errors)
+      * [Identifier resolution errors](#Parsing_errors)
+      * [Type errors](#Type_errors)
+      * [Resource errors](#Resource_errors)
+* [5. DDL and DML statements](#DDL_and_DML_statements)
       * [Declarations](#Declarations)
       * [Lifecycle management statements](#Lifecycle_management_statements)
            * [Dataverses](#Dataverses)
@@ -84,4 +89,5 @@
            * [Inserts](#Inserts)
            * [Upserts](#Upserts)
            * [Deletes](#Deletes)
+* [Appendix 1. Reserved keywords](#Reserved_keywords)
 
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
new file mode 100644
index 0000000..60232e4
--- /dev/null
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_error.md
@@ -0,0 +1,97 @@
+# <a id="Errors">4. Errors</a>
+A SQL++ query can potentially result in one of the following errors:
+
+ * syntax error,
+ * identifier resolution error,
+ * type error,
+ * resource error.
+
+If the query processor runs into any error, it will
+terminate the ongoing processing of the query and
+immediately return an error message to the client.
+
+## <a id="Syntax_errors">Syntax Errors</a>
+An valid SQL++ query must satisfy the SQL++ grammar rules.
+Otherwise, a syntax error will be raised.
+
+##### Example
+
+    SELECT *
+    FROM GleambookUsers user
+
+Since the ending semi-colon is mandatory for any SQL++ query,
+we will get a syntax error as follows:
+
+    Error: Syntax error: In line 2 >>FROM GleambookUsers user<< Encountered <EOF> at column 24.
+    ==> FROM GleambookUsers user
+
+##### Example
+
+    SELECT *
+    FROM GleambookUsers user
+    WHERE type="advertiser";
+
+Since "type" a [reserved keyword](#Reserved_keywords) in the SQL++ parser,
+we will get a syntax error as follows:
+
+    Error: Syntax error: In line 3 >>WHERE type="advertiser";<< Encountered 'type' "type" at column 7.
+    ==> WHERE type="advertiser";
+
+
+## <a id="Identifier_resolution_errors">Identifier Resolution Errors</a>
+Referring an undefined identifier can cause an error if the identifier
+cannot be successfully resolved as a valid field access.
+
+##### Example
+
+    SELECT *
+    FROM GleambookUser user;
+
+Assume we have a typo in "GleambookUser" which misses the 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!
+
+##### Example
+
+    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`,
+we will get an identifier resolution error as follows:
+
+    Error: Cannot resolve ambiguous alias reference for undefined identifier name
+
+
+## <a id="Type_errors">Type Errors</a>
+
+The SQL++ compiler does type checks based on its available type information.
+In addition, the SQL++ runtime also reports type errors if a data model instance
+it processes does not satisfy the type requirement.
+
+##### Example
+
+    abs("123");
+
+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
+
+
+## <a id="Resource_errors">Resource Errors</a>
+A query can potentially exhaust system resources, such
+as the number of open files and disk spaces.
+For instance, the following two resource errors could be potentially
+be seen when running the system:
+
+    Error: no space left on device
+    Error: too many open files
+
+The "no space left on device" issue usually can be fixed by
+cleaning up disk spaces and reserving more disk spaces for the system.
+The "too many open files" issue usually can be fixed by a system
+administrator, following the instructions
+[here](https://easyengine.io/tutorials/linux/increase-open-files-limit/).
+
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/4_ddl.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
similarity index 100%
rename from asterixdb/asterix-doc/src/main/markdown/sqlpp/4_ddl.md
rename to asterixdb/asterix-doc/src/main/markdown/sqlpp/5_ddl.md
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
new file mode 100644
index 0000000..b61528c
--- /dev/null
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_1_keywords.md
@@ -0,0 +1,26 @@
+# <a id="Reserved_keywords">Appendix 1. Reserved keywords</a>
+All reserved keywords are listed in the following table:
+
+|     |     |       |    |     |    |
+| ----|-----|-------|----|-----|----|
+| AND | ANY | APPLY | AS | ASC | AT |
+| AUTOGENERATED | BETWEEN | BTREE | BY | CASE | CLOSED |
+| CREATE | COMPACTION | COMPACT | CONNECT | CORRELATE | DATASET |
+| COLLECTION | DATAVERSE | DECLARE | DEFINITION | DECLARE | DEFINITION |
+| DELETE | DESC | DISCONNECT | DISTINCT | DROP | ELEMENT |
+| ELEMENT | EXPLAIN | ELSE | ENFORCED | END | EVERY |
+| EXCEPT | EXIST | EXTERNAL | FEED | FILTER | FLATTEN |
+| FOR | EXIST | EXTERNAL | FEED | FILTER | FLATTEN |
+| FROM | FULL | FUNCTION | GROUP | HAVING | HINTS |
+| IF | INTO | IN | INDEX | INGESTION | INNER |
+| INSERT | INTERNAL | INTERSECT | IS | JOIN | KEYWORD |
+| LEFT | LETTING | LET | LIKE | LIMIT | LOAD |
+| NODEGROUP | NGRAM | NOT | OFFSET | ON | OPEN |
+| OR | ORDER | OUTER | OUTPUT | PATH | POLICY |
+| PRE-SORTED | PRIMARY | RAW | REFRESH | RETURN | RTREE |
+| RUN | SATISFIES | SECONDARY | SELECT | SET | SOME |
+| TEMPORARY | THEN | TYPE | UNKNOWN | UNNEST | UPDATE |
+| USE | USING | VALUE | WHEN | WHERE | WITH |
+| WRITE |     |       |      |       |      |
+
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>

Change in asterixdb[master]: Add documentation for errors and reserved keywords.

Posted by "Yingyi Bu (Code Review)" <do...@asterixdb.incubator.apache.org>.
Yingyi Bu has posted comments on this change.

Change subject: Add documentation for errors and reserved keywords.
......................................................................


Patch Set 3: Code-Review+2

Fwd Till's +2.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e48f8a6b7bc858ca565a428fa4d87ea31437de4
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <bu...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No