本文整理汇总了Java中org.apache.calcite.rel.type.RelDataTypeFactory.createMultisetType方法的典型用法代码示例。如果您正苦于以下问题:Java RelDataTypeFactory.createMultisetType方法的具体用法?Java RelDataTypeFactory.createMultisetType怎么用?Java RelDataTypeFactory.createMultisetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.rel.type.RelDataTypeFactory
的用法示例。
在下文中一共展示了RelDataTypeFactory.createMultisetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToStruct
import org.apache.calcite.rel.type.RelDataTypeFactory; //导入方法依赖的package包/类
protected RelDataType convertToStruct(RelDataType type) {
// "MULTISET [<expr>, ...]" needs to be wrapped in a record if
// <expr> has a scalar type.
// For example, "MULTISET [8, 9]" has type
// "RECORD(INTEGER EXPR$0 NOT NULL) NOT NULL MULTISET NOT NULL".
final RelDataType componentType = type.getComponentType();
if (componentType == null || componentType.isStruct()) {
return type;
}
final RelDataTypeFactory typeFactory = validator.getTypeFactory();
final RelDataType structType = toStruct(componentType, getNode());
final RelDataType collectionType;
switch (type.getSqlTypeName()) {
case ARRAY:
collectionType = typeFactory.createArrayType(structType, -1);
break;
case MULTISET:
collectionType = typeFactory.createMultisetType(structType, -1);
break;
default:
throw new AssertionError(type);
}
return typeFactory.createTypeWithNullability(collectionType,
type.isNullable());
}
示例2: createMultisetType
import org.apache.calcite.rel.type.RelDataTypeFactory; //导入方法依赖的package包/类
public static RelDataType createMultisetType(
RelDataTypeFactory typeFactory,
RelDataType type,
boolean nullable) {
RelDataType ret = typeFactory.createMultisetType(type, -1);
return typeFactory.createTypeWithNullability(ret, nullable);
}
示例3: toType
import org.apache.calcite.rel.type.RelDataTypeFactory; //导入方法依赖的package包/类
private RelDataType toType(Ast.BagType type) {
final RelDataTypeFactory typeFactory = builder.getTypeFactory();
final RelDataType t = toType(type.componentType);
return typeFactory.createMultisetType(t, -1);
}
示例4: createMultisetType
import org.apache.calcite.rel.type.RelDataTypeFactory; //导入方法依赖的package包/类
public static RelDataType createMultisetType(
RelDataTypeFactory typeFactory,
RelDataType type,
boolean nullable) {
RelDataType ret = typeFactory.createMultisetType(type, -1);
return typeFactory.createTypeWithNullability(ret, nullable);
}