beyond1920 commented on a change in pull request #17205: URL: https://github.com/apache/flink/pull/17205#discussion_r708810575
########## File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/MatchRowTimeFunction.java ########## @@ -0,0 +1,129 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.planner.functions.sql; + +import org.apache.flink.table.api.ValidationException; +import org.apache.flink.table.planner.calcite.FlinkTypeFactory; + +import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.sql.SqlCallBinding; +import org.apache.calcite.sql.SqlFunction; +import org.apache.calcite.sql.SqlFunctionCategory; +import org.apache.calcite.sql.SqlKind; +import org.apache.calcite.sql.SqlNode; +import org.apache.calcite.sql.SqlOperandCountRange; +import org.apache.calcite.sql.SqlOperatorBinding; +import org.apache.calcite.sql.type.SqlOperandCountRanges; + +import java.util.List; + +/** + * Function used to access an row time attribute with TIMESTAMP or TIMESTAMP_LTZ type from + * MATCH_RECOGNIZE. The function could receive no operand or one operand which is a field reference + * with row time attribute. If there is no operand, the function returns row time attribute with + * TIMESTAMP. Else, return type is same with operand type. + */ +public class MatchRowTimeFunction extends SqlFunction { + + /** Creates a window table function with a given name. */ + public MatchRowTimeFunction() { + super( + "MATCH_ROWTIME", + SqlKind.OTHER_FUNCTION, + null, + null, + null, Review comment: Do you say return type inference or operand type inference? If you said return type inference, I have overwriten the `inferReturnType` method. I thought it could achieve same goals. Please correct me if I'm wrong. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org