Skip to content

Commit

Permalink
[FLINK-11173][table] Fix the exception message of proctime attribute …
Browse files Browse the repository at this point in the history
…validation in TableSourceUtil#validateTableSource

This closes #7374.
  • Loading branch information
wenhuitang authored and twalthr committed Jan 4, 2019
1 parent 3b81265 commit 4682048
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ object TableSourceUtil {
val rowtimeIdx = schema.getColumnNames.indexOf(rowtimeAttribute)
// ensure that field exists
if (rowtimeIdx < 0) {
throw ValidationException(s"Found a RowtimeAttributeDescriptor for field " +
throw new ValidationException(s"Found a rowtime attribute for field " +
s"'$rowtimeAttribute' but field '$rowtimeAttribute' does not exist in table.")
}
// ensure that field is of type TIMESTAMP
if (schema.getTypes(rowtimeIdx) != Types.SQL_TIMESTAMP) {
throw ValidationException(s"Found a RowtimeAttributeDescriptor for field " +
throw new ValidationException(s"Found a rowtime attribute for field " +
s"'$rowtimeAttribute' but field '$rowtimeAttribute' is not of type TIMESTAMP.")
}
// look up extractor input fields in return type
Expand All @@ -137,12 +137,12 @@ object TableSourceUtil {
val proctimeIdx = schema.getColumnNames.indexOf(proctimeAttribute)
// ensure that field exists
if (proctimeIdx < 0) {
throw ValidationException(s"Found a RowtimeAttributeDescriptor for field " +
throw new ValidationException(s"Found a processing time attribute for field " +
s"'$proctimeAttribute' but field '$proctimeAttribute' does not exist in table.")
}
// ensure that field is of type TIMESTAMP
if (schema.getTypes(proctimeIdx) != Types.SQL_TIMESTAMP) {
throw ValidationException(s"Found a RowtimeAttributeDescriptor for field " +
throw new ValidationException(s"Found a processing time attribute for field " +
s"'$proctimeAttribute' but field '$proctimeAttribute' is not of type TIMESTAMP.")
}
case _ => // nothing to validate
Expand Down

0 comments on commit 4682048

Please sign in to comment.