asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [02/51] [partial] incubator-asterixdb git commit: SQL++ parser: 1. refactored asterix-aql to become asterix-lang-common and asterix-lang-aql, where the former is the common part for different languages; 2. added asterix-lang-sqlpp on top of asterix-lang-
Date Fri, 30 Oct 2015 23:16:10 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_correlate2.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_correlate2.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_correlate2.sqlpp
new file mode 100644
index 0000000..eeb02cd
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_correlate2.sqlpp
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+from {{
+        {
+            'sensor' : 1,
+            'readings': {{ 0.2, 0.3 }}
+        },
+        {
+            'sensor': 2,
+            'readings': {{ 0.4, 0.2 }}
+        },
+        {
+            'sensor': 3,
+            'readings': {{}}
+        }
+}} as s left outer correlate s.readings as r
+select element r;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_outer_join.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_outer_join.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_outer_join.sqlpp
new file mode 100644
index 0000000..2169a3e
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/from_left_outer_join.sqlpp
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+use test_021;
+
+select sl.location as location, sr.gas as gas, sr.readings as readings
+from {{
+     {
+        'sensor' : 1,
+        'location': point('0.0,0.0')
+    },
+    {
+        'sensor' : 2,
+        'location': point('0.0,1.0')
+    },
+    {
+        'sensor' : 3,
+        'location': point('0.0,1.0')
+    }
+}} as sl
+left outer join {{
+     {
+        'id' : 1,
+        'sensor' : 1,
+        'gas' : 'co2',
+        'readings': {{ 0.2, 0.3 }}
+    },
+    {
+        'id' : 2,
+        'sensor' : 2,
+        'gas' : 'co2',
+        'readings': {{ 0.4, 0.2 }}
+    },
+    {
+        'id' : 3,
+        'sensor' : 2,
+        'gas' : 'no2',
+         'readings': {{ 0.1 }}
+    }
+}} as sr
+on sl.sensor = sr.sensor;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/from_where_select_clause.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/from_where_select_clause.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/from_where_select_clause.sqlpp
new file mode 100644
index 0000000..b162713
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/from_where_select_clause.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+from [ 10, 20, 30, 10, 10 ] as x
+where x = 10
+select  element x;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl.sqlpp
new file mode 100644
index 0000000..e0d13a4
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+declare function add(a,b) {
+(a + b)
+};
+declare function minus(a,b) {
+(a - b)
+};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl1.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl1.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl1.sqlpp
new file mode 100644
index 0000000..2d1d8af
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl1.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+declare function calculate(events) {
+(
+    select element {'sig_name':sig_name,'total_count':sig_sponsorship_count,'chapter_breakdown':by_chapter}
+    from  events as event,
+          event.sponsoring_sigs as sponsor
+    with  es as {'event':event,'sponsor':sponsor}
+    group by sponsor.sig_name as sig_name
+    with  sig_sponsorship_count as count(es),
+          by_chapter as (
+          select element {'chapter_name':chapter_name,'escount':count(es)}
+          from  es as e
+          group by e.sponsor.chapter_name as chapter_name
+      )
+    order by sig_sponsorship_count desc
+    limit 5
+)
+};
+with  result as calculate(Events)
+select element result
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl2.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl2.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl2.sqlpp
new file mode 100644
index 0000000..ddda48e
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl2.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+declare function GT(a,b) {
+if ((a > b))
+    then true
+    else false
+};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl3.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl3.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl3.sqlpp
new file mode 100644
index 0000000..da8ab9a
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/functionDecl3.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+declare function "function with spaces"(a,b) {
+'string with spaces'
+};
+"function with spaces"(1,2);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/groupby_clause_count.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/groupby_clause_count.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/groupby_clause_count.sqlpp
new file mode 100644
index 0000000..caa1a1e
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/groupby_clause_count.sqlpp
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+from {{
+        {
+            'gas' : 'co',
+            'num' : 0.1
+        },
+        {
+            'gas' : 'co',
+            'num' : 0.2
+        },
+         {
+            'gas' : 'co',
+            'num' : 0.3
+        },
+        {
+            'gas' : 'co2',
+            'num' : 0.4
+        },
+         {
+            'gas' : 'no2',
+            'num' : 0.5
+        },
+        {
+            'gas' : 'no2',
+            'num' : 0.6
+        }
+}} AS r
+group by r.gas as g
+select element count(r);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/load-del-dataset.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/load-del-dataset.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/load-del-dataset.sqlpp
new file mode 100644
index 0000000..d08a13b
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/load-del-dataset.sqlpp
@@ -0,0 +1,53 @@
+/*
+ * 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  database demo0927 if exists;
+create  database demo0927;
+
+use demo0927;
+
+
+create type demo0927.CustomerType as
+ closed {
+  cid : int32,
+  name : string,
+  age : int32?,
+  address : AddressType?,
+  lastorder : {
+      oid : int32,
+      total : float
+  }
+
+}
+
+create type demo0927.AddressType as
+ closed {
+  number : int32,
+  street : string,
+  city : string
+}
+
+create  nodegroup group1 if not exists  on 
+    nc1,
+    nc2
+;
+create  table Customers(CustomerType) primary key cid on group1;
+
+load  table Customers using "org.apache.asterix.external.dataset.adapter.NCFileSystemAdapter" (("path"="nc1:///tmp/customerData.json"),("format"="adm")) pre-sorted;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/mulOperator.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/mulOperator.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/mulOperator.sqlpp
new file mode 100644
index 0000000..c2e6b6f
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/mulOperator.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+1 + 2 * 3 - 4;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR.sqlpp
new file mode 100644
index 0000000..c5719ec
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR.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.
+ */
+
+select element {'name':user.name}
+from  (
+    with  data as User
+    select element data
+) as user
+where some i in user.interests satisfies (i = 'movies')
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR1.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR1.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR1.sqlpp
new file mode 100644
index 0000000..704f348
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR1.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+select element (
+    select element k
+    from  if ((i > j))
+        then i
+        else j as k
+    where (k < 10)
+)
+from  [1,2,30,40] as i,
+      {{4,5,6}} as j
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR2.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR2.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR2.sqlpp
new file mode 100644
index 0000000..0abbf80
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR2.sqlpp
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+select element (
+    select element k
+    from  if ((i > j))
+        then i
+        else j as k
+    where (k < 10)
+)
+from  [1,2,30,(
+        select element tmp
+        from  number as tmp
+    )] as i,
+      {{4,5,6}} as j
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR3.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR3.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR3.sqlpp
new file mode 100644
index 0000000..f82a3b6
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFLWOGR3.sqlpp
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+select element {'sig_name':sig_name,'total_count':sig_sponsorship_count,'chapter_breakdown':by_chapter}
+from  Event as event,
+      event.sponsoring_sigs as sponsor
+with  es as {'event':event,'sponsor':sponsor}
+group by sponsor.sig_name as sig_name
+with  sig_sponsorship_count as count(es),
+      by_chapter as (
+      select element {'chapter_name':chapter_name,'escount':count(es)}
+      from  es as e
+      group by e.sponsor.chapter_name as chapter_name
+  )
+order by sig_sponsorship_count desc
+limit 5 offset 2
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFor.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFor.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFor.sqlpp
new file mode 100644
index 0000000..bee2f90
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/nestedFor.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+select element {'name':user.name,'movie':mv.movie}
+from  User as user,
+      Movie as mv
+where some i in user.interests satisfies (i.movie = mv.movie)
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/numberInFieldAccessor.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/numberInFieldAccessor.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/numberInFieldAccessor.sqlpp
new file mode 100644
index 0000000..d65197a
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/numberInFieldAccessor.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+select element {'name':user.name,'movie':mv.movie}
+from  User as user,
+      Movie as mv
+where some i in user.interests satisfies (i.movie = mv.movie[2])
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/select_clause_sugar.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/select_clause_sugar.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/select_clause_sugar.sqlpp
new file mode 100644
index 0000000..bddd911
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/select_clause_sugar.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+select x as "value"
+from [ 10, 20, 30, 10, 10 ] as x
+where x = 10;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/select_from_where_sugar.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/select_from_where_sugar.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/select_from_where_sugar.sqlpp
new file mode 100644
index 0000000..e64afd2
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/select_from_where_sugar.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+select element x
+from [ 10, 20, 30, 10, 10 ] as x
+where x = 10;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav.sqlpp
new file mode 100644
index 0000000..6ebd598
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+{ 'id' : 1 }.name;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_delimited_identifier.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_delimited_identifier.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_delimited_identifier.sqlpp
new file mode 100644
index 0000000..df06b40
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_delimited_identifier.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+{'e' : 1 }."e";

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_mutiple_steps.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_mutiple_steps.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_mutiple_steps.sqlpp
new file mode 100644
index 0000000..486a976
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_mutiple_steps.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+{'n' : 1, 'a1 a2' : { 'n' : 2, 'b1 b2' : {'n' : 3}}}."a1 a2"."b1 b2".n;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_quotes.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_quotes.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_quotes.sqlpp
new file mode 100644
index 0000000..10f97ab
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/tuple_nav_quotes.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+{ 'author-id' : 2 }."author-id";

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/union.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/union.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/union.sqlpp
new file mode 100644
index 0000000..56464ba
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/union.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+
+select element l
+from  foo1() as l
+union
+select element l
+from  foo2() as l
+union
+select element l
+from  foo3() as l;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/utf-8.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/utf-8.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/utf-8.sqlpp
new file mode 100644
index 0000000..ca2640f
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/utf-8.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+string_to_codepoint('äöß');
+string_to_codepoint('迎');
+/* currently fails (issue 277) string-to-codepoint("欢")  */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/variables.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/variables.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/variables.sqlpp
new file mode 100644
index 0000000..7611e3e
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/variables.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+with  a as 1,
+      b as 1
+select element (b - a)
+;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/queries_sqlpp/where_clause.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/queries_sqlpp/where_clause.sqlpp b/asterix-app/src/test/resources/parserts/queries_sqlpp/where_clause.sqlpp
new file mode 100644
index 0000000..6a5e766
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/queries_sqlpp/where_clause.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+use test;
+
+from sensors AS r
+where r.reading = 0.2
+select element r.reading;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/1.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/1.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/1.ast
new file mode 100644
index 0000000..5615495
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/1.ast
@@ -0,0 +1,36 @@
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [name]
+    :
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=name
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [User]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+Where
+  QuantifiedExpression SOME [
+    [Variable [ Name=i ]
+    In
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=interests
+      ]
+    ]
+    Satifies [
+      OperatorExpr [
+        Variable [ Name=i ]
+        =
+        LiteralExpr [STRING] [movies]
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/2.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/2.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/2.ast
new file mode 100644
index 0000000..f861640
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/2.ast
@@ -0,0 +1,112 @@
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [sig_name]
+    :
+    Variable [ Name=sig_name ]
+  )
+  (
+    LiteralExpr [STRING] [total_count]
+    :
+    Variable [ Name=sig_sponsorship_count ]
+  )
+  (
+    LiteralExpr [STRING] [chapter_breakdown]
+    :
+    Variable [ Name=by_chapter ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Event]
+  ]
+  AS
+  Variable [ Name=event ]
+,
+  FieldAccessor [
+    Variable [ Name=event ]
+    Field=sponsoring_sigs
+  ]
+  AS
+  Variable [ Name=sponsor ]
+]
+LetVariable [ Name=es ]
+  :=
+  RecordConstructor [
+    (
+      LiteralExpr [STRING] [event]
+      :
+      Variable [ Name=event ]
+    )
+    (
+      LiteralExpr [STRING] [sponsor]
+      :
+      Variable [ Name=sponsor ]
+    )
+  ]
+Groupby
+  Variable [ Name=sig_name ]
+  :=
+  FieldAccessor [
+    Variable [ Name=sponsor ]
+    Field=sig_name
+  ]
+  With
+  Variable [ Name=es ]
+  Variable [ Name=sponsor ]
+  Variable [ Name=event ]
+
+LetVariable [ Name=sig_sponsorship_count ]
+  :=
+  FunctionCall null.count@1[
+    Variable [ Name=es ]
+  ]
+LetVariable [ Name=by_chapter ]
+  :=
+  (
+    SELECT ELEMENT [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [chapter_name]
+        :
+        Variable [ Name=chapter_name ]
+      )
+      (
+        LiteralExpr [STRING] [escount]
+        :
+        FunctionCall null.count@1[
+          Variable [ Name=es ]
+        ]
+      )
+    ]
+    ]
+    FROM [      Variable [ Name=es ]
+      AS
+      Variable [ Name=e ]
+    ]
+    Groupby
+      Variable [ Name=chapter_name ]
+      :=
+      FieldAccessor [
+        FieldAccessor [
+          Variable [ Name=e ]
+          Field=sponsor
+        ]
+        Field=chapter_name
+      ]
+      With
+      Variable [ Name=e ]
+      Variable [ Name=by_chapter ]
+      Variable [ Name=sig_sponsorship_count ]
+      Variable [ Name=es ]
+      Variable [ Name=sponsor ]
+      Variable [ Name=event ]
+
+  )
+Orderby
+  Variable [ Name=sig_sponsorship_count ]
+  DESC
+
+Limit
+  LiteralExpr [LONG] [5]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/4.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/4.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/4.ast
new file mode 100644
index 0000000..e739c37
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/4.ast
@@ -0,0 +1,67 @@
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [similar_sigs]
+    :
+    Variable [ Name=similar_sigs ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [SIGroup]
+  ]
+  AS
+  Variable [ Name=sig ]
+]
+LetVariable [ Name=similar_sigs ]
+  :=
+  (
+    SELECT ELEMENT [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sig_name]
+        :
+        FieldAccessor [
+          Variable [ Name=similar_sig ]
+          Field=name
+        ]
+      )
+    ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [SIGroup]
+      ]
+      AS
+      Variable [ Name=similar_sig ]
+    ]
+    Where
+      OperatorExpr [
+        OperatorExpr [
+          Variable [ Name=similar_sig ]
+          !=
+          Variable [ Name=sig ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            Variable [ Name=similar_sig ]
+            Field=interests
+          ]
+          ~=
+          FieldAccessor [
+            Variable [ Name=sig ]
+            Field=interests
+          ]
+        ]
+      ]
+  )
+Where
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=sig ]
+      Field=name
+    ]
+    =
+    LiteralExpr [STRING] [Movie-Watchers]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/5.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/5.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/5.ast
new file mode 100644
index 0000000..73f0cd6
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/5.ast
@@ -0,0 +1,121 @@
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [collocated_evnets]
+    :
+    Variable [ Name=collocated_events ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Event]
+  ]
+  AS
+  Variable [ Name=event ]
+]
+LetVariable [ Name=collocated_events ]
+  :=
+  (
+    SELECT ELEMENT [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [event_name]
+        :
+        FieldAccessor [
+          Variable [ Name=collocated_event ]
+          Field=name
+        ]
+      )
+    ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [Events]
+      ]
+      AS
+      Variable [ Name=collocated_event ]
+    ]
+    Where
+      OperatorExpr [
+        OperatorExpr [
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=collocated_event ]
+              Field=location
+            ]
+            Field=street
+          ]
+          ~=
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=event ]
+              Field=location
+            ]
+            Field=street
+          ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=collocated_event ]
+              Field=location
+            ]
+            Field=city
+          ]
+          =
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=event ]
+              Field=location
+            ]
+            Field=city
+          ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=collocated_event ]
+              Field=location
+            ]
+            Field=state
+          ]
+          =
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=event ]
+              Field=location
+            ]
+            Field=state
+          ]
+        ]
+        and
+        OperatorExpr [
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=collocated_event ]
+              Field=location
+            ]
+            Field=zip
+          ]
+          =
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=event ]
+              Field=location
+            ]
+            Field=zip
+          ]
+        ]
+      ]
+  )
+Where
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=event ]
+      Field=name
+    ]
+    =
+    LiteralExpr [STRING] [The Night of the Ad Eaters, 29th edition]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/6.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/6.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/6.ast
new file mode 100644
index 0000000..dcbd485
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/6.ast
@@ -0,0 +1,83 @@
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [user_name]
+    :
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=name
+    ]
+  )
+  (
+    LiteralExpr [STRING] [similar_users]
+    :
+    Variable [ Name=similar_users ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Users]
+  ]
+  AS
+  Variable [ Name=user ]
+]
+LetVariable [ Name=similar_users ]
+  :=
+  (
+    SELECT ELEMENT [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [user_name]
+        :
+        FieldAccessor [
+          Variable [ Name=similar_user ]
+          Field=name
+        ]
+      )
+      (
+        LiteralExpr [STRING] [similarity]
+        :
+        Variable [ Name=similarity ]
+      )
+    ]
+    ]
+    FROM [      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [Users]
+      ]
+      AS
+      Variable [ Name=similar_user ]
+    ]
+    LetVariable [ Name=similarity ]
+      :=
+      FunctionCall null.jaccard_similarity@2[
+        FieldAccessor [
+          Variable [ Name=user ]
+          Field=interests
+        ]
+        FieldAccessor [
+          Variable [ Name=similar_user ]
+          Field=interests
+        ]
+      ]
+    Where
+      OperatorExpr [
+        OperatorExpr [
+          Variable [ Name=user ]
+          !=
+          Variable [ Name=similar_user ]
+        ]
+        and
+        OperatorExpr [
+          Variable [ Name=similarity ]
+          >=
+          LiteralExpr [DOUBLE] [0.75]
+        ]
+      ]
+    Orderby
+      Variable [ Name=similarity ]
+      DESC
+
+    Limit
+      LiteralExpr [LONG] [10]
+  )

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ANYInFieldAccessor.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ANYInFieldAccessor.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ANYInFieldAccessor.ast
new file mode 100644
index 0000000..2f60cbc
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ANYInFieldAccessor.ast
@@ -0,0 +1,59 @@
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [name]
+    :
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=name
+    ]
+  )
+  (
+    LiteralExpr [STRING] [movie]
+    :
+    FieldAccessor [
+      Variable [ Name=mv ]
+      Field=movie
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [User]
+  ]
+  AS
+  Variable [ Name=user ]
+,
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [Movie]
+  ]
+  AS
+  Variable [ Name=mv ]
+]
+Where
+  QuantifiedExpression SOME [
+    [Variable [ Name=i ]
+    In
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=interests
+      ]
+    ]
+    Satifies [
+      OperatorExpr [
+        FieldAccessor [
+          Variable [ Name=i ]
+          Field=movie
+        ]
+        =
+        IndexAccessor [
+          FieldAccessor [
+            Variable [ Name=mv ]
+            Field=movie
+          ]
+          Index: ANY
+        ]
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfInFLOWGR.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfInFLOWGR.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfInFLOWGR.ast
new file mode 100644
index 0000000..4b9e932
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfInFLOWGR.ast
@@ -0,0 +1,32 @@
+Query:
+SELECT ELEMENT [
+IfExpr [
+  Condition:
+    OperatorExpr [
+      Variable [ Name=i ]
+      >
+      Variable [ Name=j ]
+    ]
+  Then:
+    Variable [ Name=i ]
+  Else:
+    Variable [ Name=j ]
+]
+]
+FROM [  OrderedListConstructor [
+    LiteralExpr [LONG] [1]
+    LiteralExpr [LONG] [2]
+    LiteralExpr [LONG] [30]
+    LiteralExpr [LONG] [40]
+  ]
+  AS
+  Variable [ Name=i ]
+,
+  UnorderedListConstructor [
+    LiteralExpr [LONG] [4]
+    LiteralExpr [LONG] [5]
+    LiteralExpr [LONG] [6]
+  ]
+  AS
+  Variable [ Name=j ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfThenElse.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfThenElse.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfThenElse.ast
new file mode 100644
index 0000000..8c3462e
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/IfThenElse.ast
@@ -0,0 +1,15 @@
+Query:
+SELECT ELEMENT [
+IfExpr [
+  Condition:
+    OperatorExpr [
+      LiteralExpr [LONG] [2]
+      >
+      LiteralExpr [LONG] [1]
+    ]
+  Then:
+    LiteralExpr [LONG] [20]
+  Else:
+    LiteralExpr [LONG] [10]
+]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/LetFor.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/LetFor.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/LetFor.ast
new file mode 100644
index 0000000..b9bf49a
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/LetFor.ast
@@ -0,0 +1,39 @@
+Query:
+LetVariable [ Name=users ]
+  :=
+  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [User]
+  ]
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [name]
+    :
+    FieldAccessor [
+      Variable [ Name=user ]
+      Field=name
+    ]
+  )
+]
+]
+FROM [  Variable [ Name=users ]
+  AS
+  Variable [ Name=user ]
+]
+Where
+  QuantifiedExpression SOME [
+    [Variable [ Name=i ]
+    In
+      FieldAccessor [
+        Variable [ Name=user ]
+        Field=interests
+      ]
+    ]
+    Satifies [
+      OperatorExpr [
+        Variable [ Name=i ]
+        =
+        LiteralExpr [STRING] [movies]
+      ]
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ListConstructor.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ListConstructor.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ListConstructor.ast
new file mode 100644
index 0000000..3d3a387
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/ListConstructor.ast
@@ -0,0 +1,24 @@
+Query:
+SELECT ELEMENT [
+OperatorExpr [
+  Variable [ Name=i ]
+  +
+  Variable [ Name=j ]
+]
+]
+FROM [  OrderedListConstructor [
+    LiteralExpr [LONG] [1]
+    LiteralExpr [LONG] [2]
+    LiteralExpr [LONG] [3]
+  ]
+  AS
+  Variable [ Name=i ]
+,
+  UnorderedListConstructor [
+    LiteralExpr [LONG] [4]
+    LiteralExpr [LONG] [5]
+    LiteralExpr [LONG] [6]
+  ]
+  AS
+  Variable [ Name=j ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/addOperator.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/addOperator.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/addOperator.ast
new file mode 100644
index 0000000..106d1f1
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/addOperator.ast
@@ -0,0 +1,8 @@
+Query:
+OperatorExpr [
+  LiteralExpr [LONG] [1]
+  +
+  LiteralExpr [LONG] [1]
+  -
+  LiteralExpr [LONG] [2]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias.ast
new file mode 100644
index 0000000..26addaa
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias.ast
@@ -0,0 +1,77 @@
+Query:
+SELECT [
+FunctionCall null.SQRT@1[
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=t ]
+      Field=a
+    ]
+    *
+    FieldAccessor [
+      Variable [ Name=t ]
+      Field=b
+    ]
+  ]
+]
+root
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [tbl_name]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Groupby
+  FunctionCall null.SQRT@1[
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=a
+      ]
+      *
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=b
+      ]
+    ]
+  ]
+  With
+  Variable [ Name=t ]
+
+LetVariable [ Name=u ]
+  :=
+  FunctionCall null.SQRT@1[
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=a
+      ]
+      *
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=b
+      ]
+    ]
+  ]
+ HAVING
+  OperatorExpr [
+    FunctionCall null.SQRT@1[
+      OperatorExpr [
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=a
+        ]
+        *
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=b
+        ]
+      ]
+    ]
+    >
+    LiteralExpr [LONG] [0]
+  ]
+Orderby
+  Variable [ Name=u ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias2.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias2.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias2.ast
new file mode 100644
index 0000000..90d32cc
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias2.ast
@@ -0,0 +1,54 @@
+Query:
+SELECT [
+FunctionCall null.SQRT@1[
+  OperatorExpr [
+    FieldAccessor [
+      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [t]
+      ]
+      Field=a
+    ]
+    *
+    FieldAccessor [
+      FunctionCall Metadata.dataset@1[
+        LiteralExpr [STRING] [t]
+      ]
+      Field=b
+    ]
+  ]
+]
+root
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [tbl_name]
+  ]
+  AS
+  Variable [ Name=root ]
+]
+Groupby
+  FieldAccessor [
+    Variable [ Name=root ]
+    Field=id
+  ]
+  With
+  Variable [ Name=root ]
+
+LetVariable [ Name=u ]
+  :=
+  FieldAccessor [
+    Variable [ Name=root ]
+    Field=time
+  ]
+ HAVING
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=root ]
+      Field=orders
+    ]
+    >
+    LiteralExpr [LONG] [0]
+  ]
+Orderby
+  Variable [ Name=u ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias3.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias3.ast
new file mode 100644
index 0000000..6b5693b
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/columnalias3.ast
@@ -0,0 +1,82 @@
+Query:
+SELECT ELEMENT [
+RecordConstructor [
+  (
+    LiteralExpr [STRING] [root]
+    :
+    FunctionCall null.SQRT@1[
+      OperatorExpr [
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=a
+        ]
+        *
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=b
+        ]
+      ]
+    ]
+  )
+]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [tbl_name]
+  ]
+  AS
+  Variable [ Name=t ]
+]
+Groupby
+  FunctionCall null.SQRT@1[
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=a
+      ]
+      *
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=b
+      ]
+    ]
+  ]
+  With
+  Variable [ Name=t ]
+
+LetVariable [ Name=u ]
+  :=
+  FunctionCall null.SQRT@1[
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=a
+      ]
+      *
+      FieldAccessor [
+        Variable [ Name=t ]
+        Field=b
+      ]
+    ]
+  ]
+ HAVING
+  OperatorExpr [
+    FunctionCall null.SQRT@1[
+      OperatorExpr [
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=a
+        ]
+        *
+        FieldAccessor [
+          Variable [ Name=t ]
+          Field=b
+        ]
+      ]
+    ]
+    >
+    LiteralExpr [LONG] [0]
+  ]
+Orderby
+  Variable [ Name=u ]
+  ASC
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/constant.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/constant.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/constant.ast
new file mode 100644
index 0000000..78a13aa
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/constant.ast
@@ -0,0 +1,6 @@
+Query:
+OperatorExpr [
+  NEGATIVE LiteralExpr [LONG] [1]
+  +
+  LiteralExpr [LONG] [1]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/createInternalDataSet.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/createInternalDataSet.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/createInternalDataSet.ast
new file mode 100644
index 0000000..cd320dd
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/createInternalDataSet.ast
@@ -0,0 +1,2 @@
+DatasetDecl ds1(someType) partitioned by [[id]]
+DatasetDecl ds2(someType) partitioned by [[id]]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/del-dataset.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/del-dataset.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/del-dataset.ast
new file mode 100644
index 0000000..849a30c
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/del-dataset.ast
@@ -0,0 +1,22 @@
+DataverseUse demo0927
+TypeDecl CustomerType [
+  closed RecordType {
+    cid : int32,
+    name : string,
+    age : int32?,
+    address : AddressType?,
+    lastorder :       open RecordType {
+        oid : int32,
+        total : float
+      }
+
+  }
+]
+TypeDecl AddressType [
+  closed RecordType {
+    number : int32,
+    street : string,
+    city : string
+  }
+]
+DatasetDecl Customers(CustomerType) partitioned by [[cid]]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/fieldAccessor.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/fieldAccessor.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/fieldAccessor.ast
new file mode 100644
index 0000000..40bc769
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/fieldAccessor.ast
@@ -0,0 +1,23 @@
+Query:
+LetVariable [ Name=bla ]
+  :=
+  RecordConstructor [
+    (
+      LiteralExpr [STRING] [name]
+      :
+      LiteralExpr [STRING] [value]
+    )
+  ]
+SELECT ELEMENT [
+OperatorExpr [
+  FieldAccessor [
+    Variable [ Name=bla ]
+    Field=name
+  ]
+  =
+  FieldAccessor [
+    Variable [ Name=bla ]
+    Field=name
+  ]
+]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_array.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_array.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_array.ast
new file mode 100644
index 0000000..192bf6e
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_array.ast
@@ -0,0 +1,12 @@
+Query:
+SELECT ELEMENT [
+Variable [ Name=x ]
+]
+FROM [  OrderedListConstructor [
+    LiteralExpr [LONG] [10]
+    LiteralExpr [LONG] [20]
+    LiteralExpr [LONG] [30]
+  ]
+  AS
+  Variable [ Name=x ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_bag.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_bag.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_bag.ast
new file mode 100644
index 0000000..e768f7e
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_collection_bag.ast
@@ -0,0 +1,12 @@
+Query:
+SELECT ELEMENT [
+Variable [ Name=x ]
+]
+FROM [  UnorderedListConstructor [
+    LiteralExpr [LONG] [10]
+    LiteralExpr [LONG] [20]
+    LiteralExpr [LONG] [30]
+  ]
+  AS
+  Variable [ Name=x ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_correlate.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_correlate.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_correlate.ast
new file mode 100644
index 0000000..b354122
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_correlate.ast
@@ -0,0 +1,18 @@
+DataverseUse test
+Query:
+SELECT ELEMENT [
+Variable [ Name=r ]
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [sensors]
+  ]
+  AS
+  Variable [ Name=s ]
+  INNER UNNEST
+    FieldAccessor [
+      Variable [ Name=s ]
+      Field=readings
+    ]
+     AS
+    Variable [ Name=r ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_flatten.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_flatten.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_flatten.ast
new file mode 100644
index 0000000..7668550
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_flatten.ast
@@ -0,0 +1,24 @@
+DataverseUse test
+Query:
+SELECT [
+FieldAccessor [
+  Variable [ Name=s ]
+  Field=sensor
+]
+sensor
+Variable [ Name=r ]
+reading
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [sensors]
+  ]
+  AS
+  Variable [ Name=s ]
+,
+  FieldAccessor [
+    Variable [ Name=s ]
+    Field=readings
+  ]
+  AS
+  Variable [ Name=r ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_join.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_join.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_join.ast
new file mode 100644
index 0000000..2a3a239
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_inner_join.ast
@@ -0,0 +1,42 @@
+DataverseUse test
+Query:
+SELECT [
+FieldAccessor [
+  Variable [ Name=m ]
+  Field=sensor
+]
+sensor
+FieldAccessor [
+  Variable [ Name=s ]
+  Field=readings
+]
+readings
+FieldAccessor [
+  Variable [ Name=m ]
+  Field=location
+]
+location
+]
+FROM [  FunctionCall Metadata.dataset@1[
+    LiteralExpr [STRING] [sensors]
+  ]
+  AS
+  Variable [ Name=s ]
+  INNER JOIN
+    FunctionCall Metadata.dataset@1[
+      LiteralExpr [STRING] [sensorMeta]
+    ]
+    AS
+    Variable [ Name=m ]
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=s ]
+        Field=sensor
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=m ]
+        Field=sensor
+      ]
+    ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate.ast
new file mode 100644
index 0000000..9fd948a
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate.ast
@@ -0,0 +1,157 @@
+DataverseUse test_022
+Query:
+SELECT [
+FieldAccessor [
+  Variable [ Name=sl ]
+  Field=location
+]
+location
+FieldAccessor [
+  Variable [ Name=sr ]
+  Field=gas
+]
+gas
+FieldAccessor [
+  Variable [ Name=sr ]
+  Field=readings
+]
+readings
+]
+FROM [  UnorderedListConstructor [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [1]
+      )
+      (
+        LiteralExpr [STRING] [location]
+        :
+        FunctionCall test_022.point@1[
+          LiteralExpr [STRING] [0.0,0.0]
+        ]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [2]
+      )
+      (
+        LiteralExpr [STRING] [location]
+        :
+        FunctionCall test_022.point@1[
+          LiteralExpr [STRING] [0.0,1.0]
+        ]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [3]
+      )
+      (
+        LiteralExpr [STRING] [location]
+        :
+        FunctionCall test_022.point@1[
+          LiteralExpr [STRING] [0.0,1.0]
+        ]
+      )
+    ]
+  ]
+  AS
+  Variable [ Name=sl ]
+  LEFTOUTER UNNEST
+    UnorderedListConstructor [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [id]
+          :
+          LiteralExpr [LONG] [1]
+        )
+        (
+          LiteralExpr [STRING] [sensor]
+          :
+          LiteralExpr [LONG] [1]
+        )
+        (
+          LiteralExpr [STRING] [gas]
+          :
+          LiteralExpr [STRING] [co2]
+        )
+        (
+          LiteralExpr [STRING] [readings]
+          :
+          UnorderedListConstructor [
+            LiteralExpr [DOUBLE] [0.2]
+            LiteralExpr [DOUBLE] [0.3]
+          ]
+        )
+      ]
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [id]
+          :
+          LiteralExpr [LONG] [2]
+        )
+        (
+          LiteralExpr [STRING] [sensor]
+          :
+          LiteralExpr [LONG] [2]
+        )
+        (
+          LiteralExpr [STRING] [gas]
+          :
+          LiteralExpr [STRING] [co2]
+        )
+        (
+          LiteralExpr [STRING] [readings]
+          :
+          UnorderedListConstructor [
+            LiteralExpr [DOUBLE] [0.4]
+            LiteralExpr [DOUBLE] [0.2]
+          ]
+        )
+      ]
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [id]
+          :
+          LiteralExpr [LONG] [3]
+        )
+        (
+          LiteralExpr [STRING] [sensor]
+          :
+          LiteralExpr [LONG] [2]
+        )
+        (
+          LiteralExpr [STRING] [gas]
+          :
+          LiteralExpr [STRING] [no2]
+        )
+        (
+          LiteralExpr [STRING] [readings]
+          :
+          UnorderedListConstructor [
+            LiteralExpr [DOUBLE] [0.1]
+          ]
+        )
+      ]
+    ]
+     AS
+    Variable [ Name=sr ]
+]
+Where
+  OperatorExpr [
+    FieldAccessor [
+      Variable [ Name=sl ]
+      Field=sensor
+    ]
+    =
+    FieldAccessor [
+      Variable [ Name=sr ]
+      Field=sensor
+    ]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate2.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate2.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate2.ast
new file mode 100644
index 0000000..9ace3b5
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_correlate2.ast
@@ -0,0 +1,59 @@
+Query:
+SELECT ELEMENT [
+Variable [ Name=r ]
+]
+FROM [  UnorderedListConstructor [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [1]
+      )
+      (
+        LiteralExpr [STRING] [readings]
+        :
+        UnorderedListConstructor [
+          LiteralExpr [DOUBLE] [0.2]
+          LiteralExpr [DOUBLE] [0.3]
+        ]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [2]
+      )
+      (
+        LiteralExpr [STRING] [readings]
+        :
+        UnorderedListConstructor [
+          LiteralExpr [DOUBLE] [0.4]
+          LiteralExpr [DOUBLE] [0.2]
+        ]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [3]
+      )
+      (
+        LiteralExpr [STRING] [readings]
+        :
+        UnorderedListConstructor [
+        ]
+      )
+    ]
+  ]
+  AS
+  Variable [ Name=s ]
+  LEFTOUTER UNNEST
+    FieldAccessor [
+      Variable [ Name=s ]
+      Field=readings
+    ]
+     AS
+    Variable [ Name=r ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_outer_join.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_outer_join.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_outer_join.ast
new file mode 100644
index 0000000..69745a5
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_left_outer_join.ast
@@ -0,0 +1,156 @@
+DataverseUse test_021
+Query:
+SELECT [
+FieldAccessor [
+  Variable [ Name=sl ]
+  Field=location
+]
+location
+FieldAccessor [
+  Variable [ Name=sr ]
+  Field=gas
+]
+gas
+FieldAccessor [
+  Variable [ Name=sr ]
+  Field=readings
+]
+readings
+]
+FROM [  UnorderedListConstructor [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [1]
+      )
+      (
+        LiteralExpr [STRING] [location]
+        :
+        FunctionCall test_021.point@1[
+          LiteralExpr [STRING] [0.0,0.0]
+        ]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [2]
+      )
+      (
+        LiteralExpr [STRING] [location]
+        :
+        FunctionCall test_021.point@1[
+          LiteralExpr [STRING] [0.0,1.0]
+        ]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sensor]
+        :
+        LiteralExpr [LONG] [3]
+      )
+      (
+        LiteralExpr [STRING] [location]
+        :
+        FunctionCall test_021.point@1[
+          LiteralExpr [STRING] [0.0,1.0]
+        ]
+      )
+    ]
+  ]
+  AS
+  Variable [ Name=sl ]
+  LEFTOUTER JOIN
+    UnorderedListConstructor [
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [id]
+          :
+          LiteralExpr [LONG] [1]
+        )
+        (
+          LiteralExpr [STRING] [sensor]
+          :
+          LiteralExpr [LONG] [1]
+        )
+        (
+          LiteralExpr [STRING] [gas]
+          :
+          LiteralExpr [STRING] [co2]
+        )
+        (
+          LiteralExpr [STRING] [readings]
+          :
+          UnorderedListConstructor [
+            LiteralExpr [DOUBLE] [0.2]
+            LiteralExpr [DOUBLE] [0.3]
+          ]
+        )
+      ]
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [id]
+          :
+          LiteralExpr [LONG] [2]
+        )
+        (
+          LiteralExpr [STRING] [sensor]
+          :
+          LiteralExpr [LONG] [2]
+        )
+        (
+          LiteralExpr [STRING] [gas]
+          :
+          LiteralExpr [STRING] [co2]
+        )
+        (
+          LiteralExpr [STRING] [readings]
+          :
+          UnorderedListConstructor [
+            LiteralExpr [DOUBLE] [0.4]
+            LiteralExpr [DOUBLE] [0.2]
+          ]
+        )
+      ]
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [id]
+          :
+          LiteralExpr [LONG] [3]
+        )
+        (
+          LiteralExpr [STRING] [sensor]
+          :
+          LiteralExpr [LONG] [2]
+        )
+        (
+          LiteralExpr [STRING] [gas]
+          :
+          LiteralExpr [STRING] [no2]
+        )
+        (
+          LiteralExpr [STRING] [readings]
+          :
+          UnorderedListConstructor [
+            LiteralExpr [DOUBLE] [0.1]
+          ]
+        )
+      ]
+    ]
+    AS
+    Variable [ Name=sr ]
+    OperatorExpr [
+      FieldAccessor [
+        Variable [ Name=sl ]
+        Field=sensor
+      ]
+      =
+      FieldAccessor [
+        Variable [ Name=sr ]
+        Field=sensor
+      ]
+    ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_where_select_clause.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_where_select_clause.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_where_select_clause.ast
new file mode 100644
index 0000000..bb0c8b5
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/from_where_select_clause.ast
@@ -0,0 +1,20 @@
+Query:
+SELECT ELEMENT [
+Variable [ Name=x ]
+]
+FROM [  OrderedListConstructor [
+    LiteralExpr [LONG] [10]
+    LiteralExpr [LONG] [20]
+    LiteralExpr [LONG] [30]
+    LiteralExpr [LONG] [10]
+    LiteralExpr [LONG] [10]
+  ]
+  AS
+  Variable [ Name=x ]
+]
+Where
+  OperatorExpr [
+    Variable [ Name=x ]
+    =
+    LiteralExpr [LONG] [10]
+  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl.ast
new file mode 100644
index 0000000..e025413
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl.ast
@@ -0,0 +1,16 @@
+FunctionDecl add([a, b]) {
+  OperatorExpr [
+    Variable [ Name=a ]
+    +
+    Variable [ Name=b ]
+  ]
+}
+
+FunctionDecl minus([a, b]) {
+  OperatorExpr [
+    Variable [ Name=a ]
+    -
+    Variable [ Name=b ]
+  ]
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl1.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl1.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl1.ast
new file mode 100644
index 0000000..36f35dd
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl1.ast
@@ -0,0 +1,114 @@
+FunctionDecl calculate([events]) {
+  (
+    SELECT ELEMENT [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [sig_name]
+        :
+        Variable [ Name=sig_name ]
+      )
+      (
+        LiteralExpr [STRING] [total_count]
+        :
+        Variable [ Name=sig_sponsorship_count ]
+      )
+      (
+        LiteralExpr [STRING] [chapter_breakdown]
+        :
+        Variable [ Name=by_chapter ]
+      )
+    ]
+    ]
+    FROM [      Variable [ Name=events ]
+      AS
+      Variable [ Name=event ]
+,
+      FieldAccessor [
+        Variable [ Name=event ]
+        Field=sponsoring_sigs
+      ]
+      AS
+      Variable [ Name=sponsor ]
+    ]
+    LetVariable [ Name=es ]
+      :=
+      RecordConstructor [
+        (
+          LiteralExpr [STRING] [event]
+          :
+          Variable [ Name=event ]
+        )
+        (
+          LiteralExpr [STRING] [sponsor]
+          :
+          Variable [ Name=sponsor ]
+        )
+      ]
+    Groupby
+      Variable [ Name=sig_name ]
+      :=
+      FieldAccessor [
+        Variable [ Name=sponsor ]
+        Field=sig_name
+      ]
+
+    LetVariable [ Name=sig_sponsorship_count ]
+      :=
+      FunctionCall null.count@1[
+        Variable [ Name=es ]
+      ]
+    LetVariable [ Name=by_chapter ]
+      :=
+      (
+        SELECT ELEMENT [
+        RecordConstructor [
+          (
+            LiteralExpr [STRING] [chapter_name]
+            :
+            Variable [ Name=chapter_name ]
+          )
+          (
+            LiteralExpr [STRING] [escount]
+            :
+            FunctionCall null.count@1[
+              Variable [ Name=es ]
+            ]
+          )
+        ]
+        ]
+        FROM [          Variable [ Name=es ]
+          AS
+          Variable [ Name=e ]
+        ]
+        Groupby
+          Variable [ Name=chapter_name ]
+          :=
+          FieldAccessor [
+            FieldAccessor [
+              Variable [ Name=e ]
+              Field=sponsor
+            ]
+            Field=chapter_name
+          ]
+
+      )
+    Orderby
+      Variable [ Name=sig_sponsorship_count ]
+      DESC
+
+    Limit
+      LiteralExpr [LONG] [5]
+  )
+}
+
+Query:
+LetVariable [ Name=result ]
+  :=
+  FunctionCall null.calculate@1[
+    FunctionCall Metadata.dataset@1[
+      LiteralExpr [STRING] [Events]
+    ]
+  ]
+SELECT ELEMENT [
+Variable [ Name=result ]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl2.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl2.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl2.ast
new file mode 100644
index 0000000..407d545
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl2.ast
@@ -0,0 +1,15 @@
+FunctionDecl GT([a, b]) {
+  IfExpr [
+    Condition:
+      OperatorExpr [
+        Variable [ Name=a ]
+        >
+        Variable [ Name=b ]
+      ]
+    Then:
+      LiteralExpr [TRUE]
+    Else:
+      LiteralExpr [FALSE]
+  ]
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl3.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl3.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl3.ast
new file mode 100644
index 0000000..487c466
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/functionDecl3.ast
@@ -0,0 +1,9 @@
+FunctionDecl function with spaces([a, b]) {
+  LiteralExpr [STRING] [string with spaces]
+}
+
+Query:
+FunctionCall null.function with spaces@2[
+  LiteralExpr [LONG] [1]
+  LiteralExpr [LONG] [2]
+]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/391f09e5/asterix-app/src/test/resources/parserts/results_parser_sqlpp/groupby_clause_count.ast
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/parserts/results_parser_sqlpp/groupby_clause_count.ast b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/groupby_clause_count.ast
new file mode 100644
index 0000000..b413291
--- /dev/null
+++ b/asterix-app/src/test/resources/parserts/results_parser_sqlpp/groupby_clause_count.ast
@@ -0,0 +1,93 @@
+Query:
+SELECT ELEMENT [
+FunctionCall null.count@1[
+  Variable [ Name=r ]
+]
+]
+FROM [  UnorderedListConstructor [
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [gas]
+        :
+        LiteralExpr [STRING] [co]
+      )
+      (
+        LiteralExpr [STRING] [num]
+        :
+        LiteralExpr [DOUBLE] [0.1]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [gas]
+        :
+        LiteralExpr [STRING] [co]
+      )
+      (
+        LiteralExpr [STRING] [num]
+        :
+        LiteralExpr [DOUBLE] [0.2]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [gas]
+        :
+        LiteralExpr [STRING] [co]
+      )
+      (
+        LiteralExpr [STRING] [num]
+        :
+        LiteralExpr [DOUBLE] [0.3]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [gas]
+        :
+        LiteralExpr [STRING] [co2]
+      )
+      (
+        LiteralExpr [STRING] [num]
+        :
+        LiteralExpr [DOUBLE] [0.4]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [gas]
+        :
+        LiteralExpr [STRING] [no2]
+      )
+      (
+        LiteralExpr [STRING] [num]
+        :
+        LiteralExpr [DOUBLE] [0.5]
+      )
+    ]
+    RecordConstructor [
+      (
+        LiteralExpr [STRING] [gas]
+        :
+        LiteralExpr [STRING] [no2]
+      )
+      (
+        LiteralExpr [STRING] [num]
+        :
+        LiteralExpr [DOUBLE] [0.6]
+      )
+    ]
+  ]
+  AS
+  Variable [ Name=r ]
+]
+Groupby
+  Variable [ Name=g ]
+  :=
+  FieldAccessor [
+    Variable [ Name=r ]
+    Field=gas
+  ]
+  With
+  Variable [ Name=r ]
+



Mime
View raw message