[
https://issues.apache.org/jira/browse/FLINK-5881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15878408#comment-15878408
]
ASF GitHub Bot commented on FLINK-5881:
---------------------------------------
Github user clarkyzl commented on a diff in the pull request:
https://github.com/apache/flink/pull/3389#discussion_r102483144
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/utils/ScalarSqlFunction.scala
---
@@ -136,8 +136,18 @@ object ScalarSqlFunction {
}
override def getOperandCountRange: SqlOperandCountRange = {
- val signatureLengths = signatures.map(_.length)
- SqlOperandCountRanges.between(signatureLengths.min,
signatureLengths.max)
+ var min = 255
+ var max = -1
+ signatures.foreach(sig => {
+ var len = sig.length
+ if (len > 0 && sig(sig.length -1).isArray) {
+ max = 254 // according to JVM spec 4.3.3
--- End diff --
Hi @wuchong . Yes, according to JVM specification. It may have 255
parameters, if the method is static. If the method is not static, the pointer
"this" will be one of the parameters, so it is 254.
FYI,
http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3
> ScalarFunction(UDF) should support variable types and variable arguments
> -------------------------------------------------------------------------
>
> Key: FLINK-5881
> URL: https://issues.apache.org/jira/browse/FLINK-5881
> Project: Flink
> Issue Type: Sub-task
> Reporter: Zhuoluo Yang
> Assignee: Zhuoluo Yang
>
> As a sub-task of FLINK-5826. We would like to support the ScalarFunction
> first and make the review a little bit easier.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)