org.apache.parquet.column.Dictionary.decodeToBoolean()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.apache.parquet.column.Dictionary.decodeToBoolean()方法的一些代码示例,展示了Dictionary.decodeToBoolean()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dictionary.decodeToBoolean()方法的具体详情如下:
包路径:org.apache.parquet.column.Dictionary
类名称:Dictionary
方法名:decodeToBoolean

Dictionary.decodeToBoolean介绍

暂无

代码示例

代码示例来源:origin: apache/hive

@Override
public boolean readBoolean(int id) {
 return dict.decodeToBoolean(id);
}

代码示例来源:origin: apache/hive

@Override
public byte[] readString(int id) {
 return convertToBytes(dict.decodeToBoolean(id));
}

代码示例来源:origin: apache/hive

@Override
public byte[] readVarchar(int id) {
 String value = enforceMaxLength(
   convertToString(dict.decodeToBoolean(id)));
 return convertToBytes(value);
}

代码示例来源:origin: apache/hive

@Override
public byte[] readChar(int id) {
 String value = enforceMaxLength(
   convertToString(dict.decodeToBoolean(id)));
 return convertToBytes(value);
}

代码示例来源:origin: org.lasersonlab.apache.parquet/parquet-column

public boolean getBoolean() {
 return dictionary.decodeToBoolean(dictionaryId);
}
public long getLong() {

代码示例来源:origin: org.apache.parquet/parquet-column

public boolean getBoolean() {
 return dictionary.decodeToBoolean(dictionaryId);
}
public long getLong() {

代码示例来源:origin: com.alibaba.blink/flink-table

@Override
public boolean decodeToBoolean(int id) {
  return dictionary.decodeToBoolean(id);
}

代码示例来源:origin: dremio/dremio-oss

public static void printDictionary(ColumnDescriptor columnDescriptor, Dictionary localDictionary) {
  System.out.println("Dictionary for column " + columnDescriptor.toString());
  for (int i = 0; i < localDictionary.getMaxId(); ++i) {
   switch (columnDescriptor.getType()) {
    case INT32:
     System.out.println(format("%d: %d", i, localDictionary.decodeToInt(i)));
     break;
    case INT64:
     System.out.println(format("%d: %d", i, localDictionary.decodeToLong(i)));
     break;
    case INT96:
    case BINARY:
    case FIXED_LEN_BYTE_ARRAY:
     System.out.println(format("%d: %s", i, new String(localDictionary.decodeToBinary(i).getBytesUnsafe())));
     break;
    case FLOAT:
     System.out.println(format("%d: %f", i, localDictionary.decodeToFloat(i)));
     break;
    case DOUBLE:
     System.out.println(format("%d: %f", i, localDictionary.decodeToDouble(i)));
     break;
    case BOOLEAN:
     System.out.println(format("%d: %b", i, localDictionary.decodeToBoolean(i)));
     break;
    default:
     break;
   }
  }
 }
}

代码示例来源:origin: dremio/dremio-oss

localIdToGlobalId[i] = pageReader.dictionary.decodeToBoolean(i) ? 1 : 0;

代码示例来源:origin: uk.gov.gchq.gaffer/parquet-store

@Override
public void addValueFromDictionary(final int dictionaryId) {
  switch (expectedType) {
    case "Binary":  final Binary binary = this.dictionary.decodeToBinary(dictionaryId);
            addBinary(binary);
            break;
    case "boolean": final boolean bool = this.dictionary.decodeToBoolean(dictionaryId);
            addBoolean(bool);
            break;
    case "double":  final double aDouble = this.dictionary.decodeToDouble(dictionaryId);
            addDouble(aDouble);
            break;
    case "float":   final float aFloat = this.dictionary.decodeToFloat(dictionaryId);
            addFloat(aFloat);
            break;
    case "int":     final int anInt = this.dictionary.decodeToInt(dictionaryId);
            addInt(anInt);
            break;
    case "long":    final long aLong = this.dictionary.decodeToLong(dictionaryId);
            addLong(aLong);
            break;
    default:        break;
  }
}

相关文章