Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/4144#discussion_r122922340 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala --- @@ -437,39 +437,64 @@ abstract class StreamTableEnvironment( var rowtime: Option[(Int, String)] = None var proctime: Option[(Int, String)] = None - exprs.zipWithIndex.foreach { - case (RowtimeAttribute(reference@UnresolvedFieldReference(name)), idx) => - if (rowtime.isDefined) { + def extractRowtime(idx: Int, name: String, origName: Option[String]): Unit = { + if (rowtime.isDefined) { + throw new TableException( + "The rowtime attribute can only be defined once in a table schema.") + } else { + val mappedIdx = streamType match { + case pti: PojoTypeInfo[_] => + pti.getFieldIndex(origName.getOrElse(name)) --- End diff -- Thanks @sunjincheng121. Good point.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---