当前位置: 首页>>代码示例>>Java>>正文


Java SchemaPath.getRootSegment方法代码示例

本文整理汇总了Java中org.apache.drill.common.expression.SchemaPath.getRootSegment方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaPath.getRootSegment方法的具体用法?Java SchemaPath.getRootSegment怎么用?Java SchemaPath.getRootSegment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.drill.common.expression.SchemaPath的用法示例。


在下文中一共展示了SchemaPath.getRootSegment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ensureAtLeastOneField

import org.apache.drill.common.expression.SchemaPath; //导入方法依赖的package包/类
@Override
public void ensureAtLeastOneField(ComplexWriter writer) {
  if (!atLeastOneWrite) {
    // if we had no columns, create one empty one so we can return some data for count purposes.
    SchemaPath sp = columns.get(0);
    PathSegment root = sp.getRootSegment();
    BaseWriter.MapWriter fieldWriter = writer.rootAsMap();
    while (root.getChild() != null && !root.getChild().isArray()) {
      fieldWriter = fieldWriter.map(root.getNameSegment().getPath());
      root = root.getChild();
    }
    fieldWriter.integer(root.getNameSegment().getPath());
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:15,代码来源:JsonReader.java

示例2: transformColumns

import org.apache.drill.common.expression.SchemaPath; //导入方法依赖的package包/类
@Override
protected Collection<SchemaPath> transformColumns(Collection<SchemaPath> columns) {
  Set<SchemaPath> transformed = Sets.newLinkedHashSet();
  rowKeyOnly = true;
  if (!isStarQuery()) {
    for (SchemaPath column : columns) {
      if (column.getRootSegment().getPath().equalsIgnoreCase(ROW_KEY)) {
        transformed.add(ROW_KEY_PATH);
        continue;
      }
      rowKeyOnly = false;
      NameSegment root = column.getRootSegment();
      byte[] family = root.getPath().getBytes();
      transformed.add(SchemaPath.getSimplePath(root.getPath()));
      PathSegment child = root.getChild();
      if (child != null && child.isNamed()) {
        byte[] qualifier = child.getNameSegment().getPath().getBytes();
        hbaseScan.addColumn(family, qualifier);
      } else {
        hbaseScan.addFamily(family);
      }
    }
    /* if only the row key was requested, add a FirstKeyOnlyFilter to the scan
     * to fetch only one KV from each row. If a filter is already part of this
     * scan, add the FirstKeyOnlyFilter as the LAST filter of a MUST_PASS_ALL
     * FilterList.
     */
    if (rowKeyOnly) {
      hbaseScan.setFilter(
          HBaseUtils.andFilterAtIndex(hbaseScan.getFilter(), HBaseUtils.LAST_FILTER, new FirstKeyOnlyFilter()));
    }
  } else {
    rowKeyOnly = false;
    transformed.add(ROW_KEY_PATH);
  }


  return transformed;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:40,代码来源:HBaseRecordReader.java


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