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 #5040: [FLINK-8104][Table API] fixing ROW type value cons...
Date Wed, 29 Nov 2017 14:49:49 GMT
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5040#discussion_r153807597
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/sql/CalcITCase.scala
---
    @@ -308,6 +308,27 @@ class CalcITCase(
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
     
    +  @Test
    +  def testValueConstructor(): Unit = {
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env, config)
    +
    +    val sqlQuery = "SELECT (a, b, c), ARRAY[b, b] FROM MyTable"
    +
    +    val ds = env.fromElements((
    +      "foo",
    +      12,
    +      Timestamp.valueOf("1984-07-12 14:34:24")))
    +    tEnv.registerDataSet("MyTable", ds, 'a, 'b, 'c)
    +
    +    val result = tEnv.sqlQuery(sqlQuery)
    +
    +    val expected = "foo,12,1984-07-12 14:34:24.0,[12, 12]"
    +    val results = result.toDataSet[Row].collect()
    --- End diff --
    
    Can you test the real objects instead of the strings? To make sure that row has not been
flattened by Calcite.


---

Mime
View raw message