Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Add SQL++ 101 doc.
..


Patch Set 4:

Integration Tests Successful

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Yingyi Bu 
Gerrit-HasComments: No


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Yingyi Bu (Code Review)
Yingyi Bu has submitted this change and it was merged.

Change subject: Add SQL++ 101 doc.
..


Add SQL++ 101 doc.

- submit on behalf of Mike Carey.

Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1202
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Reviewed-by: Yingyi Bu 
---
A asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md
A asterixdb/asterix-doc/src/site/resources/data/chm.adm
A asterixdb/asterix-doc/src/site/resources/data/chu.adm
A asterixdb/asterix-doc/src/site/resources/data/gbm.adm
A asterixdb/asterix-doc/src/site/resources/data/gbu.adm
M asterixdb/asterix-doc/src/site/site.xml
6 files changed, 1,000 insertions(+), 23 deletions(-)

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



diff --git a/asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md 
b/asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md
new file mode 100644
index 000..3cfb30b
--- /dev/null
+++ b/asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md
@@ -0,0 +1,925 @@
+
+
+# AsterixDB 101: An ADM and SQL++ Primer #
+
+## Welcome to AsterixDB! ##
+This document introduces the main features of AsterixDB's data model (ADM) and 
its new SQL-like query language (SQL++) by example.
+The example is a simple scenario involving (synthetic) sample data modeled 
after data from the social domain.
+This document describes a set of sample datasets, together with a set of 
illustrative queries,
+to introduce you to the "AsterixDB user experience".
+The complete set of steps required to create and load a handful of sample 
datasets, along with runnable queries
+and the expected results for each query, are included.
+
+This document assumes that you are at least vaguely familiar with AsterixDB 
and why you might want to use it.
+Most importantly, it assumes you already have a running instance of AsterixDB 
and that you know how to query
+it using AsterixDB's basic web interface.
+For more information on these topics, you should go through the steps in
+[Installing Asterix Using Managix](../install.html)
+before reading this document and make sure that you have a running AsterixDB 
instance ready to go.
+To get your feet wet, you should probably start with a simple local 
installation of AsterixDB on your favorite
+machine, accepting all of the default settings that Managix offers.
+Later you can graduate to trying AsterixDB on a cluster, its real intended 
home (since it targets Big Data).
+(Note: With the exception of specifying the correct locations where you put 
the source data for this example,
+there should no changes needed in the SQL++ statements to run the examples 
locally and/or to run them
+on a cluster when you are ready to take that step.)
+
+As you read through this document, you should try each step for yourself on 
your own AsterixDB instance.
+You will use the AsterixDB web interface to do this, and for SQL++ you will 
need to select SQL++ instead of AQL as your language of choice in the Query 
Language box that sits underneath the UI's query entry area.
+Once you have reached the end of this tutorial, you will be fully armed and 
dangerous, with all the basic AsterixDB knowledge
+that you'll need to start down the path of modeling, storing, and querying 
your own semistructured data.
+
+
+## ADM: Modeling Semistructed Data in AsterixDB ##
+In this section you will learn all about modeling Big Data using
+ADM, the data model of the AsterixDB BDMS.
+
+### Dataverses, Datatypes, and Datasets ###
+The top-level organizing concept in the AsterixDB world is the _dataverse_.
+A dataverse---short for "data universe"---is a place (similar to a database in 
a relational DBMS) in which
+to create and manage the types, datasets, functions, and other artifacts for a 
given AsterixDB application.
+When you start using an AsterixDB instance for the first time, it starts out 
"empty"; it contains no data
+other than the AsterixDB system catalogs (which live in a special dataverse 
called the Metadata dataverse).
+To store your data in AsterixDB, you will first create a dataverse and then 
you use it for the _datatypes_
+and _datasets_ for managing your own data.
+A datatype tells AsterixDB what you know (or more accurately, what you want it 
to know) a priori about one
+of the kinds of data instances that you want AsterixDB to hold for you.
+A dataset is a collection of data instances of a datatype,
+and AsterixDB makes sure that the data instances that you put in it conform to 
its specified type.
+Since AsterixDB targets semistructured data, you can use _open_ datatypes and 
tell it as little or as
+much as you wish about your data up front; the more you tell it up front, the 
less information it will
+have to store repeatedly in the individual data 

Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Yingyi Bu (Code Review)
Yingyi Bu has posted comments on this change.

Change subject: Add SQL++ 101 doc.
..


Patch Set 4: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Yingyi Bu 
Gerrit-HasComments: No


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Add SQL++ 101 doc.
..


Patch Set 4:

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 
Gerrit-HasComments: No


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Yingyi Bu (Code Review)
Hello Jenkins,

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

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

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

Change subject: Add SQL++ 101 doc.
..

Add SQL++ 101 doc.

- submit on behalf of Mike Carey.

Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
---
A asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md
A asterixdb/asterix-doc/src/site/resources/data/chm.adm
A asterixdb/asterix-doc/src/site/resources/data/chu.adm
A asterixdb/asterix-doc/src/site/resources/data/gbm.adm
A asterixdb/asterix-doc/src/site/resources/data/gbu.adm
M asterixdb/asterix-doc/src/site/site.xml
6 files changed, 1,000 insertions(+), 23 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/02/1202/4
-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1202
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Add SQL++ 101 doc.
..


Patch Set 3:

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 
Gerrit-HasComments: No


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Yingyi Bu (Code Review)
Hello Jenkins,

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

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

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

Change subject: Add SQL++ 101 doc.
..

Add SQL++ 101 doc.

- submit on behalf of Mike Carey.

Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
---
A asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md
A asterixdb/asterix-doc/src/site/resources/data/chm.adm
A asterixdb/asterix-doc/src/site/resources/data/chu.adm
A asterixdb/asterix-doc/src/site/resources/data/gbm.adm
A asterixdb/asterix-doc/src/site/resources/data/gbu.adm
M asterixdb/asterix-doc/src/site/site.xml
6 files changed, 999 insertions(+), 22 deletions(-)


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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Add SQL++ 101 doc.
..


Patch Set 2:

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 
Gerrit-HasComments: No


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Add SQL++ 101 doc.
..


Patch Set 2:

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 
Gerrit-HasComments: No


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Yingyi Bu (Code Review)
Yingyi Bu has uploaded a new patch set (#2).

Change subject: Add SQL++ 101 doc.
..

Add SQL++ 101 doc.

- submit on behalf of Mike Carey.

Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
---
A asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md
A asterixdb/asterix-doc/src/site/resources/data/chm.adm
A asterixdb/asterix-doc/src/site/resources/data/chu.adm
A asterixdb/asterix-doc/src/site/resources/data/gbm.adm
A asterixdb/asterix-doc/src/site/resources/data/gbu.adm
M asterixdb/asterix-doc/src/site/site.xml
6 files changed, 991 insertions(+), 18 deletions(-)


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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Add SQL++ 101 doc.
..


Patch Set 1:

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu 
Gerrit-Reviewer: Jenkins 
Gerrit-HasComments: No


Change in asterixdb[master]: Add SQL++ 101 doc.

2016-09-23 Thread Yingyi Bu (Code Review)
Yingyi Bu has uploaded a new change for review.

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

Change subject: Add SQL++ 101 doc.
..

Add SQL++ 101 doc.

- submit on behalf of Mike Carey.

Change-Id: Ic3e50f1ecf920bb42204ae1d106f9803859853d3
---
M asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
A asterixdb/asterix-doc/src/site/markdown/sqlpp/primer-sqlpp.md
A asterixdb/asterix-doc/src/site/resources/data/chm.adm
A asterixdb/asterix-doc/src/site/resources/data/chu.adm
A asterixdb/asterix-doc/src/site/resources/data/gbm.adm
A asterixdb/asterix-doc/src/site/resources/data/gbu.adm
M asterixdb/asterix-doc/src/site/site.xml
7 files changed, 1,006 insertions(+), 33 deletions(-)


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

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 01aa358..04d8e5b 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
@@ -779,15 +779,15 @@
 element, to "de-listify" the list and obtain the desired scalar for the 
comparison.
 
 ## LET clauses
-Similar to `WITH` clauses, `LET` clauses can be useful when a (complex) 
expression is used several times in a query, such that the query can be more 
concise. The next query shows an example.
+Similar to `WITH` clauses, `LET` clauses can be useful when a (complex) 
expression is used several times within a query, allowing it to be written once 
to make the query more concise. The next query shows an example.
 
 # Example
 
 SELECT u.name AS uname, messages AS messages
 FROM GleambookUsers u
-LET messages = ( SELECT VALUE m
-   FROM GleambookMessages m
-   WHERE m.authorId = u.id )
+LET messages = (SELECT VALUE m
+FROM GleambookMessages m
+WHERE m.authorId = u.id)
 WHERE EXISTS messages;
 
 This query lists `GleambookUsers` that have posted `GleambookMessages` and 
shows all authored messages for each listed user. It returns:
@@ -807,17 +807,17 @@
 WHERE EXISTS ( SELECT VALUE m
FROM GleambookMessages m
WHERE m.authorId = u.id
-);
+ );
 
 ## UNION ALL
-UNION ALL can be used to combine two input streams into one. Similar to SQL, 
there is no ordering guarantee on the output stream. However, different from 
SQL, SQL++ does not inspect what the data looks like on each input stream and 
allows heterogenity on the output stream and does not enforce schema change on 
any input streams. The following query is an example:
+UNION ALL can be used to combine two input streams into one. As in SQL, there 
is no ordering guarantee on the contents of the output stream. However, unlike 
SQL, SQL++ does not constrain what the data looks like on the input streams; in 
particular, it allows heterogenity on the input and output streams. The 
following odd but legal query is an example:
 
 # Example
 
 SELECT u.name AS uname
 FROM GleambookUsers u
 WHERE u.id = 2
-UNION ALL
+  UNION ALL
 SELECT VALUE m.message
 FROM GleambookMessages m
 WHERE authorId=2;
@@ -864,18 +864,18 @@
 
 | Feature |  SQL++ | SQL-92 |
 |--|||
-| SELECT * | Returns nested records. | Returns flattened concatenated records. 
|
-| Subquery | Returns a collection.  | The returned collection of records 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. |
-| Left outer join |  Fills in `MISSING` for non-matches.  |   Fills in 
`NULL`(s) for non-matches.|
-| Union All   | Allows heterogenous input and does not enforce schema 
changes on data. | Different input streams have to follow equivalent structural 
types and output field names for non-first input streams have to be be changed 
to be the same as that of the first input stream.
-| String literal | Double quotes or single quotes. | Single quotes only. |
-| Delimited identifiers | Backticks. | Double quotes. |
+| SELECT * | Returns nested records | Returns flattened concatenated records |
+| 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 |
+| LEFT OUTER JOIN |  Fills in `MISSING` for non-matches  |   Fills in 
`NULL`(s) for non-matches|
+| UNION ALL   | Allows heterogenous inputs and output | Input streams must 
be UNION-compatible and output field names are drawn from the first input stream
+| String literal | Double quotes or single quotes | Single quotes only |
+| Delimited identifiers | Backticks | Double quotes |
 
-For things beyond the cheat sheet, SQL++ is SQL-92 compliant.
+For things beyond this cheat sheet, SQL++ is SQL-92