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

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

Best Java code snippets using org.apache.calcite.rel.type.RelDataTypeFactory.createSqlIntervalType (Showing top 19 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

  public RelDataType visit(SqlIntervalQualifier intervalQualifier) {
    return typeFactory.createSqlIntervalType(intervalQualifier);
  }
}
origin: apache/hive

 break;
case INTERVAL_YEAR_MONTH:
 convertedType = dtFactory.createSqlIntervalType(
   new SqlIntervalQualifier(TimeUnit.YEAR, TimeUnit.MONTH, new SqlParserPos(1,1)));
 break;
case INTERVAL_DAY_TIME:
 convertedType = dtFactory.createSqlIntervalType(
   new SqlIntervalQualifier(TimeUnit.DAY, TimeUnit.SECOND, new SqlParserPos(1,1)));
 break;
origin: apache/drill

 break;
case INTERVAL_YEAR_MONTH:
 convertedType = dtFactory.createSqlIntervalType(
   new SqlIntervalQualifier(TimeUnit.YEAR, TimeUnit.MONTH, new SqlParserPos(1,1)));
 break;
case INTERVAL_DAY_TIME:
 convertedType = dtFactory.createSqlIntervalType(
   new SqlIntervalQualifier(TimeUnit.DAY, TimeUnit.SECOND, new SqlParserPos(1,1)));
 break;
origin: Qihoo360/Quicksql

 public RelDataType visit(SqlIntervalQualifier intervalQualifier) {
  return typeFactory.createSqlIntervalType(intervalQualifier);
 }
}
origin: org.apache.calcite/calcite-core

 public RelDataType visit(SqlIntervalQualifier intervalQualifier) {
  return typeFactory.createSqlIntervalType(intervalQualifier);
 }
}
origin: org.apache.calcite/calcite-core

/**
 * Adds a field with an interval type.
 */
public Builder add(String name, TimeUnit startUnit, int startPrecision,
  TimeUnit endUnit, int fractionalSecondPrecision) {
 final SqlIntervalQualifier q =
   new SqlIntervalQualifier(startUnit, startPrecision, endUnit,
     fractionalSecondPrecision, SqlParserPos.ZERO);
 add(name, typeFactory.createSqlIntervalType(q));
 return this;
}
origin: org.apache.calcite/calcite-core

/**
 * Creates a literal representing an interval value, for example
 * {@code INTERVAL '3-7' YEAR TO MONTH}.
 */
public RexLiteral makeIntervalLiteral(
  BigDecimal v,
  SqlIntervalQualifier intervalQualifier) {
 return makeLiteral(
   v,
   typeFactory.createSqlIntervalType(intervalQualifier),
   intervalQualifier.typeName());
}
origin: Qihoo360/Quicksql

/**
 * Creates a literal representing an interval value, for example
 * {@code INTERVAL '3-7' YEAR TO MONTH}.
 */
public RexLiteral makeIntervalLiteral(
  BigDecimal v,
  SqlIntervalQualifier intervalQualifier) {
 return makeLiteral(
   v,
   typeFactory.createSqlIntervalType(intervalQualifier),
   intervalQualifier.typeName());
}
origin: Qihoo360/Quicksql

/**
 * Adds a field with an interval type.
 */
public Builder add(String name, TimeUnit startUnit, int startPrecision,
  TimeUnit endUnit, int fractionalSecondPrecision) {
 final SqlIntervalQualifier q =
   new SqlIntervalQualifier(startUnit, startPrecision, endUnit,
     fractionalSecondPrecision, SqlParserPos.ZERO);
 add(name, typeFactory.createSqlIntervalType(q));
 return this;
}
origin: org.apache.drill.exec/drill-java-exec

RelDataType type;
if (sqlTypeName.getFamily() == SqlTypeFamily.INTERVAL_DAY_TIME) {
 type = typeFactory.createSqlIntervalType(
   new SqlIntervalQualifier(
     TimeUnit.DAY,
     SqlParserPos.ZERO));
} else if (sqlTypeName.getFamily() == SqlTypeFamily.INTERVAL_YEAR_MONTH) {
 type = typeFactory.createSqlIntervalType(
   new SqlIntervalQualifier(
     TimeUnit.YEAR,
origin: dremio/dremio-oss

case INTERVAL_YEAR_MONTH:
case INTERVAL_MONTH:
 type = typeFactory.createSqlIntervalType(
  new SqlIntervalQualifier(
   TimeUnit.YEAR,
case INTERVAL_MINUTE_SECOND:
case INTERVAL_SECOND:
 type = typeFactory.createSqlIntervalType(
  new SqlIntervalQualifier(
   TimeUnit.DAY,
origin: dremio/dremio-oss

case INTERVAL_SECOND:
 SqlIntervalQualifier dayTime = new SqlIntervalQualifier(TimeUnit.DAY, TimeUnit.SECOND, SqlParserPos.ZERO);
 nullLiteral = rexBuilder.makeCast(typeFactory.createSqlIntervalType(dayTime), rexBuilder.constantNull());
 break;
case INTERVAL_YEAR:
case INTERVAL_MONTH:
 SqlIntervalQualifier yearMonth = new SqlIntervalQualifier(TimeUnit.YEAR, TimeUnit.MONTH, SqlParserPos.ZERO);
 nullLiteral = rexBuilder.makeCast(typeFactory.createSqlIntervalType(yearMonth), rexBuilder.constantNull());
 break;
case MULTISET:
origin: dremio/dremio-oss

public RelDataType getRowType(RelDataTypeFactory factory) {
 List<RelDataType> types = Lists.newArrayList();
 List<String> names = Lists.newArrayList();
 for (FieldType field : fields) {
  names.add(field.getName());
  RelDataType type;
  if (   SqlTypeFamily.INTERVAL_YEAR_MONTH == field.getType().getFamily()
    || SqlTypeFamily.INTERVAL_DAY_TIME   == field.getType().getFamily() ) {
   type = factory.createSqlIntervalType( field.getIntervalQualifier() );
  } else if (field.getType().equals(SqlTypeName.ARRAY) || field.getType().equals(SqlTypeName.MAP)) {
   type = factory.createSqlType(SqlTypeName.ANY);
  } else if (field.getPrecision() == null && field.getScale() == null) {
   type = factory.createSqlType(field.getType());
  } else if (field.getPrecision() != null && field.getScale() == null) {
   type = factory.createSqlType(field.getType(), field.getPrecision());
  } else {
   type = factory.createSqlType(field.getType(), field.getPrecision(), field.getScale());
  }
  if (field.getIsNullable()) {
   types.add(factory.createTypeWithNullability(type, true));
  } else {
   types.add(type);
  }
 }
 return factory.createStructType(types, names);
}
origin: org.apache.drill.exec/drill-java-exec

public RelDataType getRowType(RelDataTypeFactory factory) {
 // if there are no fields defined, this is a dynamic view.
 if (isDynamic()) {
  return new RelDataTypeDrillImpl(new RelDataTypeHolder(), factory);
 }
 List<RelDataType> types = Lists.newArrayList();
 List<String> names = Lists.newArrayList();
 for (FieldType field : fields) {
  names.add(field.getName());
  RelDataType type;
  if (   SqlTypeFamily.INTERVAL_YEAR_MONTH == field.getType().getFamily()
    || SqlTypeFamily.INTERVAL_DAY_TIME   == field.getType().getFamily() ) {
   type = factory.createSqlIntervalType( field.getIntervalQualifier() );
  } else if (field.getPrecision() == null && field.getScale() == null) {
   type = factory.createSqlType(field.getType());
  } else if (field.getPrecision() != null && field.getScale() == null) {
   type = factory.createSqlType(field.getType(), field.getPrecision());
  } else {
   type = factory.createSqlType(field.getType(), field.getPrecision(), field.getScale());
  }
  if (field.getIsNullable()) {
   types.add(factory.createTypeWithNullability(type, true));
  } else {
   types.add(type);
  }
 }
 return factory.createStructType(types, names);
}
origin: Qihoo360/Quicksql

SqlIntervalLiteral.IntervalValue intervalValue =
  (SqlIntervalLiteral.IntervalValue) value;
return typeFactory.createSqlIntervalType(
  intervalValue.getIntervalQualifier());
origin: org.apache.calcite/calcite-core

SqlIntervalLiteral.IntervalValue intervalValue =
  (SqlIntervalLiteral.IntervalValue) value;
return typeFactory.createSqlIntervalType(
  intervalValue.getIntervalQualifier());
origin: org.apache.calcite/calcite-core

final RelDataType intervalType =
  cx.getTypeFactory().createTypeWithNullability(
    cx.getTypeFactory().createSqlIntervalType(qualifier),
    op1.getType().isNullable() || op2.getType().isNullable());
final RexCall rexCall = (RexCall) rexBuilder.makeCall(
origin: Qihoo360/Quicksql

final RelDataType intervalType =
  cx.getTypeFactory().createTypeWithNullability(
    cx.getTypeFactory().createSqlIntervalType(qualifier),
    op1.getType().isNullable() || op2.getType().isNullable());
final RexCall rexCall = (RexCall) rexBuilder.makeCall(
origin: com.facebook.presto.hive/hive-apache

 break;
case INTERVAL_YEAR_MONTH:
 convertedType = dtFactory.createSqlIntervalType(
   new SqlIntervalQualifier(TimeUnit.YEAR, TimeUnit.MONTH, new SqlParserPos(1,1)));
 break;
case INTERVAL_DAY_TIME:
 convertedType = dtFactory.createSqlIntervalType(
   new SqlIntervalQualifier(TimeUnit.DAY, TimeUnit.SECOND, new SqlParserPos(1,1)));
 break;
org.apache.calcite.rel.typeRelDataTypeFactorycreateSqlIntervalType

Javadoc

Creates a SQL interval type.

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.
  • getTypeSystem
    Returns the type system.
  • createArrayType
    Creates an array type. Arrays are ordered collections of elements.
  • createJavaType
    Creates a type that corresponds to a Java class.
  • 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

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
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