当前位置:网站首页>Arrow parquet
Arrow parquet
2022-07-25 20:13:00 【zhixingheyi_ tian】
DictByteArrayDecoderImpl
class DictByteArrayDecoderImpl : public DictDecoderImpl<ByteArrayType>,
virtual public ByteArrayDecoder {
public:
using BASE = DictDecoderImpl<ByteArrayType>;
using BASE::DictDecoderImpl;
int DecodeArrow(int num_values, int null_count, const uint8_t* valid_bits,
int64_t valid_bits_offset,
typename EncodingTraits<ByteArrayType>::Accumulator* out) override {
int result = 0;
if (null_count == 0) {
PARQUET_THROW_NOT_OK(DecodeArrowDenseNonNull(num_values, out, &result));
} else {
PARQUET_THROW_NOT_OK(DecodeArrowDense(num_values, null_count, valid_bits,
valid_bits_offset, out, &result));
}
return result;
}
Status DecodeArrowDenseNonNull(int num_values,
typename EncodingTraits<ByteArrayType>::Accumulator* out,
int* out_num_values) {
constexpr int32_t kBufferSize = 2048;
int32_t indices[kBufferSize];
int values_decoded = 0;
ArrowBinaryHelper helper(out);
auto dict_values = reinterpret_cast<const ByteArray*>(dictionary_->data());
while (values_decoded < num_values) {
int32_t batch_size = std::min<int32_t>(kBufferSize, num_values - values_decoded);
int num_indices = idx_decoder_.GetBatch(indices, batch_size);
if (num_indices == 0) ParquetException::EofException();
for (int i = 0; i < num_indices; ++i) {
auto idx = indices[i];
RETURN_NOT_OK(IndexInBounds(idx));
const auto& val = dict_values[idx];
if (ARROW_PREDICT_FALSE(!helper.CanFit(val.len))) {
RETURN_NOT_OK(helper.PushChunk());
}
RETURN_NOT_OK(helper.Append(val.ptr, static_cast<int32_t>(val.len)));
}
values_decoded += num_indices;
}
*out_num_values = values_decoded;
return Status::OK();
}
边栏推荐
- 10.< tag-动态规划和子序列, 子数组>lt.53. 最大子数组和 + lt.392. 判断子序列 dbc
- 9. < tag dynamic programming and subsequence, subarray> lt.718. Longest repeated subarray + lt.1143. Longest common subsequence
- [today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day
- 谷歌Pixel 6a屏下指纹扫描仪存在重大安全漏洞
- How to ensure the quality of customized slip rings
- CarSim仿真快速入门(十五)—CarSim传感器仿真之ADAS Sensor Objects (1)
- [advanced mathematics] [8] differential equation
- PreScan快速入门到精通第十八讲之PreScan轨迹编辑的特殊功能
- JS作用域与作用域链
- 网络RTK无人机上机测试[通俗易懂]
猜你喜欢

03-树1 树的同构

C # add multi line and multi column text watermark in word

Vivo official website app full model UI adaptation scheme

【高等数学】【5】定积分及应用

分享 25 个有用的 JS 单行代码
![[advanced mathematics] [3] Application of differential mean value theorem and derivative](/img/a9/3b024dbbb201bee4eed6c9f6ce3001.png)
[advanced mathematics] [3] Application of differential mean value theorem and derivative

wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M

各厂商网络虚拟化的优势

Google pixel 6A off screen fingerprint scanner has major security vulnerabilities

4. Server startup of source code analysis of Nacos configuration center
随机推荐
【高等数学】【5】定积分及应用
PreScan快速入门到精通第十九讲之PreScan执行器配置、轨迹同步及非配多个轨迹
Cloud native guide: what is cloud native infrastructure
4. Server startup of source code analysis of Nacos configuration center
【高等数学】【4】不定积分
PMP adopts the latest exam outline, here is [agile project management]
【高等数学】【8】微分方程
Proxy实现mysql读写分离
Do you still have certificates to participate in the open source community?
参与开源社区还有证书拿?
JVM(二十三) -- JVM运行时参数
Network RTK UAV test [easy to understand]
股票软件开发
"Share" devaxpress asp Net v22.1 latest version system environment configuration requirements
When the V100 of mindpole 8 card is trained to 101 epochs, an error of reading data timeout is reported
Software designer afternoon real topic: 2009-2022
Rainbond插件扩展:基于Mysql-Exporter监控Mysql
Connecting to the database warning establishing SSL connection without server's identity verification is not recommended
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay
[today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world