当前位置:网站首页>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();
}
边栏推荐
- When AI encounters life and health, Huawei cloud builds three bridges for them
- 网络爬虫原理解析「建议收藏」
- 统信UOS下配置安装cocos2dx开发环境
- Google pixel 6A off screen fingerprint scanner has major security vulnerabilities
- [Infographics Show] 248 Public Domain Name
- 谷歌Pixel 6a屏下指纹扫描仪存在重大安全漏洞
- CarSim仿真快速入门(十六)—CarSim传感器仿真之ADAS Sensor Objects (2)
- [today in history] July 13: the father of database passed away; Apple buys cups code; IBM chip Alliance
- 接口请求合并的3种技巧,性能直接爆表!
- Distributed link logging minbox logging usage document
猜你喜欢

When AI encounters life and health, Huawei cloud builds three bridges for them

【高等数学】【8】微分方程
![[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born](/img/bf/09ccf36caec099098a22f0e8b670bd.png)
[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born

How does tiktok break zero?

10. < tag dynamic programming and subsequence, subarray> lt.53. maximum subarray and + lt.392. Judge subsequence DBC

How much memory does bitmap occupy in the development of IM instant messaging?
![[advanced mathematics] [5] definite integral and its application](/img/b2/62748b7533982f2b864148e0857490.png)
[advanced mathematics] [5] definite integral and its application
![[today in history] July 8: PostgreSQL release; SUSE acquires the largest service provider of k8s; Activision Blizzard merger](/img/14/f2b68dbe4e6a9b8d89ed9ff38f5e11.png)
[today in history] July 8: PostgreSQL release; SUSE acquires the largest service provider of k8s; Activision Blizzard merger

Advantages of network virtualization of various manufacturers

PMP每日一练 | 考试不迷路-7.25
随机推荐
Sentinel simple current limiting and degradation demo problem record
Prescan quick start to master Lesson 19: prescan actuator configuration, track synchronization and non configuration of multiple tracks
9.< tag-动态规划和子序列, 子数组>lt.718. 最长重复子数组 + lt.1143. 最长公共子序列
"Share" devaxpress asp Net v22.1 latest version system environment configuration requirements
How much memory does bitmap occupy in the development of IM instant messaging?
[advanced mathematics] [8] differential equation
接口请求合并的3种技巧,性能直接爆表!
From Tong Dai to "Tong Dai" and then to brand, the beauty of sudden profits has changed and remained unchanged
Yyds dry inventory how to locate browser page crash
【高等数学】【5】定积分及应用
[today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued
03-树1 树的同构
CarSim仿真快速入门(十五)—CarSim传感器仿真之ADAS Sensor Objects (1)
「分享」DevExpress ASP.NET v22.1最新版本系统环境配置要求
Introduction and construction of consul Registration Center
【高等数学】【6】多元函数微分学
[advanced mathematics] [4] indefinite integral
Proxy实现mysql读写分离
wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M
Is QQ 32-bit or 64 bit software (where to see whether the computer is 32-bit or 64 bit)