• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ImmutableNullableList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.calcite.util.ImmutableNullableList的典型用法代码示例。如果您正苦于以下问题:Java ImmutableNullableList类的具体用法?Java ImmutableNullableList怎么用?Java ImmutableNullableList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ImmutableNullableList类属于org.apache.calcite.util包,在下文中一共展示了ImmutableNullableList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: averageJoinColumnSizes

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
private List<Double> averageJoinColumnSizes(Join rel, RelMetadataQuery mq,
    boolean semijoin) {
  final RelNode left = rel.getLeft();
  final RelNode right = rel.getRight();
  final List<Double> lefts = mq.getAverageColumnSizes(left);
  final List<Double> rights =
      semijoin ? null : mq.getAverageColumnSizes(right);
  if (lefts == null && rights == null) {
    return null;
  }
  final int fieldCount = rel.getRowType().getFieldCount();
  Double[] sizes = new Double[fieldCount];
  if (lefts != null) {
    lefts.toArray(sizes);
  }
  if (rights != null) {
    final int leftCount = left.getRowType().getFieldCount();
    for (int i = 0; i < rights.size(); i++) {
      sizes[leftCount + i] = rights.get(i);
    }
  }
  return ImmutableNullableList.copyOf(sizes);
}
 
开发者ID:apache,项目名称:calcite,代码行数:24,代码来源:RelMdSize.java


示例2: flatListNotComparable

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
/**
 * Creates a memory-, CPU- and cache-efficient immutable list,
 * always copying the list.
 *
 * @param t Array of members of list
 * @return List containing the given members
 */
private static <T> List<T> flatListNotComparable(T[] t) {
  switch (t.length) {
  case 0:
    //noinspection unchecked
    return COMPARABLE_EMPTY_LIST;
  case 1:
    return new Flat1List<>(t[0]);
  case 2:
    return new Flat2List<>(t[0], t[1]);
  case 3:
    return new Flat3List<>(t[0], t[1], t[2]);
  case 4:
    return new Flat4List<>(t[0], t[1], t[2], t[3]);
  case 5:
    return new Flat5List<>(t[0], t[1], t[2], t[3], t[4]);
  case 6:
    return new Flat6List<>(t[0], t[1], t[2], t[3], t[4], t[5]);
  default:
    return ImmutableNullableList.copyOf(t);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:29,代码来源:FlatLists.java


示例3: register

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public static void register(final Kryo kryo) {
  // register list
  ImmutableListSerializer.register(kryo);
  // register set
  ImmutableSetSerializer.register(kryo);
  // register set
  ImmutableMapSerializer.register(kryo);
  // others
  kryo.addDefaultSerializer(FlatLists.AbstractFlatList.class, FieldSerializer.class);
  kryo.addDefaultSerializer(ImmutableNullableList.class, ImmutableNullableListSerializer.class);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:12,代码来源:ImmutableCollectionSerializers.java


示例4: write

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override
public void write(Kryo kryo, Output output, List object) {
  Preconditions.checkArgument(object instanceof ImmutableNullableList);
  output.writeInt(object.size());

  final Iterator iterator = object.iterator();
  while (iterator.hasNext()) {
    kryo.writeClassAndObject(output, iterator.next());
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:11,代码来源:ImmutableCollectionSerializers.java


示例5: read

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override
public List read(Kryo kryo, Input input, Class<List> type) {
  final int size = input.readInt();

  Object[] elements = new Object[size];
  for (int i = 0; i < size; ++i) {
    elements[i] = kryo.readClassAndObject(input);
  }
  return ImmutableNullableList.copyOf(elements);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:11,代码来源:ImmutableCollectionSerializers.java


示例6: get

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public DataSource get(String url, String driverClassName) {
    // Get data source objects from a cache, so that we don't have to sniff
    // out what kind of database they are quite as often.
    final List<String> key =
            ImmutableNullableList.of(url, driverClassName);
    DataSource dataSource = cache.apply(key);
    LOG.info("get DataSource:" + dataSource + ", " + url + " " + driverClassName);
    return dataSource;
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:10,代码来源:JdbcUtils.java


示例7: averageColumnSizes

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public List<Double> averageColumnSizes(Project rel, RelMetadataQuery mq) {
  final List<Double> inputColumnSizes =
      mq.getAverageColumnSizesNotNull(rel.getInput());
  final ImmutableNullableList.Builder<Double> sizes =
      ImmutableNullableList.builder();
  for (RexNode project : rel.getProjects()) {
    sizes.add(averageRexSize(project, inputColumnSizes));
  }
  return sizes.build();
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:RelMdSize.java


示例8: get

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public DataSource get(String url, String driverClassName,
    String username, String password) {
  // Get data source objects from a cache, so that we don't have to sniff
  // out what kind of database they are quite as often.
  final List<String> key =
      ImmutableNullableList.of(url, username, password, driverClassName);
  return cache.getUnchecked(key);
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:JdbcUtils.java


示例9: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override public List<SqlNode> getOperandList() {
  final List<SqlNode> operandList = Lists.newArrayList();
  if (scope == null) {
    operandList.add(null);
  } else {
    operandList.add(new SqlIdentifier(scope, SqlParserPos.ZERO));
  }
  operandList.add(name);
  operandList.add(value);
  return ImmutableNullableList.copyOf(operandList);
}
 
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlSetOption.java


示例10: getFieldOrigins

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public List<List<String>> getFieldOrigins(SqlNode sqlQuery) {
  if (sqlQuery instanceof SqlExplain) {
    return Collections.emptyList();
  }
  final RelDataType rowType = getValidatedNodeType(sqlQuery);
  final int fieldCount = rowType.getFieldCount();
  if (!sqlQuery.isA(SqlKind.QUERY)) {
    return Collections.nCopies(fieldCount, null);
  }
  final List<List<String>> list = new ArrayList<>();
  for (int i = 0; i < fieldCount; i++) {
    list.add(getFieldOrigin(sqlQuery, i));
  }
  return ImmutableNullableList.copyOf(list);
}
 
开发者ID:apache,项目名称:calcite,代码行数:16,代码来源:SqlValidatorImpl.java


示例11: getValue

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
private static Object getValue(SqlNode right) throws NonLiteralException {
  switch (right.getKind()) {
  case ARRAY_VALUE_CONSTRUCTOR:
    final List<Object> list = Lists.newArrayList();
    for (SqlNode o : ((SqlCall) right).getOperandList()) {
      list.add(getValue(o));
    }
    return ImmutableNullableList.copyOf(list);
  case MAP_VALUE_CONSTRUCTOR:
    final ImmutableMap.Builder<Object, Object> builder2 =
        ImmutableMap.builder();
    final List<SqlNode> operands = ((SqlCall) right).getOperandList();
    for (int i = 0; i < operands.size(); i += 2) {
      final SqlNode key = operands.get(i);
      final SqlNode value = operands.get(i + 1);
      builder2.put(getValue(key), getValue(value));
    }
    return builder2.build();
  default:
    if (SqlUtil.isNullLiteral(right, true)) {
      return null;
    }
    if (SqlUtil.isLiteral(right)) {
      return ((SqlLiteral) right).getValue();
    }
    if (right.getKind() == SqlKind.DEFAULT) {
      return null; // currently NULL is the only default value
    }
    throw new NonLiteralException();
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:32,代码来源:SqlUserDefinedTableMacro.java


示例12: collectOperandTypes

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
private List<RelDataType> collectOperandTypes(
    SqlValidator validator,
    SqlValidatorScope scope,
    SqlCall call) {
  List<RelDataType> argTypes =
      SqlTypeUtil.deriveAndCollectTypes(
          validator, scope, call.getOperandList());
  return ImmutableNullableList.of(
      argTypes.get(VALUE_OPERAND),
      argTypes.get(LOWER_OPERAND),
      argTypes.get(UPPER_OPERAND));
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:SqlBetweenOperator.java


示例13: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override public List<SqlNode> getOperandList() {
  return ImmutableNullableList.<SqlNode>of(table);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:4,代码来源:SqlForgetTable.java


示例14: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override
public List<SqlNode> getOperandList() {
  return ImmutableNullableList.of(tblName, fieldList, location, properties,
                                  query);
}
 
开发者ID:apache,项目名称:beam,代码行数:6,代码来源:SqlCreateTable.java


示例15: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override
public List<SqlNode> getOperandList() {
    return ImmutableNullableList.of(functionName, className);
}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:5,代码来源:SqlCreateFunction.java


示例16: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override
public List<SqlNode> getOperandList() {
  return ImmutableNullableList.of(tblName, fieldList, inputFormatClass,
                                  outputFormatClass, location, properties,
                                  query);
}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:7,代码来源:SqlCreateTable.java


示例17: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public List<SqlNode> getOperandList() {
  return ImmutableNullableList.of((SqlNode) identifier);
}
 
开发者ID:qubole,项目名称:quark,代码行数:4,代码来源:SqlDropQuark.java


示例18: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public List<SqlNode> getOperandList() {
  return ImmutableNullableList.of(likePattern);
}
 
开发者ID:qubole,项目名称:quark,代码行数:4,代码来源:SqlShowQuark.java


示例19: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
public List<SqlNode> getOperandList() {
  return ImmutableNullableList.of(targetColumnList,
      sourceExpressionList, identifier);
}
 
开发者ID:qubole,项目名称:quark,代码行数:5,代码来源:SqlAlterQuark.java


示例20: getOperandList

import org.apache.calcite.util.ImmutableNullableList; //导入依赖的package包/类
@Override public List<SqlNode> getOperandList() {
  return ImmutableNullableList.of(name, columnList);
}
 
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlKeyConstraint.java



注:本文中的org.apache.calcite.util.ImmutableNullableList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AddressingPropertySet类代码示例发布时间:2022-05-22
下一篇:
Java CacheDirectiveEntryProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap