コード例 #1
0
 @Override
 public Info visitLeave(RowValueConstructorExpression node, List<Info> l) {
   // Child expression returned null and was filtered, so not order preserving
   if (l.size() != node.getChildren().size()) {
     return null;
   }
   Info firstInfo = l.get(0);
   Info lastInfo = firstInfo;
   // Check that pkPos are consecutive which is the only way a RVC can be order preserving
   for (int i = 1; i < l.size(); i++) {
     // not order preserving since it's not last
     if (lastInfo.orderPreserving == OrderPreserving.YES_IF_LAST) {
       return null;
     }
     Info info = l.get(i);
     // not order preserving since there's a gap in the pk
     if (info.pkPosition != lastInfo.pkPosition + 1) {
       return null;
     }
     lastInfo = info;
   }
   return new Info(firstInfo, l.size(), lastInfo.orderPreserving);
 }
コード例 #2
0
 @Override
 public Iterator<Expression> visitEnter(RowValueConstructorExpression node) {
   return node.getChildren().iterator();
 }