Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/5132#discussion_r159878618 --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/stream/StreamTableEnvironmentValidationTest.scala --- @@ -138,4 +145,25 @@ class StreamTableEnvironmentValidationTest extends TableTestBase { // we mix reference by position and by name util.addTable[(Long, Int, String, Int, Long)]('x, '_1) } + + @Test(expected = classOf[TableException]) + def testInvalidAliasWithProctimeAttribute(): Unit = { + val util = streamTestUtil() + // alias in proctime not allowed + util.addTable[(Int, Long, String)]('_1, ('newnew as 'new).proctime, '_3) --- End diff -- also add a test where proctime alias references an existing field and a test for `'x.proctime` where `'x` is a valid field (if there isn't such a test yet).
---