Merge commit '10233dcd' from 'stabilization-f69489'
Change-Id: I246fbb4e2081e9d58c53bf560540ecd8b7864009
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 22313d0..365c6e3 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
@@ -39,7 +39,7 @@
SelectClause ::= <SELECT> ( <ALL> | <DISTINCT> )? ( SelectRegular | SelectValue )
SelectRegular ::= Projection ( "," Projection )*
SelectValue ::= ( <VALUE> | <ELEMENT> | <RAW> ) Expression
- Projection ::= ( Expression ( <AS> )? Identifier | "*" )
+ Projection ::= ( Expression ( <AS> )? Identifier | "*" | Identifier "." "*" )
FromClause ::= <FROM> FromTerm ( "," FromTerm )*
FromTerm ::= Expression (( <AS> )? Variable)?
@@ -246,7 +246,7 @@
} ]
### <a id="Select_star">SELECT *</a>
-`SELECT *` returns a object with a nested field for each input tuple.
+`SELECT *` returns an object with a nested field for each input tuple.
Each field has as its field name the name of a binding variable generated by either the `FROM` clause or `GROUP BY`
clause in the current enclosing `SELECT` statement, and its field value is the value of that binding variable.
@@ -393,6 +393,84 @@
}
} ]
+### <a id="Select_variable_star">SELECT _variable_.*</a>
+
+Whereas `SELECT *` returns all the fields bound to all the variables which are currently defined,
+the notation `SELECT c.*` returns all the fields of the object bound to variable `c`.
+The variable `c` must be bound to an object for this to work.
+
+##### Example
+
+ SELECT user.*
+ FROM GleambookUsers user;
+
+Compare this query with the first example given under [SELECT *](#Select_star).
+This query returns all users from the `GleambookUsers` dataset,
+but the `user` variable name is omitted from the results:
+
+ [
+ {
+ "id": 1,
+ "alias": "Margarita",
+ "name": "MargaritaStoddard",
+ "nickname": "Mags",
+ "userSince": "2012-08-20T10:10:00",
+ "friendIds": [
+ 2,
+ 3,
+ 6,
+ 10
+ ],
+ "employment": [
+ {
+ "organizationName": "Codetechno",
+ "start-date": "2006-08-06"
+ },
+ {
+ "organizationName": "geomedia",
+ "start-date": "2010-06-17",
+ "end-date": "2010-01-26"
+ }
+ ],
+ "gender": "F"
+ },
+ {
+ "id": 2,
+ "alias": "Isbel",
+ "name": "IsbelDull",
+ "nickname": "Izzy",
+ "userSince": "2011-01-22T10:10:00",
+ "friendIds": [
+ 1,
+ 4
+ ],
+ "employment": [
+ {
+ "organizationName": "Hexviafind",
+ "startDate": "2010-04-27"
+ }
+ ]
+ },
+ {
+ "id": 3,
+ "alias": "Emory",
+ "name": "EmoryUnk",
+ "userSince": "2012-07-10T10:10:00",
+ "friendIds": [
+ 1,
+ 5,
+ 8,
+ 9
+ ],
+ "employment": [
+ {
+ "organizationName": "geomedia",
+ "startDate": "2010-06-17",
+ "endDate": "2010-01-26"
+ }
+ ]
+ }
+ ]
### <a id="Select_distinct">SELECT DISTINCT</a>
The `DISTINCT` keyword is used to eliminate duplicate items in results. The following example shows how it works.
@@ -666,7 +744,7 @@
The join clause in the query language supports both inner joins and left outer joins from standard SQL.
### <a id="Inner_joins">Inner joins</a>
-Using a `JOIN` clause, the inner join intent from the preceeding examples can also be expressed as follows:
+Using a `JOIN` clause, the inner join intent from the preceding examples can also be expressed as follows:
##### Example
@@ -720,6 +798,22 @@
In general, SQL-style join queries can also be expressed by `UNNEST` clauses and left outer join queries can be expressed by `LEFT OUTER UNNESTs`.
+### <a id="Join_variable_scope">Variable scope in JOIN clauses</a>
+
+Variables defined by `JOIN` subclauses are not visible to other subclauses in the same `FROM` clause.
+This also applies to the `FROM` variable that starts the `JOIN` subclause.
+
+##### Example
+
+ SELECT * FROM GleambookUsers u
+ JOIN (SELECT VALUE m
+ FROM GleambookMessages m
+ WHERE m.authorId = u.id) m
+ ON u.id = m.authorId;
+
+The variable `u` defined by the `FROM` clause is not visible inside the `JOIN` subclause,
+so this query returns no results.
+
## <a id="Group_By_clauses">GROUP BY Clauses</a>
The `GROUP BY` clause generalizes standard SQL's grouping and aggregation semantics, but it also retains backward compatibility with the standard (relational) SQL `GROUP BY` and aggregation features.
@@ -839,9 +933,9 @@
The group variable in the query language makes more complex, composable, nested subqueries over a group possible, which is
important given the language's more complex data model (relative to SQL).
As a simple example of this, as we really just want the messages associated with each user, we might wish to avoid
-the "extra wrapping" of each message as the `msg` field of a object.
+the "extra wrapping" of each message as the `msg` field of an object.
(That wrapping is useful in more complex cases, but is essentially just in the way here.)
-We can use a subquery in the `SELECT` clase to tunnel through the extra nesting and produce the desired result.
+We can use a subquery in the `SELECT` clause to tunnel through the extra nesting and produce the desired result.
##### Example
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_3_resolution.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_3_resolution.md
index 1357571..c3a6a19 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_3_resolution.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/appendix_3_resolution.md
@@ -197,6 +197,9 @@
SELECT e.name, pay
ORDER BY pay
+Note that variables defined by `JOIN` subclauses are not visible to other subclauses in the same `FROM` clause.
+This also applies to the `FROM` variable that starts the `JOIN` subclause.
+
## <a id="Resolving_names">Resolving Names</a>
The process of name resolution begins with the leftmost identifier in the name.
diff --git a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
index 53ada46..9ef506e 100644
--- a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
@@ -185,7 +185,6 @@
}
private void doRun() {
- int failingLoops = 0;
while (!stopped) {
try {
int n = selector.select();
@@ -199,16 +198,8 @@
if (n > 0) {
processSelectedKeys();
}
- // reset failingLoops on a good loop
- failingLoops = 0;
} catch (Exception e) {
- int sleepSecs = (int) Math.pow(2, Math.min(11, failingLoops++));
- LOGGER.log(Level.ERROR, "Exception processing message; sleeping " + sleepSecs + " seconds", e);
- try {
- Thread.sleep(TimeUnit.SECONDS.toMillis(sleepSecs));
- } catch (InterruptedException e1) {
- Thread.currentThread().interrupt();
- }
+ LOGGER.log(Level.ERROR, "Exception processing message", e);
}
}
}