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

[GitHub] flink pull request #3468: [FLINK-5824] Fix String/byte conversions without e...

GitHub user dawidwys opened a pull request:

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

    [FLINK-5824] Fix String/byte conversions without explicit encoding

    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/dawidwys/flink flink5824

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

    https://github.com/apache/flink/pull/3468.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 #3468
    
----
commit 0aaf7a843ffb4ef5667e9b2517fd537f3b0323b5
Author: Dawid Wysakowicz <da...@getindata.com>
Date:   2017-03-03T12:24:49Z

    [FLINK-5824] Fix String/byte conversions without explicit encoding

----


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    I think starting with `flink-tests` is good, we can then improve from there.


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    So as I mentioned in JIRA I don't see a way to do it in checkstyle rule. 
    
    I managed to implement a test that performs the check using `Reflections` but I don't know where shall I place it. The problem is that only files from packages that are dependencies to the module with this test will be checked. First idea I had was to put it in the `filnk-tests` module, but it does not depend on e.g. any of `flink-connectors`


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    As your current replacement with `ConfigConstants.DEFAULT_CHARSET`, it's better for setting other charsets. UTF_8 has clear semantics. If we'll never change the default charset utf_8 to other charset, I prefer `ConfigConstants.UTF_8`


---
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 #3468: [FLINK-5824] Fix String/byte conversions without e...

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

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


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    I'm in favor of using ```ConfigConstants.DEFAULT_CHARSET```. Using ```ConfigConstants.UTF_8``` does not imply in any way that this is the default that anyone should use; it would be equivalent to using ```StandardCharsets.UTF_8```.


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    I would prefer to keep the value in `ConfigConstants`, just because it clearly defines in one place what we want to use as the default (rather than passing `StandardCharsets.UTF_8` everywhere).
    
    As for the name, I think both suggestions are fine in the end. It is unlikely that we ever switch the charset, especially since checkpoints and high-availability storage encodes data in that charset.
    
    What would be good to have is a test that checks that we never use a byte conversion without a charset. Maybe a checkstyle rule. If that does not work, we can try and do a `Reflections` test (see RpcCompletenessTest for an example of how to reflectively analyze code in tests).


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    Good changes. `ConfigConstants.DEFAULT_CHARSET` change to `ConfigConstants.UTF_8 ` may be more clear.


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    @shijinkui I think the idea of having this Constant in `ConfigConstant` is it could potentially be set to some other value. If I am mistaken I would instead of using `ConfigConstants.UTF_8` opt for java7's `StandardCharsets.UTF_8` directly.


---
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 #3468: [FLINK-5824] Fix String/byte conversions without explicit...

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

    https://github.com/apache/flink/pull/3468
  
    Good change, thanks!
    Merging 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.
---