You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/11/04 04:56:19 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #1383: [CALCITE-3254] Exception while deserializing of interval type or with empty partition/order key for RexOver

hsyuan commented on a change in pull request #1383: [CALCITE-3254] Exception while deserializing of interval type or with empty partition/order key for RexOver
URL: https://github.com/apache/calcite/pull/1383#discussion_r341904131
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
 ##########
 @@ -454,9 +462,14 @@ RexNode toRex(RelInput relInput, Object o) {
         if (window != null) {
           final SqlAggFunction operator = toAggregation(relInput, op, opMap);
           final RelDataType type = toType(typeFactory, jsonType);
-          final List<RexNode> partitionKeys = toRexList(relInput, (List) window.get("partition"));
-          final List<RexFieldCollation> orderKeys =
-              toRexFieldCollationList(relInput, (List) window.get("order"));
+          List<RexNode> partitionKeys = new ArrayList<>();
+          if (window.containsKey("partition")) {
+            partitionKeys = toRexList(relInput, (List) window.get("partition"));
+          }
+          List<RexFieldCollation> orderKeys = new ArrayList<>();
 
 Review comment:
   Can you make partitionKeys and orderKeys `final`?

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


With regards,
Apache Git Services