[ 
https://issues.apache.org/jira/browse/FLINK-6602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16050038#comment-16050038
 ] 

Zhe Li commented on FLINK-6602:
-------------------------------

Fabian,

I understand what you mean.

So I modified the codes in StreamTableSourceTable#getRowType to:

{code:java}
  val rowtime = tableSource match {
      case emptyStringTimeSource : DefinedRowtimeAttribute if 
emptyStringTimeSource.getRowtimeAttribute.trim.equals("")  =>
        throw TableException("The name of the rowtime attribute must not be 
empty.")

      case timeSource: DefinedRowtimeAttribute if 
timeSource.getRowtimeAttribute != null  =>
        val rowtimeAttribute = timeSource.getRowtimeAttribute
        Some((fieldCnt, rowtimeAttribute))
      case _ =>
        None
    }

    val proctime = tableSource match {
      case emptyStringTimeSource : DefinedProctimeAttribute if 
emptyStringTimeSource.getProctimeAttribute.trim.equals("")  =>
        throw TableException("The name of the proctime attribute must not be 
empty.")

      case timeSource: DefinedProctimeAttribute if 
timeSource.getProctimeAttribute != null  =>
        val proctimeAttribute = timeSource.getProctimeAttribute
        Some((fieldCnt + (if (rowtime.isDefined) 1 else 0), proctimeAttribute))
      case _ =>
        None
    }
{code}

If there is nothing problem, could I fix the issue? 

Below is my Jira profile:

Username:       lmalds
Full Name:      Zhe Li

please assign me the update privilege.

Thanks.

> Table source with defined time attributes allows empty string
> -------------------------------------------------------------
>
>                 Key: FLINK-6602
>                 URL: https://issues.apache.org/jira/browse/FLINK-6602
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>            Reporter: Timo Walther
>         Attachments: getRowType.png
>
>
> {{DefinedRowtimeAttribute}} and {{DefinedProctimeAttribute}} are not checked 
> for empty strings.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to