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

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

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

Dictionary.decodeToBinary介绍

暂无

代码示例

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

@Override
public byte[] readVarchar(int id) {
 return dict.decodeToBinary(id).getBytesUnsafe();
}

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

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

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

@Override
public Timestamp readTimestamp(int id) {
 return convert(dict.decodeToBinary(id));
}

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

@Override
public byte[] readBytes(int id) {
 return dict.decodeToBinary(id).getBytesUnsafe();
}

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

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

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

@Override
public byte[] readChar(int id) {
 return dict.decodeToBinary(id).getBytesUnsafe();
}

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

@Override
public byte[] readDecimal(int id) {
 return dict.decodeToBinary(id).getBytesUnsafe();
}

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

@Override
public void setDictionary(Dictionary dictionary) {
 int length = dictionary.getMaxId() + 1;
 lookupTable = new ArrayList<T>();
 for (int i = 0; i < length; i++) {
  lookupTable.add(convert(dictionary.decodeToBinary(i)));
 }
}

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

@Override
public byte[] readVarchar(int id) {
 // check the character numbers with the length
 final byte[] value = dict.decodeToBinary(id).getBytesUnsafe();
 return truncateIfNecesssary(value);
}

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

@Override
public byte[] readChar(int id) {
 // check the character numbers with the length
 final byte[] value = dict.decodeToBinary(id).getBytesUnsafe();
 return truncateIfNecesssary(value);
}

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

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

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

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

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

@Override
 public byte[] readDecimal(int id) {
  hiveDecimalWritable.set(dict.decodeToBinary(id).getBytesUnsafe(), scale);
  return super.validatedScaledDecimal(scale);
 }
}

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

@Override
public double readDouble(int id) {
 hiveDecimalWritable.set(dict.decodeToBinary(id).getBytesUnsafe(), scale);
 return (super.validatedDouble(hiveDecimalWritable.doubleValue(),
   serdeConstants.DOUBLE_TYPE_NAME));
}

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

@Override
public long readLong(int id) {
 hiveDecimalWritable.set(dict.decodeToBinary(id).getBytesUnsafe(), scale);
 return (long)(super.validatedDouble(hiveDecimalWritable.doubleValue(),
   serdeConstants.BIGINT_TYPE_NAME));
}

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

@Override
public long readTinyInt(int id) {
 hiveDecimalWritable.set(dict.decodeToBinary(id).getBytesUnsafe(), scale);
 return (long)(super.validatedDouble(hiveDecimalWritable.doubleValue(),
   serdeConstants.TINYINT_TYPE_NAME));
}

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

@Override
public long readSmallInt(int id) {
 hiveDecimalWritable.set(dict.decodeToBinary(id).getBytesUnsafe(), scale);
 return (long)(super.validatedDouble(hiveDecimalWritable.doubleValue(),
   serdeConstants.SMALLINT_TYPE_NAME));
}

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

@Override
public long readInteger(int id) {
 hiveDecimalWritable.set(dict.decodeToBinary(id).getBytesUnsafe(), scale);
 return (long)(super.validatedDouble(hiveDecimalWritable.doubleValue(),
   serdeConstants.INT_TYPE_NAME));
}

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

@Override
public float readFloat(int id) {
 hiveDecimalWritable.set(dict.decodeToBinary(id).getBytesUnsafe(), scale);
 return (float)(super.validatedDouble(hiveDecimalWritable.doubleValue(),
   serdeConstants.FLOAT_TYPE_NAME));
}

代码示例来源:origin: org.apache.spark/spark-sql_2.11

@Override
 public byte[] decodeToBinary(int id) {
  return dictionary.decodeToBinary(id).getBytes();
 }
}

相关文章