[GitHub] flink pull request #5011: [FLINK-8013] [table] Support aggregate functions w...

2017-11-15 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/5011


---


[GitHub] flink pull request #5011: [FLINK-8013] [table] Support aggregate functions w...

2017-11-15 Thread twalthr
Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/5011#discussion_r151134570
  
--- Diff: 
flink-tests/src/test/scala/org/apache/flink/api/scala/util/CollectionDataSets.scala
 ---
@@ -55,7 +55,6 @@ object CollectionDataSets {
 data.+=((19, 6L, "Comment#13"))
 data.+=((20, 6L, "Comment#14"))
 data.+=((21, 6L, "Comment#15"))
-Random.shuffle(data)
--- End diff --

No, the result of this shuffle is discarded. `data` is not modified.


---


[GitHub] flink pull request #5011: [FLINK-8013] [table] Support aggregate functions w...

2017-11-15 Thread fhueske
Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/5011#discussion_r151108713
  
--- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/utils/UserDefinedAggFunctions.scala
 ---
@@ -0,0 +1,107 @@
+package org.apache.flink.table.utils
--- End diff --

ASF header missing :-)


---


[GitHub] flink pull request #5011: [FLINK-8013] [table] Support aggregate functions w...

2017-11-15 Thread fhueske
Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/5011#discussion_r151102741
  
--- Diff: 
flink-tests/src/test/scala/org/apache/flink/api/scala/util/CollectionDataSets.scala
 ---
@@ -55,7 +55,6 @@ object CollectionDataSets {
 data.+=((19, 6L, "Comment#13"))
 data.+=((20, 6L, "Comment#14"))
 data.+=((21, 6L, "Comment#15"))
-Random.shuffle(data)
--- End diff --

I think this should be added back.


---


[GitHub] flink pull request #5011: [FLINK-8013] [table] Support aggregate functions w...

2017-11-15 Thread fhueske
Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/5011#discussion_r151102649
  
--- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/utils/UserDefinedAggFunctions.scala
 ---
@@ -0,0 +1,107 @@
+package org.apache.flink.table.utils
+
+import org.apache.flink.table.functions.AggregateFunction
+import org.apache.flink.api.java.tuple.{Tuple2 => JTuple2}
+import java.lang.{Integer => JInt}
+import java.lang.{Float => JFloat}
+import java.util
+
+import org.apache.flink.api.common.typeinfo.TypeInformation
+import org.apache.flink.api.java.typeutils.{ObjectArrayTypeInfo, 
TupleTypeInfo}
+import org.apache.flink.table.api.Types
+
+/**
+  * User-defined aggregation function to compute the TOP 10 most visited 
pages.
--- End diff --

Adjust the comment:
```
User-defined aggregation function to compute the top 10 Int IDs with the 
highest Float values.
We use an Array[Tuple2[Int, Float]] as accumulator to store the top 10 
entries.
```

Could also be simplified to just store the Float.


---


[GitHub] flink pull request #5011: [FLINK-8013] [table] Support aggregate functions w...

2017-11-14 Thread twalthr
GitHub user twalthr opened a pull request:

https://github.com/apache/flink/pull/5011

[FLINK-8013] [table] Support aggregate functions with generic arrays

## What is the purpose of the change

Adds supports for aggregate functions with generic arrays and fixes other 
bugs.

## Brief change log

- Changes to the type extraction at several locations.

## Verifying this change

Complex aggregation function added.

## Does this pull request potentially affect one of the following parts:

  - Dependencies (does it add or upgrade a dependency): no
  - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
  - The serializers: no
  - The runtime per-record code paths (performance sensitive): no
  - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: no
  - The S3 file system connector: no

## Documentation

  - Does this pull request introduce a new feature? no
  - If yes, how is the feature documented? not applicable


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/twalthr/flink FLINK-8013

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/5011.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #5011


commit 5a18f5e697ad67d1aa08873a5ba65e4eb0bad210
Author: twalthr 
Date:   2017-11-14T10:06:54Z

[FLINK-8013] [table] Support aggregate functions with generic arrays




---