Codota Logo
RelDataTypeFactory.getTypeSystem
Code IndexAdd Codota to your IDE (free)

How to use
getTypeSystem
method
in
org.apache.calcite.rel.type.RelDataTypeFactory

Best Java code snippets using org.apache.calcite.rel.type.RelDataTypeFactory.getTypeSystem (Showing top 20 results out of 315)

  • Common ways to obtain RelDataTypeFactory
private void myMethod () {
RelDataTypeFactory r =
  • Codota IconRexBuilder rexBuilder;rexBuilder.getTypeFactory()
  • Codota IconSqlOperatorBinding opBinding;opBinding.getTypeFactory()
  • Codota IconRelOptCluster cluster;cluster.getTypeFactory()
  • Smart code suggestions by Codota
}
origin: apache/flink

  literal.getParserPosition(), typeFactory.getTypeSystem());
Util.discard(values);
origin: apache/storm

final BlockBuilder builder = new BlockBuilder();
final JavaTypeFactoryImpl javaTypeFactory =
  new JavaTypeFactoryImpl(rexBuilder.getTypeFactory().getTypeSystem());
origin: apache/hive

  rexBuilder.getTypeFactory().createSqlType(
   SqlTypeName.TIMESTAMP,
   rexBuilder.getTypeFactory().getTypeSystem().getDefaultPrecision(SqlTypeName.TIMESTAMP)),
  false);
 break;
  rexBuilder.getTypeFactory().getTypeSystem().getDefaultPrecision(SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE));
 break;
case INTERVAL_YEAR_MONTH:
origin: apache/flink

boolean startPrecisionOutOfRange = false;
boolean fractionalSecondPrecisionOutOfRange = false;
final RelDataTypeSystem typeSystem = typeFactory.getTypeSystem();
origin: Qihoo360/Quicksql

UnknownSqlType(RelDataTypeFactory typeFactory) {
 super(typeFactory.getTypeSystem(), SqlTypeName.NULL);
}
origin: org.apache.calcite/calcite-core

UnknownSqlType(RelDataTypeFactory typeFactory) {
 super(typeFactory.getTypeSystem(), SqlTypeName.NULL);
}
origin: Qihoo360/Quicksql

/**
 * Calculates a power of ten, as a long value
 */
protected long powerOfTen(int scale) {
 assert scale >= 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 return BigInteger.TEN.pow(scale).longValue();
}
origin: org.apache.calcite/calcite-core

/**
 * Calculates a power of ten, as a long value
 */
protected long powerOfTen(int scale) {
 assert scale >= 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 return BigInteger.TEN.pow(scale).longValue();
}
origin: Qihoo360/Quicksql

/**
 * Makes sure that field names are unique.
 */
public Builder uniquify() {
 final List<String> uniqueNames = SqlValidatorUtil.uniquify(names,
   typeFactory.getTypeSystem().isSchemaCaseSensitive());
 if (uniqueNames != names) {
  names.clear();
  names.addAll(uniqueNames);
 }
 return this;
}
origin: org.apache.calcite/calcite-core

/**
 * Makes sure that field names are unique.
 */
public Builder uniquify() {
 final List<String> uniqueNames = SqlValidatorUtil.uniquify(names,
   typeFactory.getTypeSystem().isSchemaCaseSensitive());
 if (uniqueNames != names) {
  names.clear();
  names.addAll(uniqueNames);
 }
 return this;
}
origin: Qihoo360/Quicksql

/**
 * Makes an exact numeric literal to be used for scaling
 *
 * @param scale a scale from one to max precision - 1
 * @return 10^scale as an exact numeric value
 */
protected RexNode makeScaleFactor(int scale) {
 assert scale > 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 return makeExactLiteral(powerOfTen(scale));
}
origin: org.apache.calcite/calcite-core

/**
 * Makes an exact numeric literal to be used for scaling
 *
 * @param scale a scale from one to max precision - 1
 * @return 10^scale as an exact numeric value
 */
protected RexNode makeScaleFactor(int scale) {
 assert scale > 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 return makeExactLiteral(powerOfTen(scale));
}
origin: org.apache.calcite/calcite-core

/**
 * Makes an exact numeric value to be used for rounding.
 *
 * @param scale a scale from 1 to max precision - 1
 * @return 10^scale / 2 as an exact numeric value
 */
protected RexNode makeRoundFactor(int scale) {
 assert scale > 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 return makeExactLiteral(powerOfTen(scale) / 2);
}
origin: Qihoo360/Quicksql

/**
 * Makes an exact numeric value to be used for rounding.
 *
 * @param scale a scale from 1 to max precision - 1
 * @return 10^scale / 2 as an exact numeric value
 */
protected RexNode makeRoundFactor(int scale) {
 assert scale > 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 return makeExactLiteral(powerOfTen(scale) / 2);
}
origin: Qihoo360/Quicksql

/**
 * Scales up a decimal value and returns the scaled value as an exact
 * number.
 *
 * @param value the integer representation of a decimal
 * @param scale a value from zero to max precision - 1
 * @return value * 10^scale as an exact numeric value
 */
protected RexNode scaleUp(RexNode value, int scale) {
 assert scale >= 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 if (scale == 0) {
  return value;
 }
 return builder.makeCall(
   SqlStdOperatorTable.MULTIPLY,
   value,
   makeScaleFactor(scale));
}
origin: org.apache.calcite/calcite-core

/**
 * Scales up a decimal value and returns the scaled value as an exact
 * number.
 *
 * @param value the integer representation of a decimal
 * @param scale a value from zero to max precision - 1
 * @return value * 10^scale as an exact numeric value
 */
protected RexNode scaleUp(RexNode value, int scale) {
 assert scale >= 0;
 assert scale
   < builder.getTypeFactory().getTypeSystem().getMaxNumericPrecision();
 if (scale == 0) {
  return value;
 }
 return builder.makeCall(
   SqlStdOperatorTable.MULTIPLY,
   value,
   makeScaleFactor(scale));
}
origin: Qihoo360/Quicksql

/**
 * Creates an {@link RexExecutable} that allows to apply the
 * generated code during query processing (filter, projection).
 *
 * @param rexBuilder Rex builder
 * @param exps Expressions
 * @param rowType describes the structure of the input row.
 */
public RexExecutable getExecutable(RexBuilder rexBuilder, List<RexNode> exps,
  RelDataType rowType) {
 final JavaTypeFactoryImpl typeFactory =
   new JavaTypeFactoryImpl(rexBuilder.getTypeFactory().getTypeSystem());
 final InputGetter getter = new DataContextInputGetter(rowType, typeFactory);
 final String code = compile(rexBuilder, exps, getter, rowType);
 return new RexExecutable(code, "generated Rex code");
}
origin: org.apache.calcite/calcite-core

/**
 * Creates an {@link RexExecutable} that allows to apply the
 * generated code during query processing (filter, projection).
 *
 * @param rexBuilder Rex builder
 * @param exps Expressions
 * @param rowType describes the structure of the input row.
 */
public RexExecutable getExecutable(RexBuilder rexBuilder, List<RexNode> exps,
  RelDataType rowType) {
 final JavaTypeFactoryImpl typeFactory =
   new JavaTypeFactoryImpl(rexBuilder.getTypeFactory().getTypeSystem());
 final InputGetter getter = new DataContextInputGetter(rowType, typeFactory);
 final String code = compile(rexBuilder, exps, getter, rowType);
 return new RexExecutable(code, "generated Rex code");
}
origin: Qihoo360/Quicksql

@Test public void testTimestampAddFractionalSeconds() {
 tester.setFor(SqlStdOperatorTable.TIMESTAMP_ADD);
 tester.checkType(
   "timestampadd(SQL_TSI_FRAC_SECOND, 2, timestamp '2016-02-24 12:42:25.000000')",
   // "2016-02-24 12:42:25.000002",
   "TIMESTAMP(3) NOT NULL");
 // The following test would correctly return "TIMESTAMP(6) NOT NULL" if max
 // precision were 6 or higher
 assumeTrue(tester.getValidator().getTypeFactory().getTypeSystem()
   .getMaxPrecision(SqlTypeName.TIMESTAMP) == 3);
 tester.checkType(
   "timestampadd(MICROSECOND, 2, timestamp '2016-02-24 12:42:25.000000')",
   // "2016-02-24 12:42:25.000002",
   "TIMESTAMP(3) NOT NULL");
}
origin: org.apache.calcite/calcite-core

@Test public void testTimestampAddFractionalSeconds() {
 tester.setFor(SqlStdOperatorTable.TIMESTAMP_ADD);
 tester.checkType(
   "timestampadd(SQL_TSI_FRAC_SECOND, 2, timestamp '2016-02-24 12:42:25.000000')",
   // "2016-02-24 12:42:25.000002",
   "TIMESTAMP(3) NOT NULL");
 // The following test would correctly return "TIMESTAMP(6) NOT NULL" if max
 // precision were 6 or higher
 assumeTrue(tester.getValidator().getTypeFactory().getTypeSystem()
   .getMaxPrecision(SqlTypeName.TIMESTAMP) == 3);
 tester.checkType(
   "timestampadd(MICROSECOND, 2, timestamp '2016-02-24 12:42:25.000000')",
   // "2016-02-24 12:42:25.000002",
   "TIMESTAMP(3) NOT NULL");
}
org.apache.calcite.rel.typeRelDataTypeFactorygetTypeSystem

Javadoc

Returns the type system.

Popular methods of RelDataTypeFactory

  • createSqlType
    Creates a SQL type with precision and scale.
  • createTypeWithNullability
    Creates a type that is the same as another type but with possibly different nullability. The output
  • createStructType
    Creates a type that represents a structured collection of fields, given lists of the names and types
  • builder
    Creates a org.apache.calcite.rel.type.RelDataTypeFactory.FieldInfoBuilder. But since FieldInfoBuilde
  • createMapType
    Creates a map type. Maps are unordered collections of key/value pairs.
  • createArrayType
    Creates an array type. Arrays are ordered collections of elements.
  • createJavaType
    Creates a type that corresponds to a Java class.
  • createSqlIntervalType
    Creates a SQL interval type.
  • createTypeWithCharsetAndCollation
    Creates a type that is the same as another type but with possibly different charset or collation. Fo
  • leastRestrictive
    Returns the most general of a set of types (that is, one type to which they can all be cast), or nul
  • createMultisetType
    Creates a multiset type. Multisets are unordered collections of elements.
  • copyType
    Duplicates a type, making a deep copy. Normally, this is a no-op, since canonical type objects are r
  • createMultisetType,
  • copyType,
  • createUnknownType,
  • getDefaultCharset,
  • createJoinType,
  • useDoubleMultiplication

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now