Yanquan Lv created FLINK-36982:
----------------------------------
Summary: Failed to run pipeline if using `DATE_FORMAT(NOW(),
'yyyy-MM-dd') as datetime` in
Key: FLINK-36982
URL: https://issues.apache.org/jira/browse/FLINK-36982
Project: Flink
Issue Type: New Feature
Components: Flink CDC
Affects Versions: cdc-3.2.1, cdc-3.2.0
Reporter: Yanquan Lv
How to produce:
{code:java}
source:
type: values
sink:
type: values
transform:
projection: DATE_FORMAT(CURRENT_TIMESTAMP, 'yyyy-MM-dd') as datetime {code}
org.apache.flink.util.FlinkRuntimeException:
org.apache.flink.api.common.InvalidProgramException: Expression cannot be
compiled. This is a bug. Please file an issue.
Expression: import static
org.apache.flink.cdc.runtime.functions.SystemFunctionUtils.*;dateFormat(currentTimestamp(__epoch_time__),
"yyyy-MM-dd")
at
org.apache.flink.cdc.runtime.operators.transform.TransformExpressionCompiler.compileExpression(TransformExpressionCompiler.java:84)
at
org.apache.flink.cdc.runtime.operators.transform.ProjectionColumnProcessor.<init>(ProjectionColumnProcessor.java:71)
at
org.apache.flink.cdc.runtime.operators.transform.ProjectionColumnProcessor.of(ProjectionColumnProcessor.java:83)
Howerver, the following job file can work well:
{code:java}
source:
type: values
sink:
type: values
transform:
projection: DATE_FORMAT(LOCALTIMESTAMP, 'yyyy-MM-dd') as datetime {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)