{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
/** * Creates a window <code>(RANGE <i>columnName</i> CURRENT ROW)</code>. * * @param columnName Order column */ public SqlWindow createCurrentRowWindow(final String columnName) { return SqlWindow.create( null, null, new SqlNodeList(SqlParserPos.ZERO), new SqlNodeList( ImmutableList.of( new SqlIdentifier(columnName, SqlParserPos.ZERO)), SqlParserPos.ZERO), SqlLiteral.createBoolean(true, SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlLiteral.createBoolean(true, SqlParserPos.ZERO), SqlParserPos.ZERO); }
/** * Creates a window <code>(RANGE <i>columnName</i> UNBOUNDED * PRECEDING)</code>. * * @param columnName Order column */ public SqlWindow createUnboundedPrecedingWindow(final String columnName) { return SqlWindow.create( null, null, new SqlNodeList(SqlParserPos.ZERO), new SqlNodeList( ImmutableList.of( new SqlIdentifier(columnName, SqlParserPos.ZERO)), SqlParserPos.ZERO), SqlLiteral.createBoolean(false, SqlParserPos.ZERO), SqlWindow.createUnboundedPreceding(SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlLiteral.createBoolean(false, SqlParserPos.ZERO), SqlParserPos.ZERO); }
/** * Creates a window <code>(RANGE <i>columnName</i> UNBOUNDED * PRECEDING)</code>. * * @param columnName Order column */ public SqlWindow createUnboundedPrecedingWindow(final String columnName) { return SqlWindow.create( null, null, new SqlNodeList(SqlParserPos.ZERO), new SqlNodeList( ImmutableList.of( new SqlIdentifier(columnName, SqlParserPos.ZERO)), SqlParserPos.ZERO), SqlLiteral.createBoolean(false, SqlParserPos.ZERO), SqlWindow.createUnboundedPreceding(SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlLiteral.createBoolean(false, SqlParserPos.ZERO), SqlParserPos.ZERO); }
public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { assert functionQualifier == null; assert operands.length == 8; return create( (SqlIdentifier) operands[0], (SqlIdentifier) operands[1], (SqlNodeList) operands[2], (SqlNodeList) operands[3], (SqlLiteral) operands[4], operands[5], operands[6], (SqlLiteral) operands[7], pos); }
/** * Creates a window <code>(RANGE <i>columnName</i> CURRENT ROW)</code>. * * @param columnName Order column */ public SqlWindow createCurrentRowWindow(final String columnName) { return SqlWindow.create( null, null, new SqlNodeList(SqlParserPos.ZERO), new SqlNodeList( ImmutableList.of( new SqlIdentifier(columnName, SqlParserPos.ZERO)), SqlParserPos.ZERO), SqlLiteral.createBoolean(true, SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlLiteral.createBoolean(true, SqlParserPos.ZERO), SqlParserPos.ZERO); }
public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { assert functionQualifier == null; assert operands.length == 8; return create( (SqlIdentifier) operands[0], (SqlIdentifier) operands[1], (SqlNodeList) operands[2], (SqlNodeList) operands[3], (SqlLiteral) operands[4], operands[5], operands[6], (SqlLiteral) operands[7], pos); }
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if ("" != null) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
private SqlCall toSql(RexProgram program, RexOver rexOver) { final RexWindow rexWindow = rexOver.getWindow(); final SqlNodeList partitionList = new SqlNodeList( toSql(program, rexWindow.partitionKeys), POS); ImmutableList.Builder<SqlNode> orderNodes = ImmutableList.builder(); if (rexWindow.orderKeys != null) { for (RexFieldCollation rfc : rexWindow.orderKeys) { orderNodes.add(toSql(program, rfc)); } } final SqlNodeList orderList = new SqlNodeList(orderNodes.build(), POS); final SqlLiteral isRows = SqlLiteral.createBoolean(rexWindow.isRows(), POS); final SqlNode lowerBound = createSqlWindowBound(rexWindow.getLowerBound()); final SqlNode upperBound = createSqlWindowBound(rexWindow.getUpperBound()); // null defaults to true. // During parsing the allowPartial == false (e.g. disallow partial) // is expand into CASE expression and is handled as a such. // Not sure if we can collapse this CASE expression back into // "disallow partial" and set the allowPartial = false. final SqlLiteral allowPartial = null; final SqlWindow sqlWindow = SqlWindow.create(null, null, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, POS); final List<SqlNode> nodeList = toSql(program, rexOver.getOperands()); return createOverCall(rexOver.getAggOperator(), nodeList, sqlWindow); }
final SqlWindow sqlWindow = SqlWindow.create(null, null, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, POS);
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial,
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial, s.end(this));}
{if (true) return SqlWindow.create( null, id, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial,