hequn8128 opened a new pull request #8664: [FLINK-12779][table] Avoid field 
conflicts when generate field names for non-composite Typeinformation
URL: https://github.com/apache/flink/pull/8664
 
 
   
   ## What is the purpose of the change
   
   This pull request makes the result name of table function more robust. 
   
   We use `FieldInfoUtils.getFieldNames(resultType)` to get the relative field 
names of the resultType. There are no problem for composite types. For 
non-composite types, we always set the field name to `f0`. But the `f0` may 
conflict with the predefined field names. To make it more robust, we should 
generate a field name with no conflicts. For example, we can use `f0_0` as the 
field name if `f0` has been used. This is also consistent with the behavior of 
SQL.
   
   
   ## Brief change log
   
     - Add an another `getFieldNames` method which takes a list of invalid 
field names into consideration when generate result field names.
     - Use the new `getFieldNames` to generate TableFunction result field names.
     - Add tests.
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - Added `CorrelateTest.testNonCompositeResultType()` to test whether field 
names are generated correctly.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to