Yes, as mentioned in the first email, what I want is something like spark transform.
But I found that lambda function is not supported in Calcite https://issues.apache.org/jira/browse/CALCITE-3679, so it may be hard to do the same thing in Flink. I'll write some customized UDF for my requirements for now. Thanks you so much.