You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Kartikey Pant (Jira)" <ji...@apache.org> on 2024/06/12 09:11:00 UTC
[jira] [Comment Edited] (FLINK-26951) Add HASH supported in SQL & Table API
[ https://issues.apache.org/jira/browse/FLINK-26951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854329#comment-17854329 ]
Kartikey Pant edited comment on FLINK-26951 at 6/12/24 9:10 AM:
----------------------------------------------------------------
Hey [~lincoln.86xy], thanks for the additional context on this one.
I've reviewed the current cryptographic functions available in Flink Table SQL, including SHA1, MD5, and SHA2 ([link|https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/systemfunctions/#hash-functions]). It appears that aligning Flink's `hash()` function with the algorithm used by the HIVE `hash()` UDF ([HIVE source|https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java]) would ensure consistency. However, given the deprecation of the HIVE `hash()` UDF from Hive 3.x, we might want to think about whether adding this feature is really needed. Your thoughts on this approach would be greatly valued.
was (Author: JIRAUSER301503):
Hey [~lincoln.86xy], thanks for the additional context on this one.
I've reviewed the current cryptographic functions available in Flink Table SQL, including SHA1, MD5, and SHA2 ([link|https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/systemfunctions/#hash-functions]). It appears that aligning Flink's `hash()` function with the algorithm used by the HIVE `hash()` UDF ([HIVE source|https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFHash.java]) would ensure consistency. However, given the deprecation of the HIVE `hash()` UDF, we might want to think about whether adding this feature is really needed. Your thoughts on this approach would be greatly valued.
> Add HASH supported in SQL & Table API
> -------------------------------------
>
> Key: FLINK-26951
> URL: https://issues.apache.org/jira/browse/FLINK-26951
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: dalongliu
> Priority: Major
> Fix For: 1.20.0
>
>
> Returns a hash value of the arguments.
> Syntax:
> {code:java}
> hash(expr1, ...) {code}
> Arguments:
> * {{{}exprN{}}}: An expression of any type.
> Returns:
> An INTEGER.
> Examples:
> {code:java}
> > SELECT hash('Flink', array(123), 2);
> -1321691492 {code}
> See more:
> * [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hash]
> * [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)