Xu Mingmin created BEAM-3325:
--------------------------------
Summary: optional parameter is not supported in BeamSQL
Key: BEAM-3325
URL: https://issues.apache.org/jira/browse/BEAM-3325
Project: Beam
Issue Type: Bug
Components: dsl-sql
Reporter: Xu Mingmin
I'm wring a UDF with optional parameters, the method code is:
{code}
public static String eval(String kvString, String keyName
, @Parameter(name = "pd", optional = true) String pairSeperator
, @Parameter(name = "kvd", optional = true) String kvSeperator){
//...
}
{code}
And I see this error when assembling a Beam pipeline:
{code}
Execution Plan:
BeamProjectRel(ITEM_ID=[CAST(KV_EXT($0, 'itemId', DEFAULT(),
DEFAULT())):BIGINT], TRANSACTION_ID=[CAST(KV_EXT($0, 'transactionId',
DEFAULT(), DEFAULT())):BIGINT], TRANSACTION_TIME=[KV_EXT($0, 'createdDT',
DEFAULT(), DEFAULT())])
BeamIOSourceRel(table=[[....]])
Exception in thread "main" java.lang.RuntimeException:
java.lang.UnsupportedOperationException: Operator: DEFAULT is not supported yet!
at .........
Caused by: java.lang.UnsupportedOperationException: Operator: DEFAULT is not
supported yet!
at
org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlFnExecutor.buildExpression(BeamSqlFnExecutor.java:425)
at
org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlFnExecutor.buildExpression(BeamSqlFnExecutor.java:202)
at
org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlFnExecutor.buildExpression(BeamSqlFnExecutor.java:202)
at
org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlFnExecutor.<init>(BeamSqlFnExecutor.java:126)
at
org.apache.beam.sdk.extensions.sql.impl.rel.BeamProjectRel.buildBeamPipeline(BeamProjectRel.java:70)
at
org.apache.beam.sdk.extensions.sql.impl.planner.BeamQueryPlanner.compileBeamPipeline(BeamQueryPlanner.java:116)
at
org.apache.beam.sdk.extensions.sql.BeamSqlCli.compilePipeline(BeamSqlCli.java:112)
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)