Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3269#discussion_r103960833
  
    --- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/plan/rules/util/RexProgramProjectExtractorTest.scala
 ---
    @@ -55,6 +56,34 @@ class RexProgramProjectExtractorTest {
       }
     
       @Test
    +  def testExtractRefNestedInputFields(): Unit = {
    +    val rexProgram = buildRexProgramWithNesting()
    +    val usedFields = extractRefInputFields(rexProgram)
    +    val usedNestedFields = extractRefNestedInputFields(rexProgram, 
usedFields)
    +    val expected = Array[Array[String]](Array("amount"), Array("*"))
    +    assertThat(usedNestedFields, is(expected))
    +  }
    +
    +  @Test
    +  def testExtractRefNestedInputFieldsWithNoNesting(): Unit = {
    +    val rexProgram = buildRexProgram()
    +    val usedFields = extractRefInputFields(rexProgram)
    +    val usedNestedFields = extractRefNestedInputFields(rexProgram, 
usedFields)
    +    val expected = Array[Array[String]](Array("*"), Array("*"), Array("*"))
    +    assertThat(usedNestedFields, is(expected))
    +  }
    +
    +  @Test
    +  def testExtractDeepRefNestedInputFields(): Unit = {
    +    val rexProgram = buildRexProgramWithDeepNesting()
    +    val usedFields = extractRefInputFields(rexProgram)
    +    val usedNestedFields = extractRefNestedInputFields(rexProgram, 
usedFields)
    +    val expected = Array[Array[String]](Array("amount"), 
Array("passport.status"))
    --- End diff --
    
    Another test would be to reference the nested attribute in a call, for 
example something like `payments.amount * 10`.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to