[
https://issues.apache.org/jira/browse/FLINK-6926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16333338#comment-16333338
]
ASF GitHub Bot commented on FLINK-6926:
---------------------------------------
GitHub user genged opened a pull request:
https://github.com/apache/flink/pull/5324
[FLINK-6926] [table] Add support for SHA-224, SHA-384, SHA-512
## What is the purpose of the change
This pull request implements SHA224, SHA384, SHA512 support in Flink SQL as
discussed in FLINK-6926
## Brief change log
- Added SHA224, SHA384, SHA512 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
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? docs
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/genged/flink f-6926-support-full-SHA2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5324.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 #5324
----
commit b4f260f5b1d23cf1e4978d2fdd8d01d337cc4e1a
Author: Michael Gendelman <genged@...>
Date: 2018-01-13T21:24:08Z
[FLINK-6926] [table] Add support for SHA-224, SHA-384, SHA-512
----
> Add support for MD5, SHA1 and SHA2
> ----------------------------------
>
> 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: Michael Gendelman
> Priority: Major
> Fix For: 1.5.0
>
>
> 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
(v7.6.3#76005)