flink git commit: [FLINK-6517] [table] Support multiple consecutive windows

2017-05-15 Thread twalthr
Repository: flink
Updated Branches:
  refs/heads/release-1.3 5d05c18d8 -> e23328e4a


[FLINK-6517] [table] Support multiple consecutive windows

This closes #3897.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/e23328e4
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/e23328e4
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/e23328e4

Branch: refs/heads/release-1.3
Commit: e23328e4ad4a370af94b1a7441dfcf356eda62f5
Parents: 5d05c18
Author: twalthr 
Authored: Fri May 12 10:03:25 2017 +0200
Committer: twalthr 
Committed: Mon May 15 12:16:36 2017 +0200

--
 .../table/api/StreamTableEnvironment.scala  |  3 +
 .../flink/table/api/scala/expressionDsl.scala   |  8 ++-
 .../calcite/RelTimeIndicatorConverter.scala | 18 --
 .../table/expressions/fieldExpression.scala | 60 ++-
 .../table/expressions/windowProperties.scala| 25 +---
 .../table/plan/logical/LogicalWindow.scala  |  2 +-
 .../flink/table/plan/logical/operators.scala| 36 +---
 .../DataStreamGroupWindowAggregate.scala|  8 ++-
 .../DataStreamLogicalWindowAggregateRule.scala  | 10 ++--
 .../table/typeutils/TimeIndicatorTypeInfo.scala |  3 +-
 .../stream/StreamTableEnvironmentTest.scala |  7 +++
 .../api/scala/stream/TableSourceTest.scala  |  4 +-
 .../scala/stream/table/GroupWindowTest.scala| 27 -
 .../calcite/RelTimeIndicatorConverterTest.scala | 54 -
 .../datastream/TimeAttributesITCase.scala   | 62 +++-
 15 files changed, 260 insertions(+), 67 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/flink/blob/e23328e4/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
index 994ac80..c430b21 100644
--- 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
+++ 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
@@ -467,6 +467,9 @@ abstract class StreamTableEnvironment(
   proctime = Some(idx, name)
 }
   case (u: UnresolvedFieldReference, _) => fieldNames = u.name :: 
fieldNames
+
+  case _ =>
+throw new TableException("Time attributes can only be defined on field 
references.")
 }
 
 if (rowtime.isDefined && fieldNames.contains(rowtime.get._2)) {

http://git-wip-us.apache.org/repos/asf/flink/blob/e23328e4/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
index 6d15212..b87bb6d 100644
--- 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
+++ 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
@@ -234,12 +234,14 @@ trait ImplicitExpressionOperations {
   def desc = Desc(expr)
 
   /**
-* Returns the start time of a window when applied on a window reference.
+* Returns the start time (inclusive) of a window when applied on a window 
reference.
 */
   def start = WindowStart(expr)
 
   /**
-* Returns the end time of a window when applied on a window reference.
+* Returns the end time (exclusive) of a window when applied on a window 
reference.
+*
+* e.g. if a window ends at 10:59:59.999 this property will return 
11:00:00.000.
 */
   def end = WindowEnd(expr)
 
@@ -683,7 +685,7 @@ trait ImplicitExpressionOperations {
 */
   def element() = ArrayElement(expr)
 
-  // Schema definition
+  // Time definition
 
   /**
 * Declares a field as the rowtime attribute for indicating, accessing, and 
working in

http://git-wip-us.apache.org/repos/asf/flink/blob/e23328e4/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala
index 7ceb397..21fa70b 100644
--- 

flink git commit: [FLINK-6517] [table] Support multiple consecutive windows

2017-05-15 Thread twalthr
Repository: flink
Updated Branches:
  refs/heads/master ae423e1d1 -> c86f46cdc


[FLINK-6517] [table] Support multiple consecutive windows

This closes #3897.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/c86f46cd
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/c86f46cd
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/c86f46cd

Branch: refs/heads/master
Commit: c86f46cdc1c0e2be30876ef358e7ab3c1daa14e9
Parents: ae423e1
Author: twalthr 
Authored: Fri May 12 10:03:25 2017 +0200
Committer: twalthr 
Committed: Mon May 15 12:14:36 2017 +0200

--
 .../table/api/StreamTableEnvironment.scala  |  3 +
 .../flink/table/api/scala/expressionDsl.scala   |  8 ++-
 .../calcite/RelTimeIndicatorConverter.scala | 18 --
 .../table/expressions/fieldExpression.scala | 60 ++-
 .../table/expressions/windowProperties.scala| 25 +---
 .../table/plan/logical/LogicalWindow.scala  |  2 +-
 .../flink/table/plan/logical/operators.scala| 36 +---
 .../DataStreamGroupWindowAggregate.scala|  8 ++-
 .../DataStreamLogicalWindowAggregateRule.scala  | 10 ++--
 .../table/typeutils/TimeIndicatorTypeInfo.scala |  3 +-
 .../stream/StreamTableEnvironmentTest.scala |  7 +++
 .../api/scala/stream/TableSourceTest.scala  |  4 +-
 .../scala/stream/table/GroupWindowTest.scala| 27 -
 .../calcite/RelTimeIndicatorConverterTest.scala | 54 -
 .../datastream/TimeAttributesITCase.scala   | 62 +++-
 15 files changed, 260 insertions(+), 67 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/flink/blob/c86f46cd/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
index 994ac80..c430b21 100644
--- 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
+++ 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
@@ -467,6 +467,9 @@ abstract class StreamTableEnvironment(
   proctime = Some(idx, name)
 }
   case (u: UnresolvedFieldReference, _) => fieldNames = u.name :: 
fieldNames
+
+  case _ =>
+throw new TableException("Time attributes can only be defined on field 
references.")
 }
 
 if (rowtime.isDefined && fieldNames.contains(rowtime.get._2)) {

http://git-wip-us.apache.org/repos/asf/flink/blob/c86f46cd/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
index 6d15212..b87bb6d 100644
--- 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
+++ 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
@@ -234,12 +234,14 @@ trait ImplicitExpressionOperations {
   def desc = Desc(expr)
 
   /**
-* Returns the start time of a window when applied on a window reference.
+* Returns the start time (inclusive) of a window when applied on a window 
reference.
 */
   def start = WindowStart(expr)
 
   /**
-* Returns the end time of a window when applied on a window reference.
+* Returns the end time (exclusive) of a window when applied on a window 
reference.
+*
+* e.g. if a window ends at 10:59:59.999 this property will return 
11:00:00.000.
 */
   def end = WindowEnd(expr)
 
@@ -683,7 +685,7 @@ trait ImplicitExpressionOperations {
 */
   def element() = ArrayElement(expr)
 
-  // Schema definition
+  // Time definition
 
   /**
 * Declares a field as the rowtime attribute for indicating, accessing, and 
working in

http://git-wip-us.apache.org/repos/asf/flink/blob/c86f46cd/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala
index 7ceb397..21fa70b 100644
---