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


Java ColumnDescriptor.getType方法代码示例

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


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

示例1: startColumn

import parquet.column.ColumnDescriptor; //导入方法依赖的package包/类
/**
 * start a column inside a block
 *
 * @param descriptor           the column descriptor
 * @param valueCount           the value count in this column
 * @param statistics           the statistics in this column
 * @param compressionCodecName
 * @throws IOException
 */
public void startColumn(ColumnDescriptor descriptor,
                        long valueCount,
                        CompressionCodecName compressionCodecName) throws IOException {
    state = state.startColumn();
    if (DEBUG) LOG.debug(out.getPos() + ": start column: " + descriptor + " count=" + valueCount);
    currentEncodings = new HashSet<parquet.column.Encoding>();
    currentChunkPath = ColumnPath.get(descriptor.getPath());
    currentChunkType = descriptor.getType();
    currentChunkCodec = compressionCodecName;
    currentChunkValueCount = valueCount;
    currentChunkFirstDataPage = out.getPos();
    compressedLength = 0;
    uncompressedLength = 0;
    // need to know what type of stats to initialize to
    // better way to do this?
    currentStatistics = Statistics.getStatsBasedOnType(currentChunkType);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:27,代码来源:ParquetFileWriter.java

示例2: createBlockBuilder

import parquet.column.ColumnDescriptor; //导入方法依赖的package包/类
public static ParquetBlockBuilder createBlockBuilder(int size, ColumnDescriptor descriptor)
{
    switch (descriptor.getType()) {
        case BOOLEAN:
            return new ParquetBooleanBuilder(size, descriptor);
        case INT32:
            return new ParquetIntBuilder(size, descriptor);
        case INT64:
            return new ParquetLongBuilder(size, descriptor);
        case FLOAT:
            return new ParquetFloatBuilder(size, descriptor);
        case DOUBLE:
            return new ParquetDoubleBuilder(size, descriptor);
        case BINARY:
            return new ParquetBinaryBuilder(size, descriptor);
        default:
            throw new PrestoException(NOT_SUPPORTED, "Unsupported parquet type: " + descriptor.getType());
    }
}
 
开发者ID:y-lan,项目名称:presto,代码行数:20,代码来源:ParquetBlockBuilder.java

示例3: showDetails

import parquet.column.ColumnDescriptor; //导入方法依赖的package包/类
public static void showDetails(PrettyPrintWriter out, ColumnDescriptor desc) {
  String path = Joiner.on(".").skipNulls().join(desc.getPath());
  PrimitiveTypeName type = desc.getType();
  int defl = desc.getMaxDefinitionLevel();
  int repl = desc.getMaxRepetitionLevel();

  out.format("column desc: %s T:%s R:%d D:%d%n", path, type, repl, defl); 
}
 
开发者ID:wesleypeck,项目名称:parquet-tools,代码行数:9,代码来源:MetadataUtils.java

示例4: dump

import parquet.column.ColumnDescriptor; //导入方法依赖的package包/类
public static void dump(PrettyPrintWriter out, ColumnReadStoreImpl crstore, ColumnDescriptor column, long page, long total, long offset) throws IOException {
    int dmax = column.getMaxDefinitionLevel();
    ColumnReader creader = crstore.getColumnReader(column);
    out.format("*** row group %d of %d, values %d to %d ***%n", page, total, offset, offset + creader.getTotalValueCount() - 1);

    for (long i = 0, e = creader.getTotalValueCount(); i < e; ++i) {
        int rlvl = creader.getCurrentDefinitionLevel();
        int dlvl = creader.getCurrentDefinitionLevel();

        out.format("value %d: R:%d D:%d V:", offset+i, rlvl, dlvl);
        if (dlvl == dmax) {
            switch (column.getType()) {
            case BINARY:  out.format("%s", binaryToString(creader.getBinary())); break;
            case BOOLEAN: out.format("%s", creader.getBoolean()); break;
            case DOUBLE:  out.format("%s", creader.getDouble()); break;
            case FLOAT:   out.format("%s", creader.getFloat()); break;
            case INT32:   out.format("%s", creader.getInteger()); break;
            case INT64:   out.format("%s", creader.getLong()); break;
            case INT96:   out.format("%s", binaryToBigInteger(creader.getBinary())); break;
            case FIXED_LEN_BYTE_ARRAY: out.format("%s", binaryToString(creader.getBinary())); break;
            }
        } else {
            out.format("<null>");
        }

        out.println();
        creader.consume();
    }
}
 
开发者ID:wesleypeck,项目名称:parquet-tools,代码行数:30,代码来源:DumpCommand.java

示例5: getNullableColumnReader

import parquet.column.ColumnDescriptor; //导入方法依赖的package包/类
public static NullableColumnReader getNullableColumnReader(ParquetRecordReader parentReader, int allocateSize,
                                                           ColumnDescriptor columnDescriptor,
                                                           ColumnChunkMetaData columnChunkMetaData,
                                                           boolean fixedLength,
                                                           ValueVector valueVec,
                                                           SchemaElement schemaElement) throws ExecutionSetupException {
  ConvertedType convertedType = schemaElement.getConverted_type();

  if (! columnChunkMetaData.getEncodings().contains(Encoding.PLAIN_DICTIONARY)) {
    if (columnDescriptor.getType() == PrimitiveType.PrimitiveTypeName.INT96) {
      return new NullableFixedByteAlignedReaders.NullableFixedBinaryReader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, true, (NullableVarBinaryVector) valueVec, schemaElement);
    }else{
      return new NullableFixedByteAlignedReaders.NullableFixedByteAlignedReader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, valueVec, schemaElement);
    }
  } else {
    switch (columnDescriptor.getType()) {
      case INT32:
        if (convertedType == null) {
          return new NullableFixedByteAlignedReaders.NullableDictionaryIntReader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableIntVector) valueVec, schemaElement);
        }
        switch (convertedType) {
          case DECIMAL:
            return new NullableFixedByteAlignedReaders.NullableDictionaryDecimal9Reader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableDecimal9Vector) valueVec, schemaElement);
          case TIME_MILLIS:
            return new NullableFixedByteAlignedReaders.NullableDictionaryTimeReader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableTimeVector)valueVec, schemaElement);
          default:
            throw new ExecutionSetupException("Unsupported nullable converted type " + convertedType + " for primitive type INT32");
        }
      case INT64:
        if (convertedType == null) {
          return new NullableFixedByteAlignedReaders.NullableDictionaryBigIntReader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableBigIntVector)valueVec, schemaElement);
        }
        switch (convertedType) {
          case DECIMAL:
            return new NullableFixedByteAlignedReaders.NullableDictionaryDecimal18Reader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableDecimal18Vector)valueVec, schemaElement);
          case TIMESTAMP_MILLIS:
            return new NullableFixedByteAlignedReaders.NullableDictionaryTimeStampReader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableTimeStampVector)valueVec, schemaElement);
          default:
            throw new ExecutionSetupException("Unsupported nullable converted type " + convertedType + " for primitive type INT64");
        }
      case INT96:
         return new NullableFixedByteAlignedReaders.NullableFixedBinaryReader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, true, (NullableVarBinaryVector) valueVec, schemaElement);
      case FLOAT:
        return new NullableFixedByteAlignedReaders.NullableDictionaryFloat4Reader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableFloat4Vector)valueVec, schemaElement);
      case DOUBLE:
        return new NullableFixedByteAlignedReaders.NullableDictionaryFloat8Reader(parentReader, allocateSize, columnDescriptor, columnChunkMetaData, fixedLength, (NullableFloat8Vector)valueVec, schemaElement);
      default:
        throw new ExecutionSetupException("Unsupported nullable column type " + columnDescriptor.getType().name() );
    }
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:52,代码来源:ColumnReaderFactory.java


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