flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twalthr <...@git.apache.org>
Subject [GitHub] flink pull request #4144: [FLINK-6881] [FLINK-6896] [table] Creating a table...
Date Tue, 20 Jun 2017 09:19:33 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message