Package net.hydromatic.linq4j.expressions

Examples of net.hydromatic.linq4j.expressions.Expression


              getRowType(),
              result.format);

      // final Enumerable<Employee> child = <<child impl>>;
      // final List<Employee> list = child.toList();
      Expression child_ =
          builder.append(
              "child", result.block);
      Expression list_ =
          builder.append("list",
              Expressions.call(child_,
                  BuiltinMethod.ENUMERABLE_TO_LIST.method));

      builder.add(
View Full Code Here


      final JavaTypeFactory typeFactory = implementor.getTypeFactory();
      RelDataType inputRowType = child.getRowType();

      // final Enumerable<List<Employee>> child = <<child impl>>;
      // return child.selectMany(LIST_TO_ENUMERABLE);
      final Expression child_ =
          builder.append(
              "child", result.block);
      builder.add(
          Expressions.return_(null,
              Expressions.call(child_,
View Full Code Here

                  && Object[].class.isAssignableFrom((Class) getElementType()))
              ? JavaRowFormat.ARRAY
              : JavaRowFormat.CUSTOM);
      RexToLixTranslator t = RexToLixTranslator.forAggregation(
          (JavaTypeFactory) getCluster().getTypeFactory(), bb, null);
      final Expression translated = t.translate(getCall());
      bb.add(Expressions.return_(null, translated));
      return implementor.result(physType, bb.toBlock());
    }
View Full Code Here

  private static Pipe addFilter( RelOptCluster cluster, RexProgram program, Pipe pipe )
    {
    final Fields incomingFields = createTypedFields( cluster, program.getInputRowType(), false );
    BlockBuilder statements = new BlockBuilder();

    Expression condition = RexToLixTranslator.translateCondition(
      program,
      (JavaTypeFactory) cluster.getTypeFactory(),
      statements,
      new RexToLixTranslator.InputGetter()
      {
      public Expression field( BlockBuilder list, int index )
        {
        return Expressions.parameter( incomingFields.getTypeClass( index ), incomingFields.get( index ).toString() );
        }
      } );

    // if condition is constant and true, we don't need an expression filter to keep it around
    boolean keepsAllRecords = condition instanceof ConstantExpression && Boolean.TRUE.equals( ( (ConstantExpression) condition ).value );

    if( keepsAllRecords )
      return pipe;

    // create a filter to remove records that don't meet the expression
    Expression nullToFalse = Expressions.call( Functions.class, "falseIfNull", condition );
    Expression not = Expressions.not( nullToFalse ); // matches #isRemove semantics in Filter

    statements.add( Expressions.return_( null, not ) );
    BlockStatement block = statements.toBlock();
    String expression = Expressions.toString( block );
View Full Code Here

        final String name = incomingFields.get( index ).toString();
        return Expressions.parameter( type, name );
        }
      } );

    Expression record = Expressions.newArrayInit( Object.class, expressionList );

    record = Expressions.new_( getConstructor(), record );

    statements.add( Expressions.return_( null, record ) );
View Full Code Here

TOP

Related Classes of net.hydromatic.linq4j.expressions.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.