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

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

Best Java code snippets using org.apache.calcite.rel.type.RelDataTypeFactory.builder (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/storm

@Override
public RelDataType getRowType(
    RelDataTypeFactory relDataTypeFactory) {
  RelDataTypeFactory.FieldInfoBuilder b = relDataTypeFactory.builder();
  for (FieldType f : fields) {
    b.add(f.name, f.relDataType);
  }
  return b.build();
}
origin: apache/nifi

@Override
public RelDataType deriveRowType() {
  final List<RelDataTypeField> fieldList = table.getRowType().getFieldList();
  final RelDataTypeFactory.FieldInfoBuilder builder = getCluster().getTypeFactory().builder();
  for (int field : fields) {
    builder.add(fieldList.get(field));
  }
  return builder.build();
}
origin: apache/hive

final List<Integer> groupList = groupSet.asList();
assert groupList.size() == groupSet.cardinality();
final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
final List<RelDataTypeField> fieldList = inputRowType.getFieldList();
final Set<String> containedNames = Sets.newHashSet();
origin: apache/kylin

@Override
public void implementRewrite(RewriteImplementor implementor) {
  Map<String, RelDataType> rewriteFields = this.context.rewriteFields;
  for (Map.Entry<String, RelDataType> rewriteField : rewriteFields.entrySet()) {
    String fieldName = rewriteField.getKey();
    RelDataTypeField field = rowType.getField(fieldName, true, false);
    if (field != null) {
      RelDataType fieldType = field.getType();
      rewriteField.setValue(fieldType);
    }
  }
  // add dynamic field to the table scan if join not exist
  if (!this.context.hasJoin && !this.context.dynamicFields.isEmpty()) {
    Map<TblColRef, RelDataType> dynFields = this.context.dynamicFields;
    List<TblColRef> newCols = Lists.newArrayList(this.columnRowType.getAllColumns());
    List<RelDataTypeField> newFieldList = Lists.newArrayList(this.rowType.getFieldList());
    int paramIndex = this.rowType.getFieldList().size();
    for (TblColRef fieldCol : dynFields.keySet()) {
      newCols.add(fieldCol);
      RelDataType fieldType = dynFields.get(fieldCol);
      RelDataTypeField newField = new RelDataTypeFieldImpl(fieldCol.getName(), paramIndex++, fieldType);
      newFieldList.add(newField);
    }
    // rebuild row type
    RelDataTypeFactory.FieldInfoBuilder fieldInfo = getCluster().getTypeFactory().builder();
    fieldInfo.addAll(newFieldList);
    this.rowType = getCluster().getTypeFactory().createStructType(fieldInfo);
    this.columnRowType = new ColumnRowType(newCols);
  }
}
origin: apache/kylin

@Override
public RelDataType deriveRowType() {
  final List<RelDataTypeField> fieldList = table.getRowType().getFieldList();
  final RelDataTypeFactory.FieldInfoBuilder builder = getCluster().getTypeFactory().builder();
  for (int field : fields) {
    builder.add(fieldList.get(field));
  }
  return getCluster().getTypeFactory().createStructType(builder);
}
origin: apache/drill

final List<Integer> groupList = groupSet.asList();
assert groupList.size() == groupSet.cardinality();
final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
final List<RelDataTypeField> fieldList = inputRowType.getFieldList();
final Set<String> containedNames = Sets.newHashSet();
origin: apache/flink

final List<ImmutableIntList> sources = new ArrayList<>();
final Set<ImmutableIntList> sourceSet = new HashSet<>();
final RelDataTypeFactory.Builder b = typeFactory.builder();
if (names != null) {
  for (String name : names) {
origin: apache/kylin

@SuppressWarnings("deprecation")
private RelDataType deriveRowType(RelDataTypeFactory typeFactory) {
  RelDataTypeFactory.FieldInfoBuilder fieldInfo = typeFactory.builder();
  for (ColumnDesc column : sourceColumns) {
    RelDataType sqlType = createSqlType(typeFactory, column.getUpgradedType(), column.isNullable());
    sqlType = SqlTypeUtil.addCharsetAndCollation(sqlType, typeFactory);
    fieldInfo.add(column.getName(), sqlType);
  }
  return typeFactory.createStructType(fieldInfo);
}
origin: apache/kylin

FieldInfoBuilder fieldInfo = getCluster().getTypeFactory().builder();
fieldInfo.addAll(this.rowType.getFieldList());
fieldInfo.addAll(newFieldList);
RelDataTypeFactory.FieldInfoBuilder fieldInfo = getCluster().getTypeFactory().builder();
fieldInfo.addAll(this.rowType.getFieldList());
fieldInfo.addAll(newFieldList);
origin: apache/kylin

FieldInfoBuilder fieldInfo = getCluster().getTypeFactory().builder();
fieldInfo.addAll(newFields);
fieldInfo.addAll(newFieldList);
origin: apache/hive

  tupleList(fieldNames.length, values);
final RelDataTypeFactory.FieldInfoBuilder rowTypeBuilder =
  cluster.getTypeFactory().builder();
for (final Ord<String> fieldName : Ord.zip(fieldNames)) {
 final String name =
origin: apache/incubator-druid

final RelDataTypeFactory.Builder builder = typeFactory.builder();
for (final String columnName : columnNames) {
 final ValueType columnType = getColumnType(columnName);
origin: apache/drill

    tupleList(fieldNames.length, values);
final RelDataTypeFactory.FieldInfoBuilder rowTypeBuilder =
    cluster.getTypeFactory().builder();
for (final Ord<String> fieldName : Ord.zip(fieldNames)) {
 final String name =
origin: apache/drill

 public void onMatch(RelOptRuleCall call) {
  final Filter filter = call.rel(0);
  final Project project = call.rel(1);
  final List<RexNode> newProjects = new ArrayList<>(project.getProjects());
  newProjects.add(filter.getCondition());
  final RelOptCluster cluster = filter.getCluster();
  RelDataType newRowType =
    cluster.getTypeFactory().builder()
      .addAll(project.getRowType().getFieldList())
      .add("condition", Util.last(newProjects).getType())
      .build();
  final RelNode newProject =
    project.copy(project.getTraitSet(),
      project.getInput(),
      newProjects,
      newRowType);
  final RexInputRef newCondition =
    cluster.getRexBuilder().makeInputRef(newProject,
      newProjects.size() - 1);
  call.transformTo(filter.copy(filter.getTraitSet(), newProject, newCondition));
 }
}
origin: apache/flink

  == SqlMatchRecognize.RowsPerMatchOption.ALL_ROWS;
final RelDataTypeFactory.Builder typeBuilder = typeFactory.builder();
origin: Qihoo360/Quicksql

private static RelDataType makeStruct(
  RelDataTypeFactory typeFactory,
  RelDataType type) {
 if (type.isStruct()) {
  return type;
 }
 return typeFactory.builder().add("$0", type).build();
}
origin: Qihoo360/Quicksql

@Override public RelDataType deriveRowType() {
 final List<RelDataTypeField> fieldList = table.getRowType().getFieldList();
 final RelDataTypeFactory.Builder builder =
   getCluster().getTypeFactory().builder();
 for (int field : fields) {
  builder.add(fieldList.get(field));
 }
 return builder.build();
}
origin: Qihoo360/Quicksql

public static TranslatableTable str(Object o, Object p) {
 assertThat(RexLiteral.validConstant(o, Litmus.THROW), is(true));
 assertThat(RexLiteral.validConstant(p, Litmus.THROW), is(true));
 return new ViewTable(Object.class, typeFactory ->
   typeFactory.builder().add("c", SqlTypeName.VARCHAR, 100).build(),
   "values " + CalciteSqlDialect.DEFAULT.quoteStringLiteral(o.toString())
     + ", " + CalciteSqlDialect.DEFAULT.quoteStringLiteral(p.toString()),
   ImmutableList.of(), Arrays.asList("view"));
}
origin: Qihoo360/Quicksql

public RelDataType getRowType(RelDataTypeFactory typeFactory) {
 return typeFactory.builder()
   .add("ID", SqlTypeName.INTEGER)
   .add("MAPFIELD", SqlTypeName.ANY)
   .add("NESTEDMAPFIELD", SqlTypeName.ANY)
   .add("ARRAYFIELD", SqlTypeName.ANY)
   .add("STRINGARRAYFIELD", SqlTypeName.ANY)
   .build();
}
origin: Qihoo360/Quicksql

public RelDataType getRowType(RelDataTypeFactory typeFactory) {
 return typeFactory.builder()
   .add("country", SqlTypeName.VARCHAR)
   .add("latitude", SqlTypeName.DECIMAL).nullable(true)
   .add("longitude", SqlTypeName.DECIMAL).nullable(true)
   .add("name", SqlTypeName.VARCHAR)
   .build();
}
org.apache.calcite.rel.typeRelDataTypeFactorybuilder

Javadoc

Creates a org.apache.calcite.rel.type.RelDataTypeFactory.FieldInfoBuilder. But since FieldInfoBuilder is deprecated, we recommend that you use its base class Builder, which is not deprecated.

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
  • 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.
  • 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

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
  • setContentView (Activity)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • IsNull (org.hamcrest.core)
    Is the value null?
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