jnh5y commented on code in PR #23634:
URL: https://github.com/apache/flink/pull/23634#discussion_r1380561361
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/expressions/fieldExpression.scala:
##########
@@ -103,71 +103,6 @@ case class TableReference(name: String, tableOperation:
QueryOperation)
override def toString: String = s"$name"
}
-abstract class TimeAttribute(val expression: PlannerExpression)
- extends UnaryExpression
- with WindowProperty {
-
- override private[flink] def child: PlannerExpression = expression
-}
-
-case class RowtimeAttribute(expr: PlannerExpression) extends
TimeAttribute(expr) {
-
- override private[flink] def validateInput(): ValidationResult = {
- child match {
- case WindowReference(_, Some(tpe: TypeInformation[_])) if
isProctimeIndicatorType(tpe) =>
- ValidationFailure("A proctime window cannot provide a rowtime
attribute.")
- case WindowReference(_, Some(tpe: TypeInformation[_])) if
isRowtimeIndicatorType(tpe) =>
- // rowtime window
- ValidationSuccess
- case WindowReference(_, Some(tpe)) if tpe == Types.LONG || tpe ==
Types.SQL_TIMESTAMP =>
- // batch time window
- ValidationSuccess
- case WindowReference(_, _) =>
- ValidationFailure("Reference to a rowtime or proctime window
required.")
- case any =>
- ValidationFailure(
- s"The '.rowtime' expression can only be used for table definitions
and windows, " +
- s"while [$any] was found.")
- }
- }
-
- override def resultType: TypeInformation[_] = {
- child match {
- case WindowReference(_, Some(tpe: TypeInformation[_])) if
isRowtimeIndicatorType(tpe) =>
- // rowtime window
- TimeIndicatorTypeInfo.ROWTIME_INDICATOR
- case WindowReference(_, Some(tpe)) if tpe == Types.LONG || tpe ==
Types.SQL_TIMESTAMP =>
- // batch time window
- Types.SQL_TIMESTAMP
Review Comment:
Does this test need to return an SQL_TIMESTAMP:
```
TestSpec.forStrategy(
"ROWTIME type strategy on long in batch
mode",
SpecificInputTypeStrategies.windowTimeIndicator(
TimestampKind.ROWTIME))
.calledWithArgumentTypes(DataTypes.BIGINT())
.expectArgumentTypes(DataTypes.BIGINT()));
```
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/expressions/fieldExpression.scala:
##########
@@ -103,71 +103,6 @@ case class TableReference(name: String, tableOperation:
QueryOperation)
override def toString: String = s"$name"
}
-abstract class TimeAttribute(val expression: PlannerExpression)
- extends UnaryExpression
- with WindowProperty {
-
- override private[flink] def child: PlannerExpression = expression
-}
-
-case class RowtimeAttribute(expr: PlannerExpression) extends
TimeAttribute(expr) {
-
- override private[flink] def validateInput(): ValidationResult = {
- child match {
- case WindowReference(_, Some(tpe: TypeInformation[_])) if
isProctimeIndicatorType(tpe) =>
- ValidationFailure("A proctime window cannot provide a rowtime
attribute.")
- case WindowReference(_, Some(tpe: TypeInformation[_])) if
isRowtimeIndicatorType(tpe) =>
- // rowtime window
- ValidationSuccess
- case WindowReference(_, Some(tpe)) if tpe == Types.LONG || tpe ==
Types.SQL_TIMESTAMP =>
- // batch time window
- ValidationSuccess
- case WindowReference(_, _) =>
- ValidationFailure("Reference to a rowtime or proctime window
required.")
- case any =>
- ValidationFailure(
- s"The '.rowtime' expression can only be used for table definitions
and windows, " +
- s"while [$any] was found.")
- }
- }
-
- override def resultType: TypeInformation[_] = {
- child match {
- case WindowReference(_, Some(tpe: TypeInformation[_])) if
isRowtimeIndicatorType(tpe) =>
- // rowtime window
- TimeIndicatorTypeInfo.ROWTIME_INDICATOR
- case WindowReference(_, Some(tpe)) if tpe == Types.LONG || tpe ==
Types.SQL_TIMESTAMP =>
- // batch time window
- Types.SQL_TIMESTAMP
Review Comment:
Does this test need to return an SQL_TIMESTAMP:
```
TestSpec.forStrategy(
"ROWTIME type strategy on long in batch
mode",
SpecificInputTypeStrategies.windowTimeIndicator(
TimestampKind.ROWTIME))
.calledWithArgumentTypes(DataTypes.BIGINT())
.expectArgumentTypes(DataTypes.BIGINT()));
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]