当前位置:网站首页>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();
}
边栏推荐
- SecureCRT garbled code solution [easy to understand]
- [advanced mathematics] [6] differential calculus of multivariate functions
- 火山引擎项亮:机器学习与智能推荐平台多云部署解决方案正式发布
- CarSim仿真快速入门(十四)—CarSim-Simulink联合仿真
- 9. < tag dynamic programming and subsequence, subarray> lt.718. Longest repeated subarray + lt.1143. Longest common subsequence
- Introduction and construction of consul Registration Center
- 飞行器pid控制(旋翼飞控)
- "Share" devaxpress asp Net v22.1 latest version system environment configuration requirements
- CarSim simulation quick start (XV) - ADAS sensor objects of CarSim sensor simulation (1)
- [advanced mathematics] [8] differential equation
猜你喜欢

MySQL 日期【加号/+】条件筛选问题

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

wallys//wifi6 wifi5 router IPQ6018 IPQ4019 IPQ4029 802.11ax 802.11ac
![[today in history] July 17: Softbank acquired arm; The first email interruption; Wikimedia International Conference](/img/0f/8ce2d5487b16d38a152cfd3ab454bb.png)
[today in history] July 17: Softbank acquired arm; The first email interruption; Wikimedia International Conference
![[advanced mathematics] [8] differential equation](/img/83/b6b07540e3cf6d6433e57447d42ee9.png)
[advanced mathematics] [8] differential equation

4. Server startup of source code analysis of Nacos configuration center

PreScan快速入门到精通第十九讲之PreScan执行器配置、轨迹同步及非配多个轨迹

JVM(二十三) -- JVM运行时参数

PMP每日一练 | 考试不迷路-7.25
![[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now
随机推荐
RF、GBDT、XGboost特征选择方法「建议收藏」
PMP采用最新考纲,这里有【敏捷项目管理】
YOLOv7论文部分解读【含自己的理解】
雷达水位计的工作原理及安装维护注意事项
Link list of sword finger offer question bank summary (III) (C language version)
Application of conductive slip ring in mechanical equipment
[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now
第六章 修改规范(SPEC)类
4、Nacos 配置中心源码解析之 服务端启动
随机梯度下降法、牛顿法、冲量法、AdaGrad、RMSprop以及Adam优化过程和理解
PMP practice once a day | don't get lost in the exam -7.25
网络爬虫原理解析「建议收藏」
JS作用域与作用域链
wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M
Dataloader reports an error "default_collate: batch must contain tensors, numpy arrays, numbers, dicts" when pytorch trains the model
Digital informatization (enumerate assumptions first, and then see whether the conditions are met) (1089 werewolf kill - simple version)
[today in history] July 17: Softbank acquired arm; The first email interruption; Wikimedia International Conference
"Share" devaxpress asp Net v22.1 latest version system environment configuration requirements
Formatdatetime explanation [easy to understand]
[advanced mathematics] [1] function, limit, continuity