flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6926) Add MD5/SHA1/SHA2 supported in SQL
Date Wed, 11 Oct 2017 21:19:01 GMT

    [ https://issues.apache.org/jira/browse/FLINK-6926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200980#comment-16200980
] 

ASF GitHub Bot commented on FLINK-6926:
---------------------------------------

GitHub user genged opened a pull request:

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

    [FLINK-6926] [table] Add support for MD5,SHA1 and SHA256 in SQL

    ## What is the purpose of the change
    
    This pull request implements MD5, SHA1 and SHA256 support in Flink SQL as discussed in
FLINK-6926
    
    ## Brief change log
    
      - Added MD5, SHA1, SHA256 SQL functions
      - Added relevant unit tests
    
    ## Verifying this change
    
    This change added tests and can be verified as follows:
    
      - Added SQL expression tests
      - Added HashFunctionsTest with testAllApis
      - Validated both correct calculation and behavior for null input
    
    ## 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: don't know
      - The runtime per-record code paths (performance sensitive): don't know
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing,
Yarn/Mesos, ZooKeeper: no
    
    ## Documentation
    
      - Does this pull request introduce a new feature? yes
      - If yes, how is the feature documented? not documented
    


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

    $ git pull https://github.com/genged/flink master

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

    https://github.com/apache/flink/pull/4810.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 #4810
    
----
commit 670ffd0c438a6d519d580a077582121b66b425f5
Author: Michael Gendelman <genged@gmail.com>
Date:   2017-10-08T21:00:39Z

    [FLINK-6926] [table] Add support for MD5,SHA1 and SHA256 in SQL

----


> Add MD5/SHA1/SHA2 supported in SQL
> ----------------------------------
>
>                 Key: FLINK-6926
>                 URL: https://issues.apache.org/jira/browse/FLINK-6926
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>    Affects Versions: 1.4.0
>            Reporter: sunjincheng
>            Assignee: Shaoxuan Wang
>
> MD5(str)Calculates an MD5 128-bit checksum for the string. The value is returned as a
string of 32 hexadecimal digits, or NULL if the argument was NULL. The return value can, for
example, be used as a hash key. See the notes at the beginning of this section about storing
hash values efficiently.
> The return value is a nonbinary string in the connection character set.
> * Example:
>  MD5('testing') - 'ae2b1fca515949e5d54fb22b8ed95575'
> * See more:
> ** [MySQL| https://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html#function_sha1]
> SHA1(str), SHA(str)Calculates an SHA-1 160-bit checksum for the string, as described
in RFC 3174 (Secure Hash Algorithm). The value is returned as a string of 40 hexadecimal digits,
or NULL if the argument was NULL. One of the possible uses for this function is as a hash
key. See the notes at the beginning of this section about storing hash values efficiently.
You can also use SHA1() as a cryptographic function for storing passwords. SHA() is synonymous
with SHA1().
> The return value is a nonbinary string in the connection character set.
> * Example:
>   SHA1('abc') -> 'a9993e364706816aba3e25717850c26c9cd0d89d'
> SHA2(str, hash_length)Calculates the SHA-2 family of hash functions (SHA-224, SHA-256,
SHA-384, and SHA-512). The first argument is the cleartext string to be hashed. The second
argument indicates the desired bit length of the result, which must have a value of 224, 256,
384, 512, or 0 (which is equivalent to 256). If either argument is NULL or the hash length
is not one of the permitted values, the return value is NULL. Otherwise, the function result
is a hash value containing the desired number of bits. See the notes at the beginning of this
section about storing hash values efficiently.
> The return value is a nonbinary string in the connection character set.
> * Example:
> SHA2('abc', 224) -> '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7'
> * See more:
> ** [MySQL| https://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html#function_sha2]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message