Skip to content

Commit d514f60

Browse files
style: auto-fix clang-format issues
1 parent 33270e7 commit d514f60

11 files changed

Lines changed: 67 additions & 71 deletions

File tree

be/src/column/binary_column.cpp

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ void BinaryColumnBase<T>::append(const Column& src, size_t offset, size_t count)
130130
}
131131

132132
template <typename T>
133-
__attribute__((noinline)) void BinaryColumnBase<T>::_append_selective_general(
134-
const BinaryColumnBase<T>& src_column, const uint32_t* indexes, uint32_t size, size_t prev_num_offsets,
135-
uint64_t dst_begin) {
133+
__attribute__((noinline)) void BinaryColumnBase<T>::_append_selective_general(const BinaryColumnBase<T>& src_column,
134+
const uint32_t* indexes, uint32_t size,
135+
size_t prev_num_offsets,
136+
uint64_t dst_begin) {
136137
auto& bytes = get_bytes();
137138
const auto& src_offsets = src_column.get_offset();
138139

@@ -387,8 +388,8 @@ void BinaryColumnBase<T>::append_value_multiple_times(const Column& src, uint32_
387388
for (size_t i = 0; i < size; ++i) {
388389
const uint32_t row_idx = index;
389390
const uint64_t row_size = src_offset_data[row_idx + 1] - src_offset_data[row_idx];
390-
strings::memcpy_inlined(dest_bytes + _offsets[cur_row_count + i],
391-
src_bytes + src_offset_data[row_idx], row_size);
391+
strings::memcpy_inlined(dest_bytes + _offsets[cur_row_count + i], src_bytes + src_offset_data[row_idx],
392+
row_size);
392393
}
393394
});
394395

@@ -434,7 +435,6 @@ StatusOr<MutableColumnPtr> BinaryColumnBase<T>::replicate(const Buffer<uint32_t>
434435
pos += bytes_size;
435436
dst_offset_data[j + 1] = static_cast<DstValue>(pos);
436437
}
437-
438438
}
439439
});
440440

@@ -850,16 +850,17 @@ void BinaryColumnBase<T>::update_rows(const Column& src, const uint32_t* indexes
850850
auto& bytes = get_bytes();
851851
auto* dest_bytes = bytes.data();
852852
const uint8_t* src_bytes = src_column._data_base();
853-
Offsets::visit_storage_pair(dst_offsets_ref, src_offsets_ref, [&](const auto& dst_buf,
854-
const auto& src_buf) {
855-
const auto* __restrict dst_offsets = dst_buf.data();
856-
const auto* __restrict src_offsets = src_buf.data();
857-
for (size_t i = 0; i < replace_num; ++i) {
858-
const size_t src_offset = src_offsets[i];
859-
const size_t str_size = src_offsets[i + 1] - src_offset;
860-
strings::memcpy_inlined(dest_bytes + dst_offsets[indexes[i]], src_bytes + src_offset, str_size);
861-
}
862-
});
853+
Offsets::visit_storage_pair(dst_offsets_ref, src_offsets_ref,
854+
[&](const auto& dst_buf, const auto& src_buf) {
855+
const auto* __restrict dst_offsets = dst_buf.data();
856+
const auto* __restrict src_offsets = src_buf.data();
857+
for (size_t i = 0; i < replace_num; ++i) {
858+
const size_t src_offset = src_offsets[i];
859+
const size_t str_size = src_offsets[i + 1] - src_offset;
860+
strings::memcpy_inlined(dest_bytes + dst_offsets[indexes[i]],
861+
src_bytes + src_offset, str_size);
862+
}
863+
});
863864
return;
864865
}
865866
}
@@ -968,9 +969,9 @@ size_t BinaryColumnBase<T>::filter_range(const Filter& filter, size_t from, size
968969
// set offsets, try vectorized
969970
for (int i = 0; i < batch_nums; ++i) {
970971
// TODO: performance, all sub one same offset ?
971-
offset_data[result_offset + i + 1] =
972-
offset_data[result_offset + i] + offset_data[start_offset + i + 1] -
973-
offset_data[start_offset + i];
972+
offset_data[result_offset + i + 1] = offset_data[result_offset + i] +
973+
offset_data[start_offset + i + 1] -
974+
offset_data[start_offset + i];
974975
}
975976

976977
result_offset += batch_nums;
@@ -1156,9 +1157,11 @@ void BinaryColumnBase<T>::deserialize_and_append_batch(Buffer<Slice>& srcs, size
11561157
}
11571158

11581159
template <typename Offset>
1159-
__attribute__((noinline)) static void serialize_binary_batch_nullable_impl(
1160-
uint8_t* dst, uint32_t* __restrict sizes, size_t chunk_size, uint32_t max_one_row_size,
1161-
const uint8_t* __restrict null_masks, const uint8_t* __restrict base, const Offset* __restrict offsets_data) {
1160+
__attribute__((noinline)) static void serialize_binary_batch_nullable_impl(uint8_t* dst, uint32_t* __restrict sizes,
1161+
size_t chunk_size, uint32_t max_one_row_size,
1162+
const uint8_t* __restrict null_masks,
1163+
const uint8_t* __restrict base,
1164+
const Offset* __restrict offsets_data) {
11621165
uint8_t* row = dst;
11631166
for (size_t i = 0; i < chunk_size; ++i) {
11641167
uint8_t* pos = row + sizes[i];
@@ -1380,9 +1383,8 @@ Status BinaryColumnBase<T>::capacity_limit_reached() const {
13801383
column_name,
13811384
std::to_string(Column::MAX_LARGE_CAPACITY_LIMIT)));
13821385
} else if (_offsets.size() >= Column::MAX_CAPACITY_LIMIT) {
1383-
return Status::CapacityLimitExceed(strings::Substitute("Total row count of $0 exceed the limit: $1",
1384-
column_name,
1385-
std::to_string(Column::MAX_CAPACITY_LIMIT)));
1386+
return Status::CapacityLimitExceed(strings::Substitute(
1387+
"Total row count of $0 exceed the limit: $1", column_name, std::to_string(Column::MAX_CAPACITY_LIMIT)));
13861388
}
13871389
return Status::OK();
13881390
}

be/src/column/binary_column.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,7 @@ class BinaryColumnBase final : public CowFactory<ColumnFactory<Column, BinaryCol
255255

256256
void append_default() override { _offsets.emplace_back(_bytes.size()); }
257257

258-
void append_default(size_t count) override {
259-
_offsets.append_empty_values(count);
260-
}
258+
void append_default(size_t count) override { _offsets.append_empty_values(count); }
261259

262260
StatusOr<MutableColumnPtr> replicate(const Buffer<uint32_t>& offsets) override;
263261

be/src/column/column_hash/column_hash.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ class ColumnHashVisitor final : public ColumnVisitorAdapter<ColumnHashVisitor<Ha
248248
auto len = offset_data[idx + 1] - offset_data[idx];
249249
// For empty strings, don't modify the hash (hash with 0 bytes preserves the seed)
250250
if (len > 0) {
251-
*slot_ptr = HashFunction::hash(bytes.data() + offset_data[idx], static_cast<int32_t>(len),
252-
*slot_ptr);
251+
*slot_ptr =
252+
HashFunction::hash(bytes.data() + offset_data[idx], static_cast<int32_t>(len), *slot_ptr);
253253
}
254254
});
255255
});

be/src/exprs/agg/group_concat.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ class GroupConcatAggregateFunction final
250250
auto& offsets = dst_column->get_offset();
251251
offsets.resize_uninitialized(chunk_size + 1, new_size);
252252

253-
Offsets::visit_storage_pair(offsets, column_value->get_offset(),
254-
[&](auto& offsets_buf, const auto& value_offsets) {
255-
column_sep->get_offset().visit_storage([&](const auto& sep_offsets) {
256-
serialize_column_sep_values(bytes, old_size, chunk_size, offsets_buf, value_offsets,
257-
column_value->get_string_begin(), sep_offsets,
258-
column_sep->get_string_begin());
259-
});
260-
});
253+
Offsets::visit_storage_pair(
254+
offsets, column_value->get_offset(), [&](auto& offsets_buf, const auto& value_offsets) {
255+
column_sep->get_offset().visit_storage([&](const auto& sep_offsets) {
256+
serialize_column_sep_values(bytes, old_size, chunk_size, offsets_buf, value_offsets,
257+
column_value->get_string_begin(), sep_offsets,
258+
column_sep->get_string_begin());
259+
});
260+
});
261261
DCHECK_EQ(old_size, new_size);
262262
}
263263
} else {
@@ -271,12 +271,12 @@ class GroupConcatAggregateFunction final
271271
auto& offsets = dst_column->get_offset();
272272
offsets.resize_uninitialized(chunk_size + 1, new_size);
273273

274-
Offsets::visit_storage_pair(offsets, column_value->get_offset(),
275-
[&](auto& offsets_buf, const auto& value_offsets) {
276-
serialize_const_sep_values(bytes, old_size, chunk_size, offsets_buf, value_offsets,
277-
column_value->get_string_begin(), sep.get_data(),
278-
static_cast<uint32_t>(sep.size));
279-
});
274+
Offsets::visit_storage_pair(
275+
offsets, column_value->get_offset(), [&](auto& offsets_buf, const auto& value_offsets) {
276+
serialize_const_sep_values(bytes, old_size, chunk_size, offsets_buf, value_offsets,
277+
column_value->get_string_begin(), sep.get_data(),
278+
static_cast<uint32_t>(sep.size));
279+
});
280280
DCHECK_EQ(old_size, new_size);
281281
}
282282
}
@@ -297,11 +297,11 @@ class GroupConcatAggregateFunction final
297297
auto& offsets = dst_column->get_offset();
298298
offsets.resize_uninitialized(chunk_size + 1, new_size);
299299

300-
Offsets::visit_storage_pair(offsets, column_value->get_offset(),
301-
[&](auto& offsets_buf, const auto& value_offsets) {
302-
serialize_const_sep_values(bytes, old_size, chunk_size, offsets_buf, value_offsets,
303-
column_value->get_string_begin(), sep, size_sep);
304-
});
300+
Offsets::visit_storage_pair(
301+
offsets, column_value->get_offset(), [&](auto& offsets_buf, const auto& value_offsets) {
302+
serialize_const_sep_values(bytes, old_size, chunk_size, offsets_buf, value_offsets,
303+
column_value->get_string_begin(), sep, size_sep);
304+
});
305305
DCHECK_EQ(old_size, new_size);
306306
}
307307
}

be/src/exprs/cast_expr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,13 +1474,13 @@ DEFINE_INT_CAST_TO_STRING(TYPE_BIGINT, TYPE_VARCHAR);
14741474
for (int i = 0; i < size; ++i) { \
14751475
r1[i].to_string(dst + off, MAX_LEN); \
14761476
off += MAX_LEN; \
1477-
offset.set(i + 1, off); \
1477+
offset.set(i + 1, off); \
14781478
} \
14791479
} else { \
14801480
for (int i = 0; i < size; ++i) { \
14811481
int len = r1[i].to_string(dst + off, MAX_LEN); \
14821482
if (LIKELY(len > 0)) off += len; \
1483-
offset.set(i + 1, off); \
1483+
offset.set(i + 1, off); \
14841484
} \
14851485
} \
14861486
bytes.resize(off); \

be/src/exprs/string_functions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ static inline void ascii_substr(const BinaryColumn* src, Bytes* bytes, Offsets*
279279
for (size_t i = 0; i < size; ++i) {
280280
auto s = src->get_slice(i);
281281
ascii_substr_per_slice<off_is_negative, allow_out_of_left_bound>(
282-
&s, off, len, binary_column_empty_op_fast<DstOffset>,
283-
binary_column_non_empty_op_fast<DstOffset>, bytes, dst_offset_data, i);
282+
&s, off, len, binary_column_empty_op_fast<DstOffset>, binary_column_non_empty_op_fast<DstOffset>,
283+
bytes, dst_offset_data, i);
284284
}
285285
});
286286
}

be/src/formats/parquet/encoding_plain.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,15 @@ class FLBAPlainDecoder final : public Decoder {
577577
offsets.resize_uninitialized(count + prev_offsets, final_offset);
578578
{
579579
// fill offset columns
580-
offsets.visit_storage([prev_offsets, count, is_nulls, type_length = _type_length, offset](auto& offsets_buf) mutable {
581-
using OffsetValue = typename std::decay_t<decltype(offsets_buf)>::value_type;
582-
auto* dst_offsets = offsets_buf.data() + prev_offsets;
583-
for (size_t i = 0; i < count; ++i) {
584-
offset += is_nulls[i] ? 0 : type_length;
585-
dst_offsets[i] = static_cast<OffsetValue>(offset);
586-
}
587-
});
580+
offsets.visit_storage(
581+
[prev_offsets, count, is_nulls, type_length = _type_length, offset](auto& offsets_buf) mutable {
582+
using OffsetValue = typename std::decay_t<decltype(offsets_buf)>::value_type;
583+
auto* dst_offsets = offsets_buf.data() + prev_offsets;
584+
for (size_t i = 0; i < count; ++i) {
585+
offset += is_nulls[i] ? 0 : type_length;
586+
dst_offsets[i] = static_cast<OffsetValue>(offset);
587+
}
588+
});
588589
}
589590
DCHECK_EQ(binary_column->get_bytes().size(), binary_column->get_offset().back());
590591

be/src/storage/chunk_helper.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,6 @@ bool ChunkPipelineAccumulator::is_finished() const {
385385
return _finalized && _out_chunk == nullptr && _in_chunk == nullptr;
386386
}
387387

388-
389-
390388
CommonExprEvalScopeGuard::CommonExprEvalScopeGuard(const ChunkPtr& chunk,
391389
const std::map<SlotId, ExprContext*>& common_expr_ctxs)
392390
: _chunk(chunk), _common_expr_ctxs(common_expr_ctxs) {}

be/src/storage/rowset/binary_plain_page.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ bool BinaryPlainPageDecoder<Type>::append_range(uint32_t idx, uint32_t end, Colu
251251
}
252252

253253
for (uint32_t i = end - 1; i < end; i++) {
254-
const uint64_t current_offset =
255-
begin_offset + static_cast<uint64_t>(offset(i + 1) - page_data_offset);
254+
const uint64_t current_offset = begin_offset + static_cast<uint64_t>(offset(i + 1) - page_data_offset);
256255
*dst_offsets++ = static_cast<OffsetValue>(current_offset);
257256
}
258257
});

be/src/udf/java/java_native_method.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ class GetColumnAddrVistor : public ColumnVisitorAdapter<GetColumnAddrVistor> {
5252
column_offsets.size() > java_max_buffer_size / sizeof(uint32_t)) {
5353
return Status::NotSupported("Java UDF does not support BinaryColumn with large offsets or bytes");
5454
}
55-
column_offsets.visit_storage([&](const auto& offsets) {
56-
_jarr[_idx++] = reinterpret_cast<int64_t>(offsets.data());
57-
});
55+
column_offsets.visit_storage(
56+
[&](const auto& offsets) { _jarr[_idx++] = reinterpret_cast<int64_t>(offsets.data()); });
5857
_jarr[_idx++] = reinterpret_cast<int64_t>(column.get_immutable_bytes().data());
5958
return Status::OK();
6059
}

0 commit comments

Comments
 (0)