text:
<?xml version="1.0" ?>
<!--
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.
-->
<Root>
  <TestCase name="testDecomposableAggFunctions[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[
SELECT VAR_POP(b),
    VAR_SAMP(b),
    STDDEV_POP(b),
    STDDEV_SAMP(b),
    TUMBLE_START(ts, INTERVAL '15' MINUTE),
    TUMBLE_END(ts, INTERVAL '15' MINUTE)
FROM MyTable1
    GROUP BY TUMBLE(ts, INTERVAL '15' MINUTE)
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[$2], EXPR$2=[$3], EXPR$3=[$4], EXPR$4=[TUMBLE_START($0)], EXPR$5=[TUMBLE_END($0)])
+- LogicalAggregate(group=[{0}], EXPR$0=[VAR_POP($1)], EXPR$1=[VAR_SAMP($1)], EXPR$2=[STDDEV_POP($1)], EXPR$3=[STDDEV_SAMP($1)])
   +- LogicalProject($f0=[TUMBLE($0, 900000:INTERVAL MINUTE)], b=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), $f2) AS EXPR$0, /(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), CASE(=($f2, 1), null:BIGINT, -($f2, 1))) AS EXPR$1, POWER(/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), $f2), 0.5:DECIMAL(2, 1)) AS EXPR$2, POWER(/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), CASE(=($f2, 1), null:BIGINT, -($f2, 1))), 0.5:DECIMAL(2, 1)) AS EXPR$3, w$start AS EXPR$4, w$end AS EXPR$5])
+- HashWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[Final_SUM(sum$0) AS $f0, Final_SUM(sum$1) AS $f1, Final_COUNT(count$2) AS $f2])
   +- Exchange(distribution=[single])
      +- LocalHashWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[Partial_SUM($f2) AS sum$0, Partial_SUM(b) AS sum$1, Partial_COUNT(b) AS count$2])
         +- Calc(select=[ts, b, *(CAST(b), CAST(b)) AS $f2])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testDecomposableAggFunctions[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT VAR_POP(b),
    VAR_SAMP(b),
    STDDEV_POP(b),
    STDDEV_SAMP(b),
    TUMBLE_START(ts, INTERVAL '15' MINUTE),
    TUMBLE_END(ts, INTERVAL '15' MINUTE)
FROM MyTable1
    GROUP BY TUMBLE(ts, INTERVAL '15' MINUTE)
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[$2], EXPR$2=[$3], EXPR$3=[$4], EXPR$4=[TUMBLE_START($0)], EXPR$5=[TUMBLE_END($0)])
+- LogicalAggregate(group=[{0}], EXPR$0=[VAR_POP($1)], EXPR$1=[VAR_SAMP($1)], EXPR$2=[STDDEV_POP($1)], EXPR$3=[STDDEV_SAMP($1)])
   +- LogicalProject($f0=[TUMBLE($0, 900000:INTERVAL MINUTE)], b=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), $f2) AS EXPR$0, /(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), CASE(=($f2, 1), null:BIGINT, -($f2, 1))) AS EXPR$1, POWER(/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), $f2), 0.5:DECIMAL(2, 1)) AS EXPR$2, POWER(/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), CASE(=($f2, 1), null:BIGINT, -($f2, 1))), 0.5:DECIMAL(2, 1)) AS EXPR$3, w$start AS EXPR$4, w$end AS EXPR$5])
+- HashWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[SUM($f2) AS $f0, SUM(b) AS $f1, COUNT(b) AS $f2])
   +- Exchange(distribution=[single])
      +- Calc(select=[ts, b, *(CAST(b), CAST(b)) AS $f2])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testDecomposableAggFunctions[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT VAR_POP(b),
    VAR_SAMP(b),
    STDDEV_POP(b),
    STDDEV_SAMP(b),
    TUMBLE_START(ts, INTERVAL '15' MINUTE),
    TUMBLE_END(ts, INTERVAL '15' MINUTE)
FROM MyTable1
    GROUP BY TUMBLE(ts, INTERVAL '15' MINUTE)
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[$2], EXPR$2=[$3], EXPR$3=[$4], EXPR$4=[TUMBLE_START($0)], EXPR$5=[TUMBLE_END($0)])
+- LogicalAggregate(group=[{0}], EXPR$0=[VAR_POP($1)], EXPR$1=[VAR_SAMP($1)], EXPR$2=[STDDEV_POP($1)], EXPR$3=[STDDEV_SAMP($1)])
   +- LogicalProject($f0=[TUMBLE($0, 900000:INTERVAL MINUTE)], b=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), $f2) AS EXPR$0, /(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), CASE(=($f2, 1), null:BIGINT, -($f2, 1))) AS EXPR$1, POWER(/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), $f2), 0.5:DECIMAL(2, 1)) AS EXPR$2, POWER(/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), CASE(=($f2, 1), null:BIGINT, -($f2, 1))), 0.5:DECIMAL(2, 1)) AS EXPR$3, w$start AS EXPR$4, w$end AS EXPR$5])
+- HashWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[Final_SUM(sum$0) AS $f0, Final_SUM(sum$1) AS $f1, Final_COUNT(count$2) AS $f2])
   +- Exchange(distribution=[single])
      +- LocalHashWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[Partial_SUM($f2) AS sum$0, Partial_SUM(b) AS sum$1, Partial_COUNT(b) AS count$2])
         +- Calc(select=[ts, b, *(CAST(b), CAST(b)) AS $f2])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testExpressionOnWindowHavingFunction[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[
SELECT COUNT(*),
    HOP_START(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)
FROM MyTable2
    GROUP BY HOP(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)
    HAVING
     SUM(a) > 0 AND
     QUARTER(HOP_START(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)) = 1
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[HOP_START($0)])
+- LogicalFilter(condition=[AND(>($2, 0), =(EXTRACT(FLAG(QUARTER), HOP_START($0)), 1))])
   +- LogicalAggregate(group=[{0}], EXPR$0=[COUNT()], agg#1=[SUM($1)])
      +- LogicalProject($f0=[HOP($4, 900000:INTERVAL MINUTE, 60000:INTERVAL MINUTE)], a=[$0])
         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, w$start AS EXPR$1], where=[AND(>($f1, 0), =(EXTRACT(FLAG(QUARTER), w$start), 1:BIGINT))])
+- HashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 60000, 900000)], properties=[w$start, w$end, w$rowtime], select=[Final_COUNT(count1$0) AS EXPR$0, Final_SUM(sum$1) AS $f1])
   +- Exchange(distribution=[single])
      +- LocalHashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 60000, 900000)], properties=[w$start, w$end, w$rowtime], select=[Partial_COUNT(*) AS count1$0, Partial_SUM(a) AS sum$1])
         +- Calc(select=[ts, a])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testExpressionOnWindowHavingFunction[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT COUNT(*),
    HOP_START(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)
FROM MyTable2
    GROUP BY HOP(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)
    HAVING
     SUM(a) > 0 AND
     QUARTER(HOP_START(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)) = 1
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[HOP_START($0)])
+- LogicalFilter(condition=[AND(>($2, 0), =(EXTRACT(FLAG(QUARTER), HOP_START($0)), 1))])
   +- LogicalAggregate(group=[{0}], EXPR$0=[COUNT()], agg#1=[SUM($1)])
      +- LogicalProject($f0=[HOP($4, 900000:INTERVAL MINUTE, 60000:INTERVAL MINUTE)], a=[$0])
         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, w$start AS EXPR$1], where=[AND(>($f1, 0), =(EXTRACT(FLAG(QUARTER), w$start), 1:BIGINT))])
+- HashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 60000, 900000)], properties=[w$start, w$end, w$rowtime], select=[COUNT(*) AS EXPR$0, SUM(a) AS $f1])
   +- Exchange(distribution=[single])
      +- Calc(select=[ts, a])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testExpressionOnWindowHavingFunction[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT COUNT(*),
    HOP_START(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)
FROM MyTable2
    GROUP BY HOP(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)
    HAVING
     SUM(a) > 0 AND
     QUARTER(HOP_START(ts, INTERVAL '15' MINUTE, INTERVAL '1' MINUTE)) = 1
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[HOP_START($0)])
+- LogicalFilter(condition=[AND(>($2, 0), =(EXTRACT(FLAG(QUARTER), HOP_START($0)), 1))])
   +- LogicalAggregate(group=[{0}], EXPR$0=[COUNT()], agg#1=[SUM($1)])
      +- LogicalProject($f0=[HOP($4, 900000:INTERVAL MINUTE, 60000:INTERVAL MINUTE)], a=[$0])
         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, w$start AS EXPR$1], where=[AND(>($f1, 0), =(EXTRACT(FLAG(QUARTER), w$start), 1:BIGINT))])
+- HashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 60000, 900000)], properties=[w$start, w$end, w$rowtime], select=[Final_COUNT(count1$0) AS EXPR$0, Final_SUM(sum$1) AS $f1])
   +- Exchange(distribution=[single])
      +- LocalHashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 60000, 900000)], properties=[w$start, w$end, w$rowtime], select=[Partial_COUNT(*) AS count1$0, Partial_SUM(a) AS sum$1])
         +- Calc(select=[ts, a])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAggWithPaneOptimization[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT COUNT(c) FROM MyTable1 GROUP BY a, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(a=[$1], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- HashWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Final_COUNT(count$0) AS EXPR$0])
   +- Exchange(distribution=[hash[a]])
      +- LocalHashWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Partial_COUNT(c) AS count$0])
         +- Calc(select=[a, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNoGroupingSlidingWindow[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[
SELECT SUM(a),
    HOP_START(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND),
    HOP_END(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND)
FROM MyTable
    GROUP BY HOP(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND)
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[HOP_START($0)], EXPR$2=[HOP_END($0)])
+- LogicalAggregate(group=[{0}], EXPR$0=[SUM($1)])
   +- LogicalProject($f0=[HOP($1, 3000:INTERVAL SECOND, 3000:INTERVAL SECOND)], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, w$start AS EXPR$1, w$end AS EXPR$2])
+- HashWindowAggregate(window=[SlidingGroupWindow('w$, b, 3000, 3000)], properties=[w$start, w$end, w$rowtime], select=[Final_SUM(sum$0) AS EXPR$0])
   +- Exchange(distribution=[single])
      +- LocalHashWindowAggregate(window=[SlidingGroupWindow('w$, b, 3000, 3000)], properties=[w$start, w$end, w$rowtime], select=[Partial_SUM(a) AS sum$0])
         +- Calc(select=[b, a])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNoGroupingSlidingWindow[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT SUM(a),
    HOP_START(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND),
    HOP_END(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND)
FROM MyTable
    GROUP BY HOP(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND)
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[HOP_START($0)], EXPR$2=[HOP_END($0)])
+- LogicalAggregate(group=[{0}], EXPR$0=[SUM($1)])
   +- LogicalProject($f0=[HOP($1, 3000:INTERVAL SECOND, 3000:INTERVAL SECOND)], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, w$start AS EXPR$1, w$end AS EXPR$2])
+- HashWindowAggregate(window=[SlidingGroupWindow('w$, b, 3000, 3000)], properties=[w$start, w$end, w$rowtime], select=[SUM(a) AS EXPR$0])
   +- Exchange(distribution=[single])
      +- Calc(select=[b, a])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNoGroupingSlidingWindow[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT SUM(a),
    HOP_START(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND),
    HOP_END(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND)
FROM MyTable
    GROUP BY HOP(b, INTERVAL '3' SECOND, INTERVAL '3' SECOND)
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[HOP_START($0)], EXPR$2=[HOP_END($0)])
+- LogicalAggregate(group=[{0}], EXPR$0=[SUM($1)])
   +- LogicalProject($f0=[HOP($1, 3000:INTERVAL SECOND, 3000:INTERVAL SECOND)], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, w$start AS EXPR$1, w$end AS EXPR$2])
+- HashWindowAggregate(window=[SlidingGroupWindow('w$, b, 3000, 3000)], properties=[w$start, w$end, w$rowtime], select=[Final_SUM(sum$0) AS EXPR$0])
   +- Exchange(distribution=[single])
      +- LocalHashWindowAggregate(window=[SlidingGroupWindow('w$, b, 3000, 3000)], properties=[w$start, w$end, w$rowtime], select=[Partial_SUM(a) AS sum$0])
         +- Calc(select=[b, a])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNoGroupingTumblingWindow[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), SUM(a) FROM MyTable GROUP BY TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[$2])
+- LogicalAggregate(group=[{0}], EXPR$0=[AVG($1)], EXPR$1=[SUM($2)])
   +- LogicalProject($f0=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[TumblingGroupWindow], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final_SUM(sum$2) AS EXPR$1])
+- Exchange(distribution=[single])
   +- LocalHashWindowAggregate(window=[TumblingGroupWindow], select=[Partial_AVG(c) AS (sum$0, count$1), Partial_SUM(a) AS sum$2])
      +- Calc(select=[b, c, a])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNoGroupingTumblingWindow[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), SUM(a) FROM MyTable GROUP BY TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[$2])
+- LogicalAggregate(group=[{0}], EXPR$0=[AVG($1)], EXPR$1=[SUM($2)])
   +- LogicalProject($f0=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[TumblingGroupWindow], select=[AVG(c) AS EXPR$0, SUM(a) AS EXPR$1])
+- Exchange(distribution=[single])
   +- Calc(select=[b, c, a])
      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNoGroupingTumblingWindow[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), SUM(a) FROM MyTable GROUP BY TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$1], EXPR$1=[$2])
+- LogicalAggregate(group=[{0}], EXPR$0=[AVG($1)], EXPR$1=[SUM($2)])
   +- LogicalProject($f0=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[TumblingGroupWindow], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final_SUM(sum$2) AS EXPR$1])
+- Exchange(distribution=[single])
   +- LocalHashWindowAggregate(window=[TumblingGroupWindow], select=[Partial_AVG(c) AS (sum$0, count$1), Partial_SUM(a) AS sum$2])
      +- Calc(select=[b, c, a])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNonPartitionedSlidingWindow[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT SUM(a) AS sumA, COUNT(b) AS cntB FROM MyTable2 GROUP BY HOP(ts, INTERVAL '15' MINUTE, INTERVAL '90' MINUTE)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(sumA=[$1], cntB=[$2])
+- LogicalAggregate(group=[{0}], sumA=[SUM($1)], cntB=[COUNT($2)])
   +- LogicalProject($f0=[HOP($4, 900000:INTERVAL MINUTE, 5400000:INTERVAL MINUTE)], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
SortWindowAggregate(window=[SlidingGroupWindow('w$, ts, 5400000, 900000)], select=[SUM(a) AS sumA, COUNT(b) AS cntB])
+- Sort(orderBy=[ts ASC])
   +- Exchange(distribution=[single])
      +- Calc(select=[ts, a, b])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNonPartitionedSlidingWindow[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT SUM(a) AS sumA, COUNT(b) AS cntB FROM MyTable2 GROUP BY HOP(ts, INTERVAL '15' MINUTE, INTERVAL '90' MINUTE)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(sumA=[$1], cntB=[$2])
+- LogicalAggregate(group=[{0}], sumA=[SUM($1)], cntB=[COUNT($2)])
   +- LogicalProject($f0=[HOP($4, 900000:INTERVAL MINUTE, 5400000:INTERVAL MINUTE)], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 5400000, 900000)], select=[Final_SUM(sum$0) AS sumA, Final_COUNT(count$1) AS cntB])
+- Exchange(distribution=[single])
   +- LocalHashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 5400000, 900000)], select=[Partial_SUM(a) AS sum$0, Partial_COUNT(b) AS count$1])
      +- Calc(select=[ts, a, b])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNonPartitionedTumblingWindow[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT SUM(a) AS sumA, COUNT(b) AS cntB FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '2' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(sumA=[$1], cntB=[$2])
+- LogicalAggregate(group=[{0}], sumA=[SUM($1)], cntB=[COUNT($2)])
   +- LogicalProject($f0=[TUMBLE($4, 7200000:INTERVAL HOUR)], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[TumblingGroupWindow], select=[Final_SUM(sum$0) AS sumA, Final_COUNT(count$1) AS cntB])
+- Exchange(distribution=[single])
   +- LocalHashWindowAggregate(window=[TumblingGroupWindow], select=[Partial_SUM(a) AS sum$0, Partial_COUNT(b) AS count$1])
      +- Calc(select=[ts, a, b])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNonPartitionedTumblingWindow[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT SUM(a) AS sumA, COUNT(b) AS cntB FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '2' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(sumA=[$1], cntB=[$2])
+- LogicalAggregate(group=[{0}], sumA=[SUM($1)], cntB=[COUNT($2)])
   +- LogicalProject($f0=[TUMBLE($4, 7200000:INTERVAL HOUR)], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[TumblingGroupWindow], select=[SUM(a) AS sumA, COUNT(b) AS cntB])
+- Exchange(distribution=[single])
   +- Calc(select=[ts, a, b])
      +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNonPartitionedTumblingWindow[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT SUM(a) AS sumA, COUNT(b) AS cntB FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '2' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(sumA=[$1], cntB=[$2])
+- LogicalAggregate(group=[{0}], sumA=[SUM($1)], cntB=[COUNT($2)])
   +- LogicalProject($f0=[TUMBLE($4, 7200000:INTERVAL HOUR)], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[TumblingGroupWindow], select=[Final_SUM(sum$0) AS sumA, Final_COUNT(count$1) AS cntB])
+- Exchange(distribution=[single])
   +- LocalHashWindowAggregate(window=[TumblingGroupWindow], select=[Partial_SUM(a) AS sum$0, Partial_COUNT(b) AS count$1])
      +- Calc(select=[ts, a, b])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testPartitionedSlidingWindow[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT   c,   HOP_END(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   HOP_START(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   HOP_ROWTIME(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   SUM(a) AS sumA,   AVG(b) AS avgB FROM MyTable2 GROUP BY HOP(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR), d, c]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(c=[$2], EXPR$1=[HOP_END($0)], EXPR$2=[HOP_START($0)], EXPR$3=[HOP_ROWTIME($0)], sumA=[$3], avgB=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], sumA=[SUM($3)], avgB=[AVG($4)])
   +- LogicalProject($f0=[HOP($4, 3600000:INTERVAL HOUR, 10800000:INTERVAL HOUR)], d=[$3], c=[$2], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[c, w$end AS EXPR$1, w$start AS EXPR$2, w$rowtime AS EXPR$3, sumA, avgB])
+- HashWindowAggregate(groupBy=[c, d], window=[SlidingGroupWindow('w$, ts, 10800000, 3600000)], properties=[w$start, w$end, w$rowtime], select=[c, d, Final_SUM(sum$0) AS sumA, Final_AVG(sum$1, count$2) AS avgB])
   +- Exchange(distribution=[hash[c, d]])
      +- LocalHashWindowAggregate(groupBy=[c, d], window=[SlidingGroupWindow('w$, ts, 10800000, 3600000)], properties=[w$start, w$end, w$rowtime], select=[c, d, Partial_SUM(a) AS sum$0, Partial_AVG(b) AS (sum$1, count$2)])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testNonPartitionedSlidingWindow[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT SUM(a) AS sumA, COUNT(b) AS cntB FROM MyTable2 GROUP BY HOP(ts, INTERVAL '15' MINUTE, INTERVAL '90' MINUTE)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(sumA=[$1], cntB=[$2])
+- LogicalAggregate(group=[{0}], sumA=[SUM($1)], cntB=[COUNT($2)])
   +- LogicalProject($f0=[HOP($4, 900000:INTERVAL MINUTE, 5400000:INTERVAL MINUTE)], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
HashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 5400000, 900000)], select=[Final_SUM(sum$0) AS sumA, Final_COUNT(count$1) AS cntB])
+- Exchange(distribution=[single])
   +- LocalHashWindowAggregate(window=[SlidingGroupWindow('w$, ts, 5400000, 900000)], select=[Partial_SUM(a) AS sum$0, Partial_COUNT(b) AS count$1])
      +- Calc(select=[ts, a, b])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testPartitionedSlidingWindow[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT   c,   HOP_END(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   HOP_START(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   HOP_ROWTIME(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   SUM(a) AS sumA,   AVG(b) AS avgB FROM MyTable2 GROUP BY HOP(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR), d, c]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(c=[$2], EXPR$1=[HOP_END($0)], EXPR$2=[HOP_START($0)], EXPR$3=[HOP_ROWTIME($0)], sumA=[$3], avgB=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], sumA=[SUM($3)], avgB=[AVG($4)])
   +- LogicalProject($f0=[HOP($4, 3600000:INTERVAL HOUR, 10800000:INTERVAL HOUR)], d=[$3], c=[$2], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[c, w$end AS EXPR$1, w$start AS EXPR$2, w$rowtime AS EXPR$3, sumA, avgB])
+- SortWindowAggregate(groupBy=[c, d], window=[SlidingGroupWindow('w$, ts, 10800000, 3600000)], properties=[w$start, w$end, w$rowtime], select=[c, d, SUM(a) AS sumA, AVG(b) AS avgB])
   +- Sort(orderBy=[c ASC, d ASC, ts ASC])
      +- Exchange(distribution=[hash[c, d]])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testPartitionedSlidingWindow[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT   c,   HOP_END(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   HOP_START(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   HOP_ROWTIME(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR),   SUM(a) AS sumA,   AVG(b) AS avgB FROM MyTable2 GROUP BY HOP(ts, INTERVAL '1' HOUR, INTERVAL '3' HOUR), d, c]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(c=[$2], EXPR$1=[HOP_END($0)], EXPR$2=[HOP_START($0)], EXPR$3=[HOP_ROWTIME($0)], sumA=[$3], avgB=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], sumA=[SUM($3)], avgB=[AVG($4)])
   +- LogicalProject($f0=[HOP($4, 3600000:INTERVAL HOUR, 10800000:INTERVAL HOUR)], d=[$3], c=[$2], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[c, w$end AS EXPR$1, w$start AS EXPR$2, w$rowtime AS EXPR$3, sumA, avgB])
+- HashWindowAggregate(groupBy=[c, d], window=[SlidingGroupWindow('w$, ts, 10800000, 3600000)], properties=[w$start, w$end, w$rowtime], select=[c, d, Final_SUM(sum$0) AS sumA, Final_AVG(sum$1, count$2) AS avgB])
   +- Exchange(distribution=[hash[c, d]])
      +- LocalHashWindowAggregate(groupBy=[c, d], window=[SlidingGroupWindow('w$, ts, 10800000, 3600000)], properties=[w$start, w$end, w$rowtime], select=[c, d, Partial_SUM(a) AS sum$0, Partial_AVG(b) AS (sum$1, count$2)])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testPartitionedTumblingWindow[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[
SELECT TUMBLE_START(ts, INTERVAL '4' MINUTE),
    TUMBLE_END(ts, INTERVAL '4' MINUTE),
    TUMBLE_ROWTIME(ts, INTERVAL '4' MINUTE),
    c,
    SUM(a) AS sumA,
    MIN(b) AS minB
FROM MyTable2
    GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE), c
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[TUMBLE_START($0)], EXPR$1=[TUMBLE_END($0)], EXPR$2=[TUMBLE_ROWTIME($0)], c=[$1], sumA=[$2], minB=[$3])
+- LogicalAggregate(group=[{0, 1}], sumA=[SUM($2)], minB=[MIN($3)])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], c=[$2], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[w$start AS EXPR$0, w$end AS EXPR$1, w$rowtime AS EXPR$2, c, sumA, minB])
+- HashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c, Final_SUM(sum$0) AS sumA, Final_MIN(min$1) AS minB])
   +- Exchange(distribution=[hash[c]])
      +- LocalHashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c, Partial_SUM(a) AS sum$0, Partial_MIN(b) AS min$1])
         +- Calc(select=[ts, c, a, b])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testPartitionedTumblingWindow[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT TUMBLE_START(ts, INTERVAL '4' MINUTE),
    TUMBLE_END(ts, INTERVAL '4' MINUTE),
    TUMBLE_ROWTIME(ts, INTERVAL '4' MINUTE),
    c,
    SUM(a) AS sumA,
    MIN(b) AS minB
FROM MyTable2
    GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE), c
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[TUMBLE_START($0)], EXPR$1=[TUMBLE_END($0)], EXPR$2=[TUMBLE_ROWTIME($0)], c=[$1], sumA=[$2], minB=[$3])
+- LogicalAggregate(group=[{0, 1}], sumA=[SUM($2)], minB=[MIN($3)])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], c=[$2], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[w$start AS EXPR$0, w$end AS EXPR$1, w$rowtime AS EXPR$2, c, sumA, minB])
+- HashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c, SUM(a) AS sumA, MIN(b) AS minB])
   +- Exchange(distribution=[hash[c]])
      +- Calc(select=[ts, c, a, b])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testPartitionedTumblingWindow[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[
SELECT TUMBLE_START(ts, INTERVAL '4' MINUTE),
    TUMBLE_END(ts, INTERVAL '4' MINUTE),
    TUMBLE_ROWTIME(ts, INTERVAL '4' MINUTE),
    c,
    SUM(a) AS sumA,
    MIN(b) AS minB
FROM MyTable2
    GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE), c
      ]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[TUMBLE_START($0)], EXPR$1=[TUMBLE_END($0)], EXPR$2=[TUMBLE_ROWTIME($0)], c=[$1], sumA=[$2], minB=[$3])
+- LogicalAggregate(group=[{0, 1}], sumA=[SUM($2)], minB=[MIN($3)])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], c=[$2], a=[$0], b=[$1])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[w$start AS EXPR$0, w$end AS EXPR$1, w$rowtime AS EXPR$2, c, sumA, minB])
+- HashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c, Final_SUM(sum$0) AS sumA, Final_MIN(min$1) AS minB])
   +- Exchange(distribution=[hash[c]])
      +- LocalHashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c, Partial_SUM(a) AS sum$0, Partial_MIN(b) AS min$1])
         +- Calc(select=[ts, c, a, b])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowHashAgg[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT count(c) FROM MyTable1 GROUP BY b, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(b=[$2], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- HashWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[b, Final_COUNT(count$0) AS EXPR$0])
   +- Exchange(distribution=[hash[b]])
      +- LocalHashWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[b, Partial_COUNT(c) AS count$0])
         +- Calc(select=[b, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowHashAgg[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT count(c) FROM MyTable1 GROUP BY b, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(b=[$2], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[b, COUNT(c) AS EXPR$0])
   +- Sort(orderBy=[b ASC, ts ASC])
      +- Exchange(distribution=[hash[b]])
         +- Calc(select=[b, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowHashAgg[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT count(c) FROM MyTable1 GROUP BY b, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(b=[$2], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- HashWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[b, Final_COUNT(count$0) AS EXPR$0])
   +- Exchange(distribution=[hash[b]])
      +- LocalHashWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[b, Partial_COUNT(c) AS count$0])
         +- Calc(select=[b, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg1[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY a, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(a=[$1], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Final_MAX(max$0) AS EXPR$0])
   +- Sort(orderBy=[a ASC, assignedPane$ ASC])
      +- Exchange(distribution=[hash[a]])
         +- LocalSortWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Partial_MAX(c) AS max$0])
            +- Sort(orderBy=[a ASC, ts ASC])
               +- Calc(select=[a, ts, c])
                  +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg1[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY a, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(a=[$1], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, MAX(c) AS EXPR$0])
   +- Sort(orderBy=[a ASC, ts ASC])
      +- Exchange(distribution=[hash[a]])
         +- Calc(select=[a, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg1[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY a, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(a=[$1], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Final_MAX(max$0) AS EXPR$0])
   +- Sort(orderBy=[a ASC, assignedPane$ ASC])
      +- Exchange(distribution=[hash[a]])
         +- LocalSortWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Partial_MAX(c) AS max$0])
            +- Sort(orderBy=[a ASC, ts ASC])
               +- Calc(select=[a, ts, c])
                  +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg2[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY b, HOP(ts, INTERVAL '0.111' SECOND(1,3), INTERVAL '1' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(b=[$2], $f1=[HOP($0, 111:INTERVAL SECOND(1, 3), 1000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 1000, 111)], select=[b, MAX(c) AS EXPR$0])
   +- Sort(orderBy=[b ASC, ts ASC])
      +- Exchange(distribution=[hash[b]])
         +- Calc(select=[b, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg2[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY b, HOP(ts, INTERVAL '0.111' SECOND(1,3), INTERVAL '1' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(b=[$2], $f1=[HOP($0, 111:INTERVAL SECOND(1, 3), 1000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 1000, 111)], select=[b, MAX(c) AS EXPR$0])
   +- Sort(orderBy=[b ASC, ts ASC])
      +- Exchange(distribution=[hash[b]])
         +- Calc(select=[b, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg2[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY b, HOP(ts, INTERVAL '0.111' SECOND(1,3), INTERVAL '1' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(b=[$2], $f1=[HOP($0, 111:INTERVAL SECOND(1, 3), 1000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[b], window=[SlidingGroupWindow('w$, ts, 1000, 111)], select=[b, MAX(c) AS EXPR$0])
   +- Sort(orderBy=[b ASC, ts ASC])
      +- Exchange(distribution=[hash[b]])
         +- Calc(select=[b, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg3[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT countFun(c) FROM MyTable  GROUP BY a, d, HOP(b, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[countFun($3)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[HOP($1, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a, d], window=[SlidingGroupWindow('w$, b, 3600000, 3000)], select=[a, d, countFun(c) AS EXPR$0])
   +- Sort(orderBy=[a ASC, d ASC, b ASC])
      +- Exchange(distribution=[hash[a, d]])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg3[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT countFun(c) FROM MyTable  GROUP BY a, d, HOP(b, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[countFun($3)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[HOP($1, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a, d], window=[SlidingGroupWindow('w$, b, 3600000, 3000)], select=[a, d, countFun(c) AS EXPR$0])
   +- Sort(orderBy=[a ASC, d ASC, b ASC])
      +- Exchange(distribution=[hash[a, d]])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAgg3[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT countFun(c) FROM MyTable  GROUP BY a, d, HOP(b, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[countFun($3)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[HOP($1, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a, d], window=[SlidingGroupWindow('w$, b, 3600000, 3000)], select=[a, d, Final_countFun(EXPR$0) AS EXPR$0])
   +- Sort(orderBy=[a ASC, d ASC, assignedPane$ ASC])
      +- Exchange(distribution=[hash[a, d]])
         +- LocalSortWindowAggregate(groupBy=[a, d], window=[SlidingGroupWindow('w$, b, 3600000, 3000)], select=[a, d, Partial_countFun(c) AS EXPR$0])
            +- Sort(orderBy=[a ASC, d ASC, b ASC])
               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAggWithPaneOptimization[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT COUNT(c) FROM MyTable1 GROUP BY a, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(a=[$1], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, COUNT(c) AS EXPR$0])
   +- Sort(orderBy=[a ASC, ts ASC])
      +- Exchange(distribution=[hash[a]])
         +- Calc(select=[a, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testSlidingWindowSortAggWithPaneOptimization[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT COUNT(c) FROM MyTable1 GROUP BY a, HOP(ts, INTERVAL '3' SECOND, INTERVAL '1' HOUR)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(a=[$1], $f1=[HOP($0, 3000:INTERVAL SECOND, 3600000:INTERVAL HOUR)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- HashWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Final_COUNT(count$0) AS EXPR$0])
   +- Exchange(distribution=[hash[a]])
      +- LocalHashWindowAggregate(groupBy=[a], window=[SlidingGroupWindow('w$, ts, 3600000, 3000)], select=[a, Partial_COUNT(c) AS count$0])
         +- Calc(select=[a, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowHashAgg1[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT COUNT(c) FROM MyTable1 GROUP BY a, TUMBLE(ts, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(a=[$1], $f1=[TUMBLE($0, 3000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- HashWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Final_COUNT(count$0) AS EXPR$0])
   +- Exchange(distribution=[hash[a]])
      +- LocalHashWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Partial_COUNT(c) AS count$0])
         +- Calc(select=[a, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowHashAgg1[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT COUNT(c) FROM MyTable1 GROUP BY a, TUMBLE(ts, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(a=[$1], $f1=[TUMBLE($0, 3000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- HashWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, COUNT(c) AS EXPR$0])
   +- Exchange(distribution=[hash[a]])
      +- Calc(select=[a, ts, c])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowHashAgg1[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT COUNT(c) FROM MyTable1 GROUP BY a, TUMBLE(ts, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
   +- LogicalProject(a=[$1], $f1=[TUMBLE($0, 3000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- HashWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Final_COUNT(count$0) AS EXPR$0])
   +- Exchange(distribution=[hash[a]])
      +- LocalHashWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Partial_COUNT(c) AS count$0])
         +- Calc(select=[a, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowHashAgg2[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), COUNT(a) FROM MyTable GROUP BY a, d, TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3], EXPR$1=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[AVG($3)], EXPR$1=[COUNT($0)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, EXPR$1])
+- HashWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, Final_AVG(sum$0, count$1) AS EXPR$0, Final_COUNT(count$2) AS EXPR$1])
   +- Exchange(distribution=[hash[a, d]])
      +- LocalHashWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, Partial_AVG(c) AS (sum$0, count$1), Partial_COUNT(a) AS count$2])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowHashAgg2[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), COUNT(a) FROM MyTable GROUP BY a, d, TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3], EXPR$1=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[AVG($3)], EXPR$1=[COUNT($0)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, EXPR$1])
+- HashWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, AVG(c) AS EXPR$0, COUNT(a) AS EXPR$1])
   +- Exchange(distribution=[hash[a, d]])
      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowHashAgg2[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), COUNT(a) FROM MyTable GROUP BY a, d, TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3], EXPR$1=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[AVG($3)], EXPR$1=[COUNT($0)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, EXPR$1])
+- HashWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, Final_AVG(sum$0, count$1) AS EXPR$0, Final_COUNT(count$2) AS EXPR$1])
   +- Exchange(distribution=[hash[a, d]])
      +- LocalHashWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, Partial_AVG(c) AS (sum$0, count$1), Partial_COUNT(a) AS count$2])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowWithUdAgg[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT weightedAvg(b, a) AS wAvg FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(wAvg=[$1])
+- LogicalAggregate(group=[{0}], wAvg=[weightedAvg($1, $2)])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], b=[$1], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
SortWindowAggregate(window=[TumblingGroupWindow], select=[Final_weightedAvg(wAvg) AS wAvg])
+- Sort(orderBy=[assignedWindow$ ASC])
   +- Exchange(distribution=[single])
      +- LocalSortWindowAggregate(window=[TumblingGroupWindow], select=[Partial_weightedAvg(b, a) AS wAvg])
         +- Sort(orderBy=[ts ASC])
            +- Calc(select=[ts, b, a])
               +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowSortAgg1[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY a, TUMBLE(ts, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(a=[$1], $f1=[TUMBLE($0, 3000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Final_MAX(max$0) AS EXPR$0])
   +- Sort(orderBy=[a ASC, assignedWindow$ ASC])
      +- Exchange(distribution=[hash[a]])
         +- LocalSortWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Partial_MAX(c) AS max$0])
            +- Sort(orderBy=[a ASC, ts ASC])
               +- Calc(select=[a, ts, c])
                  +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowSortAgg1[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY a, TUMBLE(ts, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(a=[$1], $f1=[TUMBLE($0, 3000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, MAX(c) AS EXPR$0])
   +- Sort(orderBy=[a ASC, ts ASC])
      +- Exchange(distribution=[hash[a]])
         +- Calc(select=[a, ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowSortAgg1[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT MAX(c) FROM MyTable1 GROUP BY a, TUMBLE(ts, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$2])
+- LogicalAggregate(group=[{0, 1}], EXPR$0=[MAX($2)])
   +- LogicalProject(a=[$1], $f1=[TUMBLE($0, 3000:INTERVAL SECOND)], c=[$3])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0])
+- SortWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Final_MAX(max$0) AS EXPR$0])
   +- Sort(orderBy=[a ASC, assignedWindow$ ASC])
      +- Exchange(distribution=[hash[a]])
         +- LocalSortWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], select=[a, Partial_MAX(c) AS max$0])
            +- Sort(orderBy=[a ASC, ts ASC])
               +- Calc(select=[a, ts, c])
                  +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(ts, a, b, c)]]], fields=[ts, a, b, c])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowSortAgg2[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), countFun(a) FROM MyTable GROUP BY a, d, TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3], EXPR$1=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[AVG($3)], EXPR$1=[countFun($0)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, EXPR$1])
+- SortWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, AVG(c) AS EXPR$0, countFun(a) AS EXPR$1])
   +- Sort(orderBy=[a ASC, d ASC, b ASC])
      +- Exchange(distribution=[hash[a, d]])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowSortAgg2[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), countFun(a) FROM MyTable GROUP BY a, d, TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3], EXPR$1=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[AVG($3)], EXPR$1=[countFun($0)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, EXPR$1])
+- SortWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, AVG(c) AS EXPR$0, countFun(a) AS EXPR$1])
   +- Sort(orderBy=[a ASC, d ASC, b ASC])
      +- Exchange(distribution=[hash[a, d]])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowSortAgg2[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT AVG(c), countFun(a) FROM MyTable GROUP BY a, d, TUMBLE(b, INTERVAL '3' SECOND)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[$3], EXPR$1=[$4])
+- LogicalAggregate(group=[{0, 1, 2}], EXPR$0=[AVG($3)], EXPR$1=[countFun($0)])
   +- LogicalProject(a=[$0], d=[$3], $f2=[TUMBLE($1, 3000:INTERVAL SECOND)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[EXPR$0, EXPR$1])
+- SortWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, Final_AVG(sum$0, count$1) AS EXPR$0, Final_countFun(EXPR$1) AS EXPR$1])
   +- Sort(orderBy=[a ASC, d ASC, assignedWindow$ ASC])
      +- Exchange(distribution=[hash[a, d]])
         +- LocalSortWindowAggregate(groupBy=[a, d], window=[TumblingGroupWindow], select=[a, d, Partial_AVG(c) AS (sum$0, count$1), Partial_countFun(a) AS EXPR$1])
            +- Sort(orderBy=[a ASC, d ASC, b ASC])
               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testWindowEndOnly[aggStrategy=NONE]">
    <Resource name="sql">
      <![CDATA[SELECT TUMBLE_END(ts, INTERVAL '4' MINUTE) FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE), c]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[TUMBLE_END($0)])
+- LogicalAggregate(group=[{0, 1}])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[w$end AS EXPR$0])
+- HashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c])
   +- Exchange(distribution=[hash[c]])
      +- LocalHashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c])
         +- Calc(select=[ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowWithUdAgg[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT weightedAvg(b, a) AS wAvg FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(wAvg=[$1])
+- LogicalAggregate(group=[{0}], wAvg=[weightedAvg($1, $2)])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], b=[$1], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
SortWindowAggregate(window=[TumblingGroupWindow], select=[weightedAvg(b, a) AS wAvg])
+- Sort(orderBy=[ts ASC])
   +- Exchange(distribution=[single])
      +- Calc(select=[ts, b, a])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testWindowEndOnly[aggStrategy=ONE_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT TUMBLE_END(ts, INTERVAL '4' MINUTE) FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE), c]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[TUMBLE_END($0)])
+- LogicalAggregate(group=[{0, 1}])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[w$end AS EXPR$0])
+- HashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c])
   +- Exchange(distribution=[hash[c]])
      +- Calc(select=[ts, c])
         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testTumblingWindowWithUdAgg[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT weightedAvg(b, a) AS wAvg FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE)]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(wAvg=[$1])
+- LogicalAggregate(group=[{0}], wAvg=[weightedAvg($1, $2)])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], b=[$1], a=[$0])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
SortWindowAggregate(window=[TumblingGroupWindow], select=[Final_weightedAvg(wAvg) AS wAvg])
+- Sort(orderBy=[assignedWindow$ ASC])
   +- Exchange(distribution=[single])
      +- LocalSortWindowAggregate(window=[TumblingGroupWindow], select=[Partial_weightedAvg(b, a) AS wAvg])
         +- Sort(orderBy=[ts ASC])
            +- Calc(select=[ts, b, a])
               +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
  <TestCase name="testWindowEndOnly[aggStrategy=TWO_PHASE]">
    <Resource name="sql">
      <![CDATA[SELECT TUMBLE_END(ts, INTERVAL '4' MINUTE) FROM MyTable2 GROUP BY TUMBLE(ts, INTERVAL '4' MINUTE), c]]>
    </Resource>
    <Resource name="planBefore">
      <![CDATA[
LogicalProject(EXPR$0=[TUMBLE_END($0)])
+- LogicalAggregate(group=[{0, 1}])
   +- LogicalProject($f0=[TUMBLE($4, 240000:INTERVAL MINUTE)], c=[$2])
      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]])
]]>
    </Resource>
    <Resource name="planAfter">
      <![CDATA[
Calc(select=[w$end AS EXPR$0])
+- HashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c])
   +- Exchange(distribution=[hash[c]])
      +- LocalHashWindowAggregate(groupBy=[c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[c])
         +- Calc(select=[ts, c])
            +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, ts)]]], fields=[a, b, c, d, ts])
]]>
    </Resource>
  </TestCase>
</Root>


text:
class Town < ApplicationRecord
  acts_as_paranoid

  validates :name, presence: true

  belongs_to :user
  validates :user_id, presence: true

  include BelongsToUniverse

  include IsContentPage
  include Serendipitous::Concern

  include Authority::Abilities
  self.authorizer_name = 'ExtendedContentAuthorizer'

  relates :citizens, with: :town_citizens
  relates :floras, with: :town_floras
  relates :creatures, with: :town_creatures
  relates :groups, with: :town_groups
  relates :languages, with: :town_languages
  relates :countries, with: :town_countries
  relates :nearby_landmarks, with: :town_nearby_landmarks

  def description
    overview_field_value('Description')
  end

  def self.content_name
    'town'
  end

  def self.color
    'text-lighten-3 lighten-3 purple'
  end

  def self.text_color
    'text-lighten-3 purple-text'
  end

  def self.hex_color
    '#CE93D8'
  end

  def self.icon
    'location_city'
  end
end

redpajama_set_name: RedPajamaGithub


text:
/* Licensed 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.
 */
package org.camunda.bpm.engine.variable.value;

import java.util.Date;

/**
 *
A {@link PrimitiveValue} corresponding to the Java type {@link Date}.

 *
 * @author Daniel Meyer
 * @since 7.2
 */
public interface DateValue extends PrimitiveValue<Date> {

}


text:
.class public Lcom/quizup/core/GcmBroadcastReceiver;
.super Lo/Con;
.source ""

# direct methods
.method public constructor <init>()V
    .locals 0

    .line 15
    invoke-direct {p0}, Lo/Con;-><init>()V

    return-void
.end method

# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 3

    .line 20
    new-instance v2, Landroid/content/ComponentName;

    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v0

    const-class v1, Lo/ﹿ;

    invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v2, v0, v1}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 22
    invoke-static {}, Lo/ч;->ˊ()Lo/ч;

    sget-object v0, Lo/ϛ;->ʻ:Lo/ϛ;

    .line 25
    invoke-virtual {p2, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    move-result-object v0

    invoke-static {p1, v0}, Lcom/quizup/core/GcmBroadcastReceiver;->ˊ(Landroid/content/Context;Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 26
    const/4 v0, -0x1

    invoke-virtual {p0, v0}, Lcom/quizup/core/GcmBroadcastReceiver;->setResultCode(I)V

    .line 27
    return-void
.end method


text:
import * as THREE from 'three';

import { GUI } from '../../../../../lib/threejs_140/examples/jsm/libs/lil-gui.module.min.js';
import { OrbitControls } from '../../../../../lib/threejs_140/examples/jsm/controls/OrbitControls.js';

document.addEventListener('DOMContentLoaded', () => {
	(() => new App(document.getElementById('webGlCanvas')))();
});

class App {
	constructor(canvas)	{
		this._canvas = canvas;

		this._axesHelper = null;
		this._gridHelper = null;
		this._cone = null;

		this._properties = {
			'axesHelperVisible': true,
			'gridHelperVisible': true,
			'coneRadius': 5,
			'coneHeight': 5,
			'coneRadialSegments': 8,
			'coneHeightSegments': 1,
			'coneOpenEnded': false,
			'coneThetaStart': 0,
			'coneThetaLength': 2 * Math.PI,
			'coneMaterialColor': '#156289',
			'coneWireframeColor': '#FFFFFF',
			'conePositionX': 0,
			'conePositionY': 0,
			'conePositionZ': 0,
			'coneRotationX': 0,
			'coneRotationY': 0,
			'coneRotationZ': 0,
			'coneScaleX': 1,
			'coneScaleY': 1,
			'coneScaleZ': 1,
			'coneWireframe': false
		};

		this._scene = new THREE.Scene();

		this._camera = new THREE.PerspectiveCamera(70, this._getCameraAspect(), 0.1, 500);
		this._camera.position.set(0, 10, 20);

		this._renderer = new THREE.WebGLRenderer({antialias: true});
		this._renderer.setClearColor(0x000000, 1);
		this._renderer.setPixelRatio(window.devicePixelRatio);
		this._renderer.setSize(this._getCanvasWidth(), this._getCanvasHeight());

		this._controls = new OrbitControls(this._camera, this._renderer.domElement);

		// add renderer to the DOM-Tree
		this._canvas.appendChild(this._renderer.domElement);

		window.addEventListener('resize', this._onResizeHandler.bind(this), false);

		this._init();
	}

	_init() {
		this._createGui();
		this._createObject();

		this._render();
	}

	_createObject() {
		this._axesHelper = new THREE.AxesHelper(25);
		this._scene.add(this._axesHelper);

		this._gridHelper = new THREE.GridHelper(50, 50);
		this._scene.add(this._gridHelper);

		this._cone = new THREE.Object3D();
		this._scene.add(this._cone);

		this._cone.add(new THREE.Mesh(
			new THREE.BufferGeometry(),
			new THREE.MeshBasicMaterial( { color: this._properties.coneMaterialColor, side: THREE.DoubleSide } )
		));

		this._cone.add(new THREE.LineSegments(
			new THREE.BufferGeometry(),
			new THREE.LineBasicMaterial( { color: this._properties.coneWireframeColor } )
		));

		this._createGeometry();
	}

	_createGeometry() {
		const geometry = new THREE.ConeGeometry(
			this._properties.coneRadius,
			this._properties.coneHeight,
			this._properties.coneRadialSegments,
			this._properties.coneHeightSegments,
			this._properties.coneOpenEnded,
			this._properties.coneThetaStart,
			this._properties.coneThetaLength
		);

		this._cone.children[0].geometry.dispose();
		this._cone.children[0].geometry = geometry;

		this._cone.children[1].geometry.dispose();
		this._cone.children[1].geometry = new THREE.WireframeGeometry(geometry);
	}

	_createGui() {
		const gui = new GUI();

		gui.add(this._properties, 'axesHelperVisible').onChange((value) => {
			this._axesHelper.visible = value;
		});
		gui.add(this._properties, 'gridHelperVisible').onChange((value) => {
			this._gridHelper.visible = value;
		});

		const folderGeometry = gui.addFolder('Cone Geometry');
		folderGeometry.add(this._properties, 'coneWireframe').onChange((value) => {
			this._cone.children[0].visible = !value;
			/*
				this._cone.children[0].material.wireframe = value;
				this._cone.children[1].visible = !value;
			*/
		});
		folderGeometry.add(this._properties, 'coneOpenEnded').onChange((value) => {
			this._createGeometry();
		});
		folderGeometry.add(this._properties, 'coneRadius', 0.1, 10).step(0.1).onChange((value) => {
			this._createGeometry();
		});
		folderGeometry.add(this._properties, 'coneHeight', 0.1, 10).step(0.1).onChange((value) => {
			this._createGeometry();
		});
		folderGeometry.add(this._properties, 'coneRadialSegments', 3, 64).step(1).onChange((value) => {
			this._createGeometry();
		});
		folderGeometry.add(this._properties, 'coneHeightSegments', 1, 64).step(1).onChange((value) => {
			this._createGeometry();
		});
		folderGeometry.add(this._properties, 'coneThetaStart', 0, 2*Math.PI).step(0.1).onChange((value) => {
			this._createGeometry();
		});
		folderGeometry.add(this._properties, 'coneThetaLength', 0.1, 2*Math.PI).step(0.1).onChange((value) => {
			this._createGeometry();
		});

		const folderMaterial = gui.addFolder('Cone Material');
		folderMaterial.addColor(this._properties, 'coneMaterialColor').onChange((value) => {
			this._cone.children[0].material.color.set(value);
		});
		folderMaterial.addColor(this._properties, 'coneWireframeColor').onChange((value) => {
			this._cone.children[1].material.color.set(value);
		});

		const folderTransformation = gui.addFolder('Cone Transformation');
		folderTransformation.add(this._properties, 'conePositionX', -10, 10).step(0.1).onChange((value) => {
			this._cone.position.x = value;
		});
		folderTransformation.add(this._properties, 'conePositionY', -10, 10).step(0.1).onChange((value) => {
			this._cone.position.y = value;
		});
		folderTransformation.add(this._properties, 'conePositionZ', -10, 10).step(0.1).onChange((value) => {
			this._cone.position.z = value;
		});
		folderTransformation.add(this._properties, 'coneRotationX', 0, 2*Math.PI).step(0.01).onChange((value) => {
			this._cone.rotation.x = value;
		});
		folderTransformation.add(this._properties, 'coneRotationY', 0, 2*Math.PI).step(0.01).onChange((value) => {
			this._cone.rotation.y = value;
		});
		folderTransformation.add(this._properties, 'coneRotationZ', 0, 2*Math.PI).step(0.01).onChange((value) => {
			this._cone.rotation.z = value;
		});
		folderTransformation.add(this._properties, 'coneScaleX', 0.1, 10).step(0.1).onChange((value) => {
			this._cone.scale.x = value;
		});
		folderTransformation.add(this._properties, 'coneScaleY', 0.1, 10).step(0.1).onChange((value) => {
			this._cone.scale.y = value;
		});
		folderTransformation.add(this._properties, 'coneScaleZ', 0.1, 10).step(0.1).onChange((value) => {
			this._cone.scale.z = value;
		});

		gui.close();
	}

	_render() {
		requestAnimationFrame(this._render.bind(this));

		this._renderer.render(this._scene, this._camera);
	}

	_getCanvasHeight() { return this._canvas.offsetHeight; }
	_getCanvasWidth() { return this._canvas.offsetWidth; }

	_getCameraAspect() { return this._getCanvasWidth() / this._getCanvasHeight(); }

	_onResizeHandler(event) {
		this._camera.aspect = this._getCameraAspect();
		this._camera.updateProjectionMatrix();

		this._renderer.setSize(this._getCanvasWidth(), this._getCanvasHeight());
	}
}