예제 #1
0
 private static List<Integer> getInputChannels(Iterable<RowExpression> expressions) {
   TreeSet<Integer> channels = new TreeSet<>();
   for (RowExpression expression : Expressions.subExpressions(expressions)) {
     if (expression instanceof InputReferenceExpression) {
       channels.add(((InputReferenceExpression) expression).getField());
     }
   }
   return ImmutableList.copyOf(channels);
 }
예제 #2
0
 private static boolean isConstantExpression(RowExpression expression) {
   List<RowExpression> rowExpressions = Expressions.subExpressions(ImmutableList.of(expression));
   return rowExpressions.size() == 1
       && Iterables.getOnlyElement(rowExpressions) instanceof ConstantExpression
       && ((ConstantExpression) Iterables.getOnlyElement(rowExpressions)).getValue() != null;
 }
예제 #3
0
 private static boolean isIdentityExpression(RowExpression expression) {
   List<RowExpression> rowExpressions = Expressions.subExpressions(ImmutableList.of(expression));
   return rowExpressions.size() == 1
       && Iterables.getOnlyElement(rowExpressions) instanceof InputReferenceExpression;
 }