JingsongLi commented on a change in pull request #8435: 
[FLINK-12443][table-planner-blink] Replace InternalType with LogicalType in 
blink
URL: https://github.com/apache/flink/pull/8435#discussion_r284531614
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/functions/aggfunctions/RankLikeAggFunctionBase.java
 ##########
 @@ -98,30 +108,30 @@ protected Expression orderKeyEqualsExpression() {
                return ret.orElseGet(() -> literal(true));
        }
 
-       protected Expression generateInitLiteral(InternalType orderType) {
-               if (orderType.equals(InternalTypes.BOOLEAN)) {
+       protected Expression generateInitLiteral(LogicalType orderType) {
+               if (orderType instanceof BooleanType) {
 
 Review comment:
   Glad to see new visitors in FLINK-12254.
   I looked at the code again and found that use type to check directly is not 
so strong.
   The below code is not bad:
   ```
   t.getTypeRoot match {
         case BOOLEAN => s"$rowTerm.getBoolean($indexTerm)"
         case TINYINT => s"$rowTerm.getByte($indexTerm)"
         case SMALLINT => s"$rowTerm.getShort($indexTerm)"
         ......
         case ROW => s"$rowTerm.getRow($indexTerm, 
${t.asInstanceOf[RowType].getFieldCount})"
   }
   ```
   So I change all LogicalType instance match to the logical type root match.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to