Java Code Examples for org.apache.calcite.jdbc.JavaTypeFactoryImpl#createTypeWithNullability()
The following examples show how to use
org.apache.calcite.jdbc.JavaTypeFactoryImpl#createTypeWithNullability() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RexTransformerTest.java From calcite with Apache License 2.0 | 6 votes |
@BeforeEach public void setUp() { typeFactory = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT); rexBuilder = new RexBuilder(typeFactory); boolRelDataType = typeFactory.createSqlType(SqlTypeName.BOOLEAN); x = new RexInputRef( 0, typeFactory.createTypeWithNullability(boolRelDataType, true)); y = new RexInputRef( 1, typeFactory.createTypeWithNullability(boolRelDataType, true)); z = new RexInputRef( 2, typeFactory.createTypeWithNullability(boolRelDataType, true)); trueRex = rexBuilder.makeLiteral(true); falseRex = rexBuilder.makeLiteral(false); }
Example 2
Source File: RexProgramBuilderBase.java From calcite with Apache License 2.0 | 5 votes |
@BeforeEach public void setUp() { typeFactory = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT); rexBuilder = new RexBuilder(typeFactory); executor = new RexExecutorImpl(new DummyTestDataContext()); simplify = new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, executor) .withParanoid(true); trueLiteral = rexBuilder.makeLiteral(true); falseLiteral = rexBuilder.makeLiteral(false); nonNullableInt = typeFactory.createSqlType(SqlTypeName.INTEGER); nullableInt = typeFactory.createTypeWithNullability(nonNullableInt, true); nullInt = rexBuilder.makeNullLiteral(nullableInt); nonNullableSmallInt = typeFactory.createSqlType(SqlTypeName.SMALLINT); nullableSmallInt = typeFactory.createTypeWithNullability(nonNullableSmallInt, true); nullSmallInt = rexBuilder.makeNullLiteral(nullableSmallInt); nonNullableBool = typeFactory.createSqlType(SqlTypeName.BOOLEAN); nullableBool = typeFactory.createTypeWithNullability(nonNullableBool, true); nullBool = rexBuilder.makeNullLiteral(nullableBool); nonNullableVarchar = typeFactory.createSqlType(SqlTypeName.VARCHAR); nullableVarchar = typeFactory.createTypeWithNullability(nonNullableVarchar, true); nullVarchar = rexBuilder.makeNullLiteral(nullableVarchar); nonNullableDecimal = typeFactory.createSqlType(SqlTypeName.DECIMAL); nullableDecimal = typeFactory.createTypeWithNullability(nonNullableDecimal, true); nullDecimal = rexBuilder.makeNullLiteral(nullableDecimal); }