Fix broken multi-column aggregation on s390x

This commit is contained in:
HarryLeeIBM 2024-06-10 10:52:35 -07:00
parent 9a55cdf77c
commit a7acc79fe5
2 changed files with 2 additions and 8 deletions

View File

@ -90,10 +90,7 @@ void fillFixedBatch(size_t keys_size, const ColumnRawPtrs & key_columns, const S
/// Note: here we violate strict aliasing. /// Note: here we violate strict aliasing.
/// It should be ok as log as we do not reffer to any value from `out` before filling. /// It should be ok as log as we do not reffer to any value from `out` before filling.
const char * source = static_cast<const ColumnFixedSizeHelper *>(column)->getRawDataBegin<sizeof(T)>(); const char * source = static_cast<const ColumnFixedSizeHelper *>(column)->getRawDataBegin<sizeof(T)>();
size_t offset_to = offset; T * dest = reinterpret_cast<T *>(reinterpret_cast<char *>(out.data()) + offset);
if constexpr (std::endian::native == std::endian::big)
offset_to = sizeof(Key) - sizeof(T) - offset;
T * dest = reinterpret_cast<T *>(reinterpret_cast<char *>(out.data()) + offset_to);
fillFixedBatch<T, sizeof(Key) / sizeof(T)>(num_rows, reinterpret_cast<const T *>(source), dest); /// NOLINT(bugprone-sizeof-expression) fillFixedBatch<T, sizeof(Key) / sizeof(T)>(num_rows, reinterpret_cast<const T *>(source), dest); /// NOLINT(bugprone-sizeof-expression)
offset += sizeof(T); offset += sizeof(T);
} }

View File

@ -160,10 +160,7 @@ void AggregationMethodKeysFixed<TData, has_nullable_keys, has_low_cardinality,co
else else
{ {
size_t size = key_sizes[i]; size_t size = key_sizes[i];
size_t offset_to = pos; observed_column->insertData(reinterpret_cast<const char *>(&key) + pos, size);
if constexpr (std::endian::native == std::endian::big)
offset_to = sizeof(Key) - size - pos;
observed_column->insertData(reinterpret_cast<const char *>(&key) + offset_to, size);
pos += size; pos += size;
} }
} }