This commit is contained in:
chertus 2019-11-12 01:47:52 +03:00
parent a8a283ffdc
commit 4411edeadd
2 changed files with 9 additions and 2 deletions

View File

@ -51,7 +51,6 @@ struct ArrayCumSumImpl
using ColVecResult = std::conditional_t<IsDecimalNumber<Result>, ColumnDecimal<Result>, ColumnVector<Result>>;
const ColVecType * column = checkAndGetColumn<ColVecType>(&*mapped);
const typename ColVecType::Container & data = column->getData();
if (!column)
{
@ -65,7 +64,10 @@ struct ArrayCumSumImpl
typename ColVecResult::MutablePtr res_nested;
if constexpr (IsDecimalNumber<Element>)
{
const typename ColVecType::Container & data = column->getData();
res_nested = ColVecResult::create(0, data.getScale());
}
else
res_nested = ColVecResult::create();
@ -90,6 +92,7 @@ struct ArrayCumSumImpl
return true;
}
const typename ColVecType::Container & data = column->getData();
const IColumn::Offsets & offsets = array.getOffsets();
typename ColVecResult::MutablePtr res_nested;

View File

@ -49,7 +49,6 @@ struct ArraySumImpl
using ColVecResult = std::conditional_t<IsDecimalNumber<Result>, ColumnDecimal<Result>, ColumnVector<Result>>;
const ColVecType * column = checkAndGetColumn<ColVecType>(&*mapped);
const typename ColVecType::Container & data = column->getData();
if (!column)
{
@ -62,7 +61,10 @@ struct ArraySumImpl
typename ColVecResult::MutablePtr res_column;
if constexpr (IsDecimalNumber<Element>)
{
const typename ColVecType::Container & data = column->getData();
res_column = ColVecResult::create(offsets.size(), data.getScale());
}
else
res_column = ColVecResult::create(offsets.size());
@ -79,6 +81,8 @@ struct ArraySumImpl
return true;
}
const typename ColVecType::Container & data = column->getData();
typename ColVecResult::MutablePtr res_column;
if constexpr (IsDecimalNumber<Element>)
res_column = ColVecResult::create(offsets.size(), data.getScale());