github-actions[bot] commented on code in PR #17112:
URL: https://github.com/apache/doris/pull/17112#discussion_r1116695489
##########
be/src/vec/exec/format/parquet/decoder.cpp:
##########
@@ -88,6 +89,19 @@ Status Decoder::get_decoder(tparquet::Type::type type,
tparquet::Encoding::type
tparquet::to_string(type),
tparquet::to_string(encoding));
}
break;
+ case tparquet::Encoding::DELTA_BINARY_PACKED:
+ // Supports only INT32 and INT64.
+ switch (type) {
+ case tparquet::Type::INT32:
+ [[fallthrough]];
+ case tparquet::Type::INT64:
+ decoder.reset(new DeltaBitPackDecoder());
Review Comment:
warning: no viable constructor or deduction guide for deduction of template
arguments of 'DeltaBitPackDecoder' [clang-diagnostic-error]
```cpp
decoder.reset(new DeltaBitPackDecoder());
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:38:** candidate
template ignored: couldn't infer template argument 'Type'
```cpp
DeltaBitPackDecoder() {};
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:33:** candidate
function template not viable: requires 1 argument, but 0 were provided
```cpp
class DeltaBitPackDecoder final : public Decoder {
^
```
##########
be/src/util/bit_stream_utils.inline.h:
##########
@@ -195,20 +208,29 @@ inline bool BitReader::GetAligned(int num_bytes, T* v) {
return true;
}
-inline bool BitReader::GetVlqInt(int32_t* v) {
+inline bool BitReader::GetVlqInt(uint32_t* v) {
*v = 0;
int shift = 0;
int num_bytes = 0;
uint8_t byte = 0;
do {
if (!GetAligned<uint8_t>(1, &byte)) return false;
- *v |= (byte & 0x7F) << shift;
+ *v |= static_cast<uint32_t>(byte & 0x7F) << shift;
shift += 7;
DCHECK_LE(++num_bytes, MAX_VLQ_BYTE_LEN);
} while ((byte & 0x80) != 0);
return true;
}
+inline bool BitReader::GetZigZagVlqInt(int32_t* v) {
+ uint32_t u;
+ if (!GetVlqInt(&u)) return false;
Review Comment:
warning: statement should be inside braces
[readability-braces-around-statements]
```suggestion
if (!GetVlqInt(&u)) { return false;
}
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.cpp:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "delta_bit_pack_decoder.h"
+
+namespace doris::vectorized {
+
+Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
+ ColumnSelectVector& select_vector) {
+ select_vector.num_values();
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::skip_values(size_t num_values) {
Review Comment:
warning: 'DeltaBitPackDecoder' is not a class, namespace, or enumeration
[clang-diagnostic-error]
```cpp
Status DeltaBitPackDecoder::skip_values(size_t num_values) {
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:33:**
'DeltaBitPackDecoder' declared here
```cpp
class DeltaBitPackDecoder final : public Decoder {
^
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.cpp:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "delta_bit_pack_decoder.h"
+
+namespace doris::vectorized {
+
+Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
+ ColumnSelectVector& select_vector) {
+ select_vector.num_values();
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::skip_values(size_t num_values) {
+ return Status::OK();
+}
+
+
+Status DeltaBitPackDecoder::_init_header() {
Review Comment:
warning: 'DeltaBitPackDecoder' is not a class, namespace, or enumeration
[clang-diagnostic-error]
```cpp
Status DeltaBitPackDecoder::_init_header() {
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:33:**
'DeltaBitPackDecoder' declared here
```cpp
class DeltaBitPackDecoder final : public Decoder {
^
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.cpp:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "delta_bit_pack_decoder.h"
+
+namespace doris::vectorized {
+
+Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
+ ColumnSelectVector& select_vector) {
+ select_vector.num_values();
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::skip_values(size_t num_values) {
+ return Status::OK();
+}
+
+
+Status DeltaBitPackDecoder::_init_header() {
+ if (!_decoder->GetVlqInt(&_values_per_block) ||
+ !_decoder->GetVlqInt(&_mini_blocks_per_block) ||
+ !_decoder->GetVlqInt(&_total_value_count) ||
+ !_decoder->GetZigZagVlqInt(&_last_value)) {
+ return Status::EndOfFile("Init header eof")
+ }
+ if (_values_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per block");
+ }
+ if (_values_per_block % 128 != 0) {
+ return Status::InvalidArgument(
+ "the number of values in a block must be multiple of 128, but
it's " +
+ std::to_string(_values_per_block));
+ }
+ if (_mini_blocks_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero miniblock per block");
+ }
+ _values_per_mini_block = _values_per_block / _mini_blocks_per_block;
+ if (_values_per_mini_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per miniblock");
+ }
+ if (_values_per_mini_block % 32 != 0) {
+ return Status::InvalidArgument(
+ "The number of values in a miniblock must be multiple of 32,
but it's " +
+ std::to_string(_values_per_mini_block));
+ }
+ _total_values_remaining = _total_value_count;
+ // init as empty property
+ _delta_bit_widths = Slice();
+ _delta_bit_widths.size = _mini_blocks_per_block;
+
+ _block_initialized = false;
+ _values_remaining_current_mini_block = 0;
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_init_block() {
Review Comment:
warning: 'DeltaBitPackDecoder' is not a class, namespace, or enumeration
[clang-diagnostic-error]
```cpp
Status DeltaBitPackDecoder::_init_block() {
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:33:**
'DeltaBitPackDecoder' declared here
```cpp
class DeltaBitPackDecoder final : public Decoder {
^
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.cpp:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "delta_bit_pack_decoder.h"
+
+namespace doris::vectorized {
+
+Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
+ ColumnSelectVector& select_vector) {
+ select_vector.num_values();
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::skip_values(size_t num_values) {
+ return Status::OK();
+}
+
+
+Status DeltaBitPackDecoder::_init_header() {
+ if (!_decoder->GetVlqInt(&_values_per_block) ||
+ !_decoder->GetVlqInt(&_mini_blocks_per_block) ||
+ !_decoder->GetVlqInt(&_total_value_count) ||
+ !_decoder->GetZigZagVlqInt(&_last_value)) {
+ return Status::EndOfFile("Init header eof")
+ }
+ if (_values_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per block");
+ }
+ if (_values_per_block % 128 != 0) {
+ return Status::InvalidArgument(
+ "the number of values in a block must be multiple of 128, but
it's " +
+ std::to_string(_values_per_block));
+ }
+ if (_mini_blocks_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero miniblock per block");
+ }
+ _values_per_mini_block = _values_per_block / _mini_blocks_per_block;
+ if (_values_per_mini_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per miniblock");
+ }
+ if (_values_per_mini_block % 32 != 0) {
+ return Status::InvalidArgument(
+ "The number of values in a miniblock must be multiple of 32,
but it's " +
+ std::to_string(_values_per_mini_block));
+ }
+ _total_values_remaining = _total_value_count;
+ // init as empty property
+ _delta_bit_widths = Slice();
+ _delta_bit_widths.size = _mini_blocks_per_block;
+
+ _block_initialized = false;
+ _values_remaining_current_mini_block = 0;
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_init_block() {
+ DCHECK_GT(_total_values_remaining, 0) << "InitBlock called at EOF";
+ if (!_decoder->GetZigZagVlqInt(&_min_delta)) {
+ return Status::EndOfFile("Init block eof");
+ }
+
+ // read the bitwidth of each miniblock
+ uint8_t* bit_width_data =
reinterpret_cast<uint8_t*>(_delta_bit_widths.mutable_data());
+ for (uint32_t i = 0; i < _mini_blocks_per_block; ++i) {
+ if (!_decoder->GetAligned<uint8_t>(1, bit_width_data + i)) {
+ return Status::EndOfFile("Decode bit-width EOF");
+ }
+ // Note that non-conformant bitwidth entries are allowed by the
Parquet spec
+ // for extraneous miniblocks in the last block (GH-14923), so we check
+ // the bitwidths when actually using them (see InitMiniBlock()).
+ }
+ _mini_block_idx = 0;
+ _block_initialized = true;
+ _init_mini_block(bit_width_data[0]);
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_init_mini_block(int bit_width) {
+ if (bit_width > kMaxDeltaBitWidth) {
+ return Status::InvalidArgument("delta bit width larger than integer
bit width");
+ }
+ _delta_bit_width = bit_width;
+ _values_remaining_current_mini_block = _values_per_mini_block;
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_get_internal(T* buffer, int max_values, int* out)
{
Review Comment:
warning: 'DeltaBitPackDecoder' is not a class, namespace, or enumeration
[clang-diagnostic-error]
```cpp
Status DeltaBitPackDecoder::_get_internal(T* buffer, int max_values, int*
out) {
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:33:**
'DeltaBitPackDecoder' declared here
```cpp
class DeltaBitPackDecoder final : public Decoder {
^
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include "vec/columns/column.h"
+#include "vec/exec/format/parquet/decoder.h"
+#include "util/bit_stream_utils.h"
+
+namespace doris::vectorized {
+/**
+ * Format
+ * [header] [block 1] [block 2] ... [block N]
+ * Header
+ * [block size] [_mini_blocks_per_block] [_total_value_count] [first
value]
+ * Block
+ * [min delta] [list of bitwidths of the mini blocks] [miniblocks]
+ */
+template <typename Type>
+class DeltaBitPackDecoder final : public Decoder {
+public:
+ typedef typename Type::c_type T;
Review Comment:
warning: use 'using' instead of 'typedef' [modernize-use-using]
```suggestion
using T = typename Type::c_type;
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include "vec/columns/column.h"
+#include "vec/exec/format/parquet/decoder.h"
+#include "util/bit_stream_utils.h"
+
+namespace doris::vectorized {
+/**
+ * Format
+ * [header] [block 1] [block 2] ... [block N]
+ * Header
+ * [block size] [_mini_blocks_per_block] [_total_value_count] [first
value]
+ * Block
+ * [min delta] [list of bitwidths of the mini blocks] [miniblocks]
+ */
+template <typename Type>
+class DeltaBitPackDecoder final : public Decoder {
+public:
+ typedef typename Type::c_type T;
+ using UT = std::make_unsigned_t<T>;
+
+ DeltaBitPackDecoder() {};
Review Comment:
warning: use '= default' to define a trivial default constructor
[modernize-use-equals-default]
```suggestion
DeltaBitPackDecoder() = default;;
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.cpp:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "delta_bit_pack_decoder.h"
+
+namespace doris::vectorized {
+
+Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
Review Comment:
warning: 'DeltaBitPackDecoder' is not a class, namespace, or enumeration
[clang-diagnostic-error]
```cpp
Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:33:**
'DeltaBitPackDecoder' declared here
```cpp
class DeltaBitPackDecoder final : public Decoder {
^
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.cpp:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "delta_bit_pack_decoder.h"
+
+namespace doris::vectorized {
+
+Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
+ ColumnSelectVector& select_vector) {
+ select_vector.num_values();
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::skip_values(size_t num_values) {
+ return Status::OK();
+}
+
+
+Status DeltaBitPackDecoder::_init_header() {
+ if (!_decoder->GetVlqInt(&_values_per_block) ||
+ !_decoder->GetVlqInt(&_mini_blocks_per_block) ||
+ !_decoder->GetVlqInt(&_total_value_count) ||
+ !_decoder->GetZigZagVlqInt(&_last_value)) {
+ return Status::EndOfFile("Init header eof")
+ }
+ if (_values_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per block");
+ }
+ if (_values_per_block % 128 != 0) {
+ return Status::InvalidArgument(
+ "the number of values in a block must be multiple of 128, but
it's " +
+ std::to_string(_values_per_block));
+ }
+ if (_mini_blocks_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero miniblock per block");
+ }
+ _values_per_mini_block = _values_per_block / _mini_blocks_per_block;
+ if (_values_per_mini_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per miniblock");
+ }
+ if (_values_per_mini_block % 32 != 0) {
+ return Status::InvalidArgument(
+ "The number of values in a miniblock must be multiple of 32,
but it's " +
+ std::to_string(_values_per_mini_block));
+ }
+ _total_values_remaining = _total_value_count;
+ // init as empty property
+ _delta_bit_widths = Slice();
+ _delta_bit_widths.size = _mini_blocks_per_block;
+
+ _block_initialized = false;
+ _values_remaining_current_mini_block = 0;
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_init_block() {
+ DCHECK_GT(_total_values_remaining, 0) << "InitBlock called at EOF";
+ if (!_decoder->GetZigZagVlqInt(&_min_delta)) {
+ return Status::EndOfFile("Init block eof");
+ }
+
+ // read the bitwidth of each miniblock
+ uint8_t* bit_width_data =
reinterpret_cast<uint8_t*>(_delta_bit_widths.mutable_data());
+ for (uint32_t i = 0; i < _mini_blocks_per_block; ++i) {
+ if (!_decoder->GetAligned<uint8_t>(1, bit_width_data + i)) {
+ return Status::EndOfFile("Decode bit-width EOF");
+ }
+ // Note that non-conformant bitwidth entries are allowed by the
Parquet spec
+ // for extraneous miniblocks in the last block (GH-14923), so we check
+ // the bitwidths when actually using them (see InitMiniBlock()).
+ }
+ _mini_block_idx = 0;
+ _block_initialized = true;
+ _init_mini_block(bit_width_data[0]);
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_init_mini_block(int bit_width) {
+ if (bit_width > kMaxDeltaBitWidth) {
+ return Status::InvalidArgument("delta bit width larger than integer
bit width");
+ }
+ _delta_bit_width = bit_width;
+ _values_remaining_current_mini_block = _values_per_mini_block;
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_get_internal(T* buffer, int max_values, int* out)
{
Review Comment:
warning: unknown type name 'T' [clang-diagnostic-error]
```cpp
Status DeltaBitPackDecoder::_get_internal(T* buffer, int max_values, int*
out) {
^
```
##########
be/src/vec/exec/format/parquet/delta_bit_pack_decoder.cpp:
##########
@@ -0,0 +1,168 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "delta_bit_pack_decoder.h"
+
+namespace doris::vectorized {
+
+Status DeltaBitPackDecoder::decode_values(MutableColumnPtr& doris_column,
DataTypePtr& data_type,
+ ColumnSelectVector& select_vector) {
+ select_vector.num_values();
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::skip_values(size_t num_values) {
+ return Status::OK();
+}
+
+
+Status DeltaBitPackDecoder::_init_header() {
+ if (!_decoder->GetVlqInt(&_values_per_block) ||
+ !_decoder->GetVlqInt(&_mini_blocks_per_block) ||
+ !_decoder->GetVlqInt(&_total_value_count) ||
+ !_decoder->GetZigZagVlqInt(&_last_value)) {
+ return Status::EndOfFile("Init header eof")
+ }
+ if (_values_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per block");
+ }
+ if (_values_per_block % 128 != 0) {
+ return Status::InvalidArgument(
+ "the number of values in a block must be multiple of 128, but
it's " +
+ std::to_string(_values_per_block));
+ }
+ if (_mini_blocks_per_block == 0) {
+ return Status::InvalidArgument("Cannot have zero miniblock per block");
+ }
+ _values_per_mini_block = _values_per_block / _mini_blocks_per_block;
+ if (_values_per_mini_block == 0) {
+ return Status::InvalidArgument("Cannot have zero value per miniblock");
+ }
+ if (_values_per_mini_block % 32 != 0) {
+ return Status::InvalidArgument(
+ "The number of values in a miniblock must be multiple of 32,
but it's " +
+ std::to_string(_values_per_mini_block));
+ }
+ _total_values_remaining = _total_value_count;
+ // init as empty property
+ _delta_bit_widths = Slice();
+ _delta_bit_widths.size = _mini_blocks_per_block;
+
+ _block_initialized = false;
+ _values_remaining_current_mini_block = 0;
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_init_block() {
+ DCHECK_GT(_total_values_remaining, 0) << "InitBlock called at EOF";
+ if (!_decoder->GetZigZagVlqInt(&_min_delta)) {
+ return Status::EndOfFile("Init block eof");
+ }
+
+ // read the bitwidth of each miniblock
+ uint8_t* bit_width_data =
reinterpret_cast<uint8_t*>(_delta_bit_widths.mutable_data());
+ for (uint32_t i = 0; i < _mini_blocks_per_block; ++i) {
+ if (!_decoder->GetAligned<uint8_t>(1, bit_width_data + i)) {
+ return Status::EndOfFile("Decode bit-width EOF");
+ }
+ // Note that non-conformant bitwidth entries are allowed by the
Parquet spec
+ // for extraneous miniblocks in the last block (GH-14923), so we check
+ // the bitwidths when actually using them (see InitMiniBlock()).
+ }
+ _mini_block_idx = 0;
+ _block_initialized = true;
+ _init_mini_block(bit_width_data[0]);
+ return Status::OK();
+}
+
+Status DeltaBitPackDecoder::_init_mini_block(int bit_width) {
Review Comment:
warning: 'DeltaBitPackDecoder' is not a class, namespace, or enumeration
[clang-diagnostic-error]
```cpp
Status DeltaBitPackDecoder::_init_mini_block(int bit_width) {
^
```
**be/src/vec/exec/format/parquet/delta_bit_pack_decoder.h:33:**
'DeltaBitPackDecoder' declared here
```cpp
class DeltaBitPackDecoder final : public Decoder {
^
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]