Repository: calcite Updated Branches: refs/heads/master 75048ff34 -> 8746ef792
[CALCITE-2213] Geode integration tests are failing * Includes missing headers for a couple of files Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/8746ef79 Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/8746ef79 Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/8746ef79 Branch: refs/heads/master Commit: 8746ef792d067a72473349200c741d4054b11e95 Parents: 75048ff Author: Jesus Camacho Rodriguez <jcama...@apache.org> Authored: Tue Mar 13 22:26:09 2018 -0700 Committer: Jesus Camacho Rodriguez <jcama...@apache.org> Committed: Tue Mar 13 22:26:09 2018 -0700 ---------------------------------------------------------------------- geode/README.md | 19 +++ .../geode/rel/GeodeAdapterBookshopIT.java | 162 +++++++++---------- .../calcite/adapter/geode/rel/GeodeZipsIT.java | 74 ++++----- plus/src/main/resources/chinook/chinook.json | 18 ++- 4 files changed, 154 insertions(+), 119 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite/blob/8746ef79/geode/README.md ---------------------------------------------------------------------- diff --git a/geode/README.md b/geode/README.md index 852e471..7099e23 100644 --- a/geode/README.md +++ b/geode/README.md @@ -1,2 +1,21 @@ +<!-- +{% comment %} +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. +{% endcomment %} +--> + ##Apache Geode SQL/JBC Adapter http://git-wip-us.apache.org/repos/asf/calcite/blob/8746ef79/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeAdapterBookshopIT.java ---------------------------------------------------------------------- diff --git a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeAdapterBookshopIT.java b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeAdapterBookshopIT.java index ba5db45..4e92f9d 100644 --- a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeAdapterBookshopIT.java +++ b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeAdapterBookshopIT.java @@ -80,9 +80,9 @@ public class GeodeAdapterBookshopIT { .returns("itemNumber=123; description=Run on sentences and drivel on all things mundane;" + " retailCost=34.99; yearPublished=2011; author=Daisy Mae West; title=A Treatise of " + "Treatises\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeFilterRel(condition=[=(CAST($0):INTEGER, 123)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeFilter(condition=[=(CAST($0):INTEGER, 123)])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])"); } @Test @@ -96,9 +96,9 @@ public class GeodeAdapterBookshopIT { .returns("itemNumber=123; description=Run on sentences and drivel on all things mundane; " + "retailCost=34.99; yearPublished=2011; author=Daisy Mae West; title=A Treatise of " + "Treatises\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeFilterRel(condition=[AND(>($0, 122), <=($0, 123))])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeFilter(condition=[AND(>($0, 122), <=($0, 123))])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])"); } @Test @@ -110,11 +110,11 @@ public class GeodeAdapterBookshopIT { + "WHERE \"itemNumber\" = 123 OR \"itemNumber\" = 789") .returnsCount(2) .returnsUnordered("author=Jim Heavisides", "author=Daisy Mae West") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(author=[$4])\n" - + " GeodeFilterRel(condition=[OR(=(CAST($0):INTEGER, 123), " + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(author=[$4])\n" + + " GeodeFilter(condition=[OR(=(CAST($0):INTEGER, 123), " + "=(CAST($0):INTEGER, 789))])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -127,12 +127,12 @@ public class GeodeAdapterBookshopIT { + "OR \"author\"='Daisy Mae West'") .returnsCount(2) .returnsUnordered("author=Jim Heavisides", "author=Daisy Mae West") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(author=[$4])\n" - + " GeodeFilterRel(condition=[OR(AND(>($0, 123), =(CAST($0):INTEGER, 789)), " + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(author=[$4])\n" + + " GeodeFilter(condition=[OR(AND(>($0, 123), =(CAST($0):INTEGER, 789)), " + "=(CAST($4):VARCHAR CHARACTER SET \"ISO-8859-1\" " + "COLLATE \"ISO-8859-1$en_US$primary\", 'Daisy Mae West'))])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n" + "\n"); } @@ -159,10 +159,10 @@ public class GeodeAdapterBookshopIT { .returnsCount(2) .returns("author=Clarence Meeks\n" + "author=Jim Heavisides\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(author=[$4])\n" - + " GeodeFilterRel(condition=[>($0, 123)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(author=[$4])\n" + + " GeodeFilter(condition=[>($0, 123)])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])"); } @Test @@ -175,9 +175,9 @@ public class GeodeAdapterBookshopIT { .returns("itemNumber=123; description=Run on sentences and drivel on all things mundane; " + "retailCost=34.99; yearPublished=2011; author=Daisy Mae West; title=A Treatise of " + "Treatises\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeSortRel(fetch=[1])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeSort(fetch=[1])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])"); } @Test @@ -190,10 +190,10 @@ public class GeodeAdapterBookshopIT { .returns("yearPublished=1971\n" + "yearPublished=2011\n" + "yearPublished=2011\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeSortRel(sort0=[$0], dir0=[ASC])\n" - + " GeodeProjectRel(yearPublished=[$3])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeSort(sort0=[$0], dir0=[ASC])\n" + + " GeodeProject(yearPublished=[$3])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -206,10 +206,10 @@ public class GeodeAdapterBookshopIT { .returnsCount(2) .returns("yearPublished=1971\n" + "yearPublished=2011\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(yearPublished=[$3])\n" - + " GeodeSortRel(sort0=[$3], dir0=[ASC], fetch=[2])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(yearPublished=[$3])\n" + + " GeodeSort(sort0=[$3], dir0=[ASC], fetch=[2])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -223,10 +223,10 @@ public class GeodeAdapterBookshopIT { .returns("yearPublished=1971; itemNumber=456\n" + "yearPublished=2011; itemNumber=789\n" + "yearPublished=2011; itemNumber=123\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(yearPublished=[$3], itemNumber=[$0])\n" - + " GeodeSortRel(sort0=[$3], sort1=[$0], dir0=[ASC], dir1=[DESC])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(yearPublished=[$3], itemNumber=[$0])\n" + + " GeodeSort(sort0=[$3], sort1=[$0], dir0=[ASC], dir1=[DESC])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } // @@ -248,10 +248,10 @@ public class GeodeAdapterBookshopIT { .returns("yearPublished=1971\n" + "yearPublished=2011\n" + "yearPublished=2011\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(yearPublished=[$0])\n" - + " GeodeAggregateRel(group=[{3, 4}])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(yearPublished=[$0])\n" + + " GeodeAggregate(group=[{3, 4}])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])"); } /** @@ -267,9 +267,9 @@ public class GeodeAdapterBookshopIT { .returnsCount(2) .returns("yearPublished=1971\n" + "yearPublished=2011\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{3}])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{3}])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])"); } /** @@ -286,9 +286,9 @@ public class GeodeAdapterBookshopIT { .returnsCount(2) .returns("yearPublished=1971; EXPR$1=11.99\n" + "yearPublished=2011; EXPR$1=59.99\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{3}], EXPR$1=[MAX($2)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{3}], EXPR$1=[MAX($2)])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])"); } @Test @@ -300,9 +300,9 @@ public class GeodeAdapterBookshopIT { .returnsCount(1) .returns("EXPR$0=3\n") .returnsValue("3") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{}], EXPR$0=[COUNT($2)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{}], EXPR$0=[COUNT($2)])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -313,9 +313,9 @@ public class GeodeAdapterBookshopIT { .query("select COUNT(*) from \"BookMaster\"") .returnsCount(1) .returns("EXPR$0=3\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{}], EXPR$0=[COUNT()])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{}], EXPR$0=[COUNT()])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -328,9 +328,9 @@ public class GeodeAdapterBookshopIT { .returnsCount(2) .returns("yearPublished=1971; EXPR$1=1\n" + "yearPublished=2011; EXPR$1=2\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{3}], EXPR$1=[COUNT($2)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{3}], EXPR$1=[COUNT($2)])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -343,10 +343,10 @@ public class GeodeAdapterBookshopIT { .returnsCount(1) .returns("EXPR$0=59.99; EXPR$1=11.99; EXPR$2=106.97000122070312; " + "EXPR$3=35.65666580200195\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{}], EXPR$0=[MAX($2)], EXPR$1=[MIN($2)], EXPR$2=[SUM($2)" + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{}], EXPR$0=[MAX($2)], EXPR$1=[MIN($2)], EXPR$2=[SUM($2)" + "], EXPR$3=[AVG($2)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -362,10 +362,10 @@ public class GeodeAdapterBookshopIT { + "EXPR$4=47.4900016784668\n" + "yearPublished=1971; EXPR$1=11.99; EXPR$2=11.99; EXPR$3=11.989999771118164; " + "EXPR$4=11.989999771118164\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{3}], EXPR$1=[MAX($2)], EXPR$2=[MIN($2)], EXPR$3=[SUM($2)" + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{3}], EXPR$1=[MAX($2)], EXPR$2=[MIN($2)], EXPR$3=[SUM($2)" + "], EXPR$4=[AVG($2)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -379,10 +379,10 @@ public class GeodeAdapterBookshopIT { .returns("yearPublished=2011; MAXCOST=59.99; author=Jim Heavisides\n" + "yearPublished=1971; MAXCOST=11.99; author=Clarence Meeks\n" + "yearPublished=2011; MAXCOST=34.99; author=Daisy Mae West\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(yearPublished=[$0], MAXCOST=[$2], author=[$1])\n" - + " GeodeAggregateRel(group=[{3, 4}], MAXCOST=[MAX($2)])\n" - + " GeodeTableScanRel(table=[[TEST, BookMaster]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(yearPublished=[$0], MAXCOST=[$2], author=[$1])\n" + + " GeodeAggregate(group=[{3, 4}], MAXCOST=[MAX($2)])\n" + + " GeodeTableScan(table=[[TEST, BookMaster]])\n"); } @Test @@ -392,9 +392,9 @@ public class GeodeAdapterBookshopIT { .with(GEODE) .query("select * from \"BookCustomer\" limit 2") .returnsCount(2) - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeSortRel(fetch=[2])\n" - + " GeodeTableScanRel(table=[[TEST, BookCustomer]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeSort(fetch=[2])\n" + + " GeodeTableScan(table=[[TEST, BookCustomer]])\n"); } @Test @@ -408,10 +408,10 @@ public class GeodeAdapterBookshopIT { + "postalCode,country,phoneNumber,addressTag]\n" + "primaryAddress=PDX[addressLine1,addressLine2,addressLine3,city,state,postalCode," + "country,phoneNumber,addressTag]\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(primaryAddress=[$3])\n" - + " GeodeSortRel(fetch=[2])\n" - + " GeodeTableScanRel(table=[[TEST, BookCustomer]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(primaryAddress=[$3])\n" + + " GeodeSort(fetch=[2])\n" + + " GeodeTableScan(table=[[TEST, BookCustomer]])\n"); } @Test @@ -423,10 +423,10 @@ public class GeodeAdapterBookshopIT { .returnsCount(2) .returns("city=Topeka\n" + "city=San Francisco\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(city=[ITEM($3, 'city')])\n" - + " GeodeSortRel(fetch=[2])\n" - + " GeodeTableScanRel(table=[[TEST, BookCustomer]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(city=[ITEM($3, 'city')])\n" + + " GeodeSort(fetch=[2])\n" + + " GeodeTableScan(table=[[TEST, BookCustomer]])\n"); } @Test @@ -439,10 +439,10 @@ public class GeodeAdapterBookshopIT { .returnsCount(2) .returns("EXPR$0=null\n" + "EXPR$0=null\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(EXPR$0=[ITEM($3, 'addressLine2')])\n" - + " GeodeSortRel(fetch=[2])\n" - + " GeodeTableScanRel(table=[[TEST, BookCustomer]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(EXPR$0=[ITEM($3, 'addressLine2')])\n" + + " GeodeSort(fetch=[2])\n" + + " GeodeTableScan(table=[[TEST, BookCustomer]])\n"); } @Test @@ -457,10 +457,10 @@ public class GeodeAdapterBookshopIT { .returns("postalCode=50505\n" + "postalCode=50505\n" + "postalCode=50505\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(postalCode=[ITEM($3, 'postalCode')])\n" - + " GeodeFilterRel(condition=[>(ITEM($3, 'postalCode'), '0')])\n" - + " GeodeTableScanRel(table=[[TEST, BookCustomer]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(postalCode=[ITEM($3, 'postalCode')])\n" + + " GeodeFilter(condition=[>(ITEM($3, 'postalCode'), '0')])\n" + + " GeodeTableScan(table=[[TEST, BookCustomer]])\n"); } } http://git-wip-us.apache.org/repos/asf/calcite/blob/8746ef79/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeZipsIT.java ---------------------------------------------------------------------- diff --git a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeZipsIT.java b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeZipsIT.java index e465393..f23946c 100644 --- a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeZipsIT.java +++ b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeZipsIT.java @@ -68,11 +68,11 @@ public class GeodeZipsIT { .with(GEODE_ZIPS) .query("SELECT \"state\", SUM(\"pop\") FROM \"geode\".\"ZIPS\" GROUP BY \"state\"") .returnsCount(51) - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{1}], EXPR$1=[SUM($0)])\n" - + " GeodeProjectRel(pop=[CAST($3):INTEGER], state=[CAST($4):VARCHAR(2) CHARACTER SET" + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{1}], EXPR$1=[SUM($0)])\n" + + " GeodeProject(pop=[CAST($3):INTEGER], state=[CAST($4):VARCHAR(2) CHARACTER SET" + " \"ISO-8859-1\" COLLATE \"ISO-8859-1$en_US$primary\"])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } @Test @@ -84,11 +84,11 @@ public class GeodeZipsIT { + "FROM \"geode\".\"ZIPS\" GROUP BY " + "\"state\"") .returnsCount(51) - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{1}], po=[SUM($0)])\n" - + " GeodeProjectRel(pop=[CAST($3):INTEGER], state=[CAST($4):VARCHAR(2) CHARACTER SET" + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{1}], po=[SUM($0)])\n" + + " GeodeProject(pop=[CAST($3):INTEGER], state=[CAST($4):VARCHAR(2) CHARACTER SET" + " \"ISO-8859-1\" COLLATE \"ISO-8859-1$en_US$primary\"])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } @Test @@ -100,9 +100,9 @@ public class GeodeZipsIT { + "FROM \"geode_raw\".\"Zips\" GROUP" + " BY \"state\"") .returnsCount(51) - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{4}], po=[SUM($3)])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{4}], po=[SUM($3)])\n" + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } @Test @@ -114,9 +114,9 @@ public class GeodeZipsIT { + "FROM \"geode_raw\".\"Zips\" " + "GROUP BY \"state\"") .returnsCount(51) - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{4}], po=[SUM($3)])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{4}], po=[SUM($3)])\n" + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } @Test @@ -126,9 +126,9 @@ public class GeodeZipsIT { .with(GEODE_ZIPS) .query("SELECT MAX(\"pop\") FROM \"geode_raw\".\"Zips\"") .returnsCount(1) - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeAggregateRel(group=[{}], EXPR$0=[MAX($3)])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeAggregate(group=[{}], EXPR$0=[MAX($3)])\n" + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } @Test @@ -142,14 +142,14 @@ public class GeodeZipsIT { .explainContains("PLAN=EnumerableCalc(expr#0..2=[{inputs}], _id1=[$t0])\n" + " EnumerableLimit(fetch=[1])\n" + " EnumerableJoin(condition=[=($1, $2)], joinType=[inner])\n" - + " GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(_id=[$0], _id0=[CAST($0):VARCHAR CHARACTER SET " + + " GeodeToEnumerableConverter\n" + + " GeodeProject(_id=[$0], _id0=[CAST($0):VARCHAR CHARACTER SET " + "\"ISO-8859-1\" COLLATE \"ISO-8859-1$en_US$primary\"])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n" - + " GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(_id0=[CAST($0):VARCHAR CHARACTER SET \"ISO-8859-1\" COLLATE " + + " GeodeTableScan(table=[[geode_raw, Zips]])\n" + + " GeodeToEnumerableConverter\n" + + " GeodeProject(_id0=[CAST($0):VARCHAR CHARACTER SET \"ISO-8859-1\" COLLATE " + "\"ISO-8859-1$en_US$primary\"])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } @Test @@ -161,10 +161,10 @@ public class GeodeZipsIT { + "FROM \"geode_raw\".\"Zips\" LIMIT 1") .returnsCount(1) .returns("lat=-74.700748; lon=41.65158\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(lat=[ITEM($2, 0)], lon=[ITEM($2, 1)])\n" - + " GeodeSortRel(fetch=[1])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(lat=[ITEM($2, 0)], lon=[ITEM($2, 1)])\n" + + " GeodeSort(fetch=[1])\n" + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } @Test @@ -176,11 +176,11 @@ public class GeodeZipsIT { + "FROM \"geode_raw\".\"Zips\" WHERE \"loc\"[0] < 0 LIMIT 1") .returnsCount(1) .returns("lat=-74.700748; lon=41.65158\n") - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(lat=[ITEM($2, 0)], lon=[ITEM($2, 1)])\n" - + " GeodeSortRel(fetch=[1])\n" - + " GeodeFilterRel(condition=[<(ITEM($2, 0), 0)])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(lat=[ITEM($2, 0)], lon=[ITEM($2, 1)])\n" + + " GeodeSort(fetch=[1])\n" + + " GeodeFilter(condition=[<(ITEM($2, 0), 0)])\n" + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); CalciteAssert.that() .enable(enabled()) @@ -188,11 +188,11 @@ public class GeodeZipsIT { .query("SELECT \"loc\"[0] as \"lat\", \"loc\"[1] as \"lon\" " + "FROM \"geode_raw\".\"Zips\" WHERE \"loc\"[0] > 0 LIMIT 1") .returnsCount(0) - .explainContains("PLAN=GeodeToEnumerableConverterRel\n" - + " GeodeProjectRel(lat=[ITEM($2, 0)], lon=[ITEM($2, 1)])\n" - + " GeodeSortRel(fetch=[1])\n" - + " GeodeFilterRel(condition=[>(ITEM($2, 0), 0)])\n" - + " GeodeTableScanRel(table=[[geode_raw, Zips]])\n"); + .explainContains("PLAN=GeodeToEnumerableConverter\n" + + " GeodeProject(lat=[ITEM($2, 0)], lon=[ITEM($2, 1)])\n" + + " GeodeSort(fetch=[1])\n" + + " GeodeFilter(condition=[>(ITEM($2, 0), 0)])\n" + + " GeodeTableScan(table=[[geode_raw, Zips]])\n"); } } http://git-wip-us.apache.org/repos/asf/calcite/blob/8746ef79/plus/src/main/resources/chinook/chinook.json ---------------------------------------------------------------------- diff --git a/plus/src/main/resources/chinook/chinook.json b/plus/src/main/resources/chinook/chinook.json index b687c4c..11b3956 100644 --- a/plus/src/main/resources/chinook/chinook.json +++ b/plus/src/main/resources/chinook/chinook.json @@ -1,4 +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. + */ + { "version": "1.0", "defaultSchema": "ENHANCED", "schemas": [