You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by lmalds <gi...@git.apache.org> on 2017/06/16 15:16:11 UTC

[GitHub] flink pull request #4135: Flink 6602 -- bug fix

GitHub user lmalds opened a pull request:

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

    Flink 6602 -- bug fix

    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/lmalds/flink master

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

    https://github.com/apache/flink/pull/4135.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 #4135
    
----
commit 3bdcffbb4bbb84d0eec152c742e8161d6b717aed
Author: zhe li <zhe li>
Date:   2017-06-16T15:13:09Z

    Flink 6602 -- bug fix

----


---
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 #4135: Flink 6602 -- bug fix

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

    https://github.com/apache/flink/pull/4135#discussion_r122525124
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/schema/StreamTableSourceTable.scala ---
    @@ -39,6 +39,9 @@ class StreamTableSourceTable[T](
         val fieldCnt = fieldNames.length
     
         val rowtime = tableSource match {
    +      case nullTimeSource : DefinedRowtimeAttribute if nullTimeSource.getRowtimeAttribute == null => None
    +      case emptyStringTimeSource : DefinedRowtimeAttribute if emptyStringTimeSource.getRowtimeAttribute.trim.equals("")  =>
    +        throw TableException("The name of the rowtime attribute must not be empty.")
           case timeSource: DefinedRowtimeAttribute if timeSource.getRowtimeAttribute != null =>
    --- End diff --
    
    You mean there is no need to add the last if condition (should change "case timeSource: DefinedRowtimeAttribute if timeSource.getRowtimeAttribute != null =>" to "case timeSource: DefinedRowtimeAttribute =>")? Is it right?
    
    Thanks for your patient guidance.
    
    I commited again.


---
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 #4135: Flink 6602 -- bug fix

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

    https://github.com/apache/flink/pull/4135#discussion_r122484136
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/schema/StreamTableSourceTable.scala ---
    @@ -39,6 +39,8 @@ class StreamTableSourceTable[T](
         val fieldCnt = fieldNames.length
     
         val rowtime = tableSource match {
    +      case emptyStringTimeSource : DefinedRowtimeAttribute if emptyStringTimeSource.getRowtimeAttribute.trim.equals("")  =>
    --- End diff --
    
    I checked the null timeAttribute first, and then check empty string timeAttribute when it is not null, if it is empty string, throw TableException.
    
    Please check again.


---
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 #4135: Flink 6602 -- bug fix

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

    https://github.com/apache/flink/pull/4135
  
    Yes, I will. Thank you.


---
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 #4135: Flink 6602 -- bug fix

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

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


---
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 #4135: Flink 6602 -- bug fix

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

    https://github.com/apache/flink/pull/4135
  
    On more thing. It would be good if you build the flink-table module locally before submitting or updating a PR. The PR fails because some lines exceed the line length limit. Thank you.


---
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 #4135: Flink 6602 -- bug fix

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

    https://github.com/apache/flink/pull/4135#discussion_r122487052
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/schema/StreamTableSourceTable.scala ---
    @@ -39,6 +39,9 @@ class StreamTableSourceTable[T](
         val fieldCnt = fieldNames.length
     
         val rowtime = tableSource match {
    +      case nullTimeSource : DefinedRowtimeAttribute if nullTimeSource.getRowtimeAttribute == null => None
    +      case emptyStringTimeSource : DefinedRowtimeAttribute if emptyStringTimeSource.getRowtimeAttribute.trim.equals("")  =>
    +        throw TableException("The name of the rowtime attribute must not be empty.")
           case timeSource: DefinedRowtimeAttribute if timeSource.getRowtimeAttribute != null =>
    --- End diff --
    
    The `if` condition can be removed.
    Then it should be fine.


---
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 #4135: Flink 6602 -- bug fix

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

    https://github.com/apache/flink/pull/4135#discussion_r122469825
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/schema/StreamTableSourceTable.scala ---
    @@ -39,6 +39,8 @@ class StreamTableSourceTable[T](
         val fieldCnt = fieldNames.length
     
         val rowtime = tableSource match {
    +      case emptyStringTimeSource : DefinedRowtimeAttribute if emptyStringTimeSource.getRowtimeAttribute.trim.equals("")  =>
    --- End diff --
    
    We should move the check `getRowtimeAttribute == null` (currently `case _ => None`) to the top to avoid an NPE if the attribute is null.


---
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 #4135: Flink 6602 -- bug fix

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

    https://github.com/apache/flink/pull/4135
  
    thanks for the update @lmalds. I'll add two tests and will merge this


---
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.
---