return rexBuilder.makeCharLiteral( new NlsString( Util.rpad(unpadded.getValue(), type.getPrecision()),
factory.getRexBuilder().makeCharLiteral( new NlsString( s,
factory.getRexBuilder().makeCharLiteral( new NlsString( s,
switch (type.getSqlTypeName()) { case CHAR: return makeCharLiteral(padRight((NlsString) value, type.getPrecision())); case VARCHAR: literal = makeCharLiteral((NlsString) value); if (allowCast) { return makeCast(type, literal);
return rexBuilder.makeCharLiteral( new NlsString( Util.rpad(unpadded.getValue(), type.getPrecision()),
return rexBuilder.makeCharLiteral( new NlsString( Util.rpad(unpadded.getValue(), type.getPrecision()),
switch (type.getSqlTypeName()) { case CHAR: return makeCharLiteral( new NlsString(Util.spaces(type.getPrecision()), null, null)); case VARCHAR: literal = makeCharLiteral(new NlsString("", null, null)); if (allowCast) { return makeCast(type, literal);
return rexBuilder.makeCharLiteral((NlsString) value); case BOOLEAN: return rexBuilder.makeLiteral(((Boolean) value).booleanValue());
return rexBuilder.makeCharLiteral((NlsString) value); case BOOLEAN: return rexBuilder.makeLiteral(((Boolean) value).booleanValue());
@Ignore @Test /** Tests that we can analyze a program with no inputs that outputs two * constants. */ public void testAnalyzeTwoConstantProgram() { final RelDataTypeFactory typeFactory = new FieldTypeFactory(); final RelDataType inputType = typeFactory.createStructType( new RelDataTypeFactory.FieldInfoBuilder() ); final RexBuilder builder = new RexBuilder( typeFactory ); final RexProgramBuilder programBuilder = new RexProgramBuilder( inputType, builder ); programBuilder.addProject( builder.makeExactLiteral( BigDecimal.ONE ), "x" ); programBuilder.addProject( builder.makeCharLiteral( new NlsString( "foo", null, null ) ), "y" ); final RexProgram program = programBuilder.getProgram(); final ProgramUtil.Analyzed analyze = ProgramUtil.analyze( program ); assertTrue( analyze.hasConstants ); assertFalse( analyze.hasFunctions ); assertNull( analyze.permutation ); assertFalse( analyze.isComplex ); } }