You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by shaoxuan-wang <gi...@git.apache.org> on 2017/03/29 20:51:12 UTC

[GitHub] flink pull request #3647: [FLINK-5915] [table] forward the entire aggregate ...

GitHub user shaoxuan-wang opened a pull request:

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

    [FLINK-5915] [table] forward the entire aggregate ArgList to aggregate runtime functions

    This PR partially solved "FLINK-5915 Add support for the aggregate on multi fields".
    The roadmap of UDAGG would be 1. codeGen all the runtime aggregate functions; 2. add UDAGG tableAPI interface.
    I would like to kick this PR off earlier as: a) we can finalize the runtime function while doing the codeGen; b) as more and more (over) aggregates are implemented, it would be good if we can finalize the interface and share library to the stage (as we planned) as earlier as possible. 
    
    Note that: though the entire aggregate ArgList is forwarded to the runtime function, for the functions that have not been codeGened, we will still support only one column aggregate input.
    
    
    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [ ] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [ ] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [ ] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed


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

    $ git pull https://github.com/shaoxuan-wang/flink FLINK5915-submit

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

    https://github.com/apache/flink/pull/3647.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 #3647
    
----
commit 128479c24003e8f0bd67542f336f9ae20dade352
Author: shaoxuan-wang <ws...@gmail.com>
Date:   2017-03-29T20:41:38Z

    [FLINK-5915] [table] forward the entire aggregate ArgList to aggregate runtime functions

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3647: [FLINK-5915] [table] forward the entire aggregate ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3647: [FLINK-5915] [table] forward the entire aggregate ArgList...

Posted by shaoxuan-wang <gi...@git.apache.org>.
Github user shaoxuan-wang commented on the issue:

    https://github.com/apache/flink/pull/3647
  
    Thanks @fhueske, I overlooked a list is not always an arraylist. I change it to scala array, but keep the type as integer, as this is type returned (and not easy to be casted to Int) from aggregateCall.getArgList. I updated PR and also rebased to the master (as I noticed there are a few over aggregates have been recently merged), so it will be easier for you to merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3647: [FLINK-5915] [table] forward the entire aggregate ArgList...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on the issue:

    https://github.com/apache/flink/pull/3647
  
    Thanks @shaoxuan-wang, I found a way to cast the `Integer` to `Int`. Will change that and merge the PR.
    
    Thanks, Fabian


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3647: [FLINK-5915] [table] forward the entire aggregate ...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3647#discussion_r109032005
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala ---
    @@ -857,28 +857,30 @@ object AggregateUtil {
           aggregateCalls: Seq[AggregateCall],
           inputType: RelDataType,
           needRetraction: Boolean)
    -  : (Array[Int], Array[TableAggregateFunction[_ <: Any]]) = {
    +  : (Array[util.List[Integer]], Array[TableAggregateFunction[_ <: Any]]) = {
    --- End diff --
    
    Can we use an `Array[Int]` instead of a `List[Integer]`?
    
    Scala `Int` is compiled to Java `int` primitive. `java.lang.Integer` is a boxed type.
    Also an array access is faster than a `List.get()` access (`ArrayList.get()` would be a bit better).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3647: [FLINK-5915] [table] forward the entire aggregate ArgList...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on the issue:

    https://github.com/apache/flink/pull/3647
  
    The change looks good in general. I'd prefer to use an array instead of a List though.
    What do you think @shaoxuan-wang?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---