Tabnine Logo
RelDataTypeFactory.createSqlIntervalType
Code IndexAdd Tabnine 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)

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

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now