hequn8128 opened a new pull request #8771: [FLINK-12778][table] Fix derive row 
type bug for table aggregate
URL: https://github.com/apache/flink/pull/8771
 
 
   
   ## What is the purpose of the change
   
   This pull request fix derives row type bug for table aggregate.
   
   Currently, we call `aggCalls.get(0).type.getFieldList.foreach(builder.add)` 
when derive row type for table aggregate. However, for types which are not 
composite types, the field list would be null. Table Aggregate should, of 
course, support non-composite types.
   
   To solve the problem, we should judge whether types are structured. This is 
because a composite type will be converted to a RelDataType which contains 
field list and is structured.
   
   
   ## Brief change log
   
     - Fix `deriveTableAggRowType` method in `CommonTableAggregate`. When 
deriving row type, judge whether the result type of the table aggregate 
function is structured. Use `FieldInfoUtils.getFieldNames()` to get the field 
name when the result type is not structured.
     - In `AggregateOperationFactory.createAggregate()`, also use 
`FieldInfoUtils.getFieldNames()` to get the field name. 
     - Add tests to verify the results.
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - Add plan test for table aggregate(both for window and non-window table 
aggregate).
   
   ## 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