[code style] remove some auto and lambda usage according to new coding style restriction
This commit is contained in:
@ -396,12 +396,7 @@ int ObIntegerBaseDiffDecoder::comparison_operator(
|
||||
result_bitmap.reuse();
|
||||
}
|
||||
} else {
|
||||
auto uint_diff_cmp = [&] (const uint64_t &l, const uint64_t &r) -> int
|
||||
{
|
||||
return l == r
|
||||
? 0
|
||||
: (l < r ? -1 : 1);
|
||||
};
|
||||
#define UINT_DIFF_CMP(l, r) ( l == r ? 0 : (l < r ? -1 : 1) )
|
||||
uint8_t cell_len = header_->length_;
|
||||
int64_t data_offset = 0;
|
||||
bool null_value_contained = result_bitmap.popcnt() > 0;
|
||||
@ -439,7 +434,7 @@ int ObIntegerBaseDiffDecoder::comparison_operator(
|
||||
col_data, data_offset + row_id * cell_len, cell_len, delta_value))) {
|
||||
LOG_WARN("Failed to get bit packing value", K(ret), K_(header));
|
||||
} else {
|
||||
if (get_cmp_ret(uint_diff_cmp(delta_value, param_delta_value))) {
|
||||
if (get_cmp_ret(UINT_DIFF_CMP(delta_value, param_delta_value))) {
|
||||
if (OB_FAIL(result_bitmap.set(offset))) {
|
||||
LOG_WARN("Failed to set result bitmap",
|
||||
K(ret), K(offset), K(filter));
|
||||
@ -460,7 +455,7 @@ int ObIntegerBaseDiffDecoder::comparison_operator(
|
||||
}
|
||||
} else {
|
||||
MEMCPY(&delta_value, col_data + data_offset + row_id * cell_len, cell_len);
|
||||
if (get_cmp_ret(uint_diff_cmp(delta_value, param_delta_value))) {
|
||||
if (get_cmp_ret(UINT_DIFF_CMP(delta_value, param_delta_value))) {
|
||||
if (OB_FAIL(result_bitmap.set(offset))) {
|
||||
LOG_WARN("Failed to set result bitmap",
|
||||
K(ret), K(offset), K(filter));
|
||||
@ -469,6 +464,7 @@ int ObIntegerBaseDiffDecoder::comparison_operator(
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef UINT_DIFF_CMP
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@ -756,18 +756,7 @@ int ObRawDecoder::comparison_operator(
|
||||
} else {
|
||||
ObDatumCmpFuncType type_cmp_func = filter.cmp_func_;
|
||||
ObGetFilterCmpRetFunc get_cmp_ret = get_filter_cmp_ret_func(filter.get_op_type());
|
||||
auto eval = [&]
|
||||
(const ObObjMeta &obj_meta, const ObDatum &cur_datum, const sql::ObWhiteFilterExecutor &filter, bool &result)
|
||||
{
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
int cmp_res = 0;
|
||||
if (OB_TMP_FAIL(type_cmp_func(cur_datum, filter.get_datums().at(0), cmp_res))) {
|
||||
LOG_WARN("Failed to compare datum", K(tmp_ret), K(cur_datum), K(filter.get_datums().at(0)));
|
||||
} else {
|
||||
result = get_cmp_ret(cmp_res);
|
||||
}
|
||||
return tmp_ret;
|
||||
};
|
||||
ObRawDecoderFilterCmpFunc eval(type_cmp_func, get_cmp_ret);
|
||||
|
||||
if (OB_FAIL(traverse_all_data(parent, col_ctx, row_index, filter, pd_filter_info, result_bitmap, eval))) {
|
||||
LOG_WARN("Failed to traverse all data and evaluate operator", K(ret));
|
||||
@ -942,23 +931,7 @@ int ObRawDecoder::bt_operator(
|
||||
K(ret), K(pd_filter_info), K(result_bitmap.size()), K(filter));
|
||||
} else {
|
||||
ObDatumCmpFuncType type_cmp_func = filter.cmp_func_;
|
||||
ObGetFilterCmpRetFunc get_le_cmp_ret = get_filter_cmp_ret_func(sql::WHITE_OP_LE);
|
||||
ObGetFilterCmpRetFunc get_ge_cmp_ret = get_filter_cmp_ret_func(sql::WHITE_OP_GE);
|
||||
auto eval = [&]
|
||||
(const ObObjMeta &obj_meta, const ObDatum &cur_datum, const sql::ObWhiteFilterExecutor &filter, bool &result)
|
||||
{
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
int left_cmp_res = 0;
|
||||
int right_cmp_res = 0;
|
||||
if (OB_TMP_FAIL(type_cmp_func(cur_datum, filter.get_datums().at(0), left_cmp_res))) {
|
||||
LOG_WARN("Failed to compare datum", K(tmp_ret), K(cur_datum), K(filter.get_datums().at(0)));
|
||||
} else if (OB_TMP_FAIL(type_cmp_func(cur_datum, filter.get_datums().at(1), right_cmp_res))) {
|
||||
LOG_WARN("Failed to compare datum", K(tmp_ret), K(cur_datum), K(filter.get_datums().at(1)));
|
||||
} else {
|
||||
result = get_ge_cmp_ret(left_cmp_res) && get_le_cmp_ret(right_cmp_res);
|
||||
}
|
||||
return tmp_ret;
|
||||
};
|
||||
ObRawDecoderFilterBetweenFunc eval(type_cmp_func);
|
||||
if (OB_FAIL(traverse_all_data(parent, col_ctx, row_index, filter, pd_filter_info, result_bitmap, eval))) {
|
||||
LOG_WARN("Failed to traverse all data in micro block", K(ret));
|
||||
}
|
||||
@ -983,18 +956,7 @@ int ObRawDecoder::in_operator(
|
||||
LOG_WARN("Pushdown in operator: Invalid arguments",
|
||||
K(ret), K(pd_filter_info), K(result_bitmap.size()), K(filter));
|
||||
} else {
|
||||
auto eval = [&]
|
||||
(const ObObjMeta &obj_meta, const ObDatum &cur_datum, const sql::ObWhiteFilterExecutor &filter, bool &result)
|
||||
{
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
ObObj cur_obj;
|
||||
if (OB_TMP_FAIL(cur_datum.to_obj(cur_obj, obj_meta))) {
|
||||
LOG_WARN("convert datum to obj failed", K(tmp_ret), K(cur_datum), K(obj_meta));
|
||||
} else if (OB_TMP_FAIL(filter.exist_in_obj_set(cur_obj, result))) {
|
||||
LOG_WARN("Failed to check obj in hashset", K(tmp_ret), K(cur_obj));
|
||||
}
|
||||
return tmp_ret;
|
||||
};
|
||||
ObRawDecoderFilterInFunc eval;
|
||||
if (OB_FAIL(traverse_all_data(parent, col_ctx, row_index, filter, pd_filter_info, result_bitmap, eval))) {
|
||||
LOG_WARN("Failed to traverse all data in micro block", K(ret));
|
||||
}
|
||||
@ -1121,6 +1083,57 @@ int ObRawDecoder::traverse_all_data(
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRawDecoder::ObRawDecoderFilterCmpFunc::operator()(
|
||||
const ObObjMeta &obj_meta,
|
||||
const ObDatum &cur_datum,
|
||||
const sql::ObWhiteFilterExecutor &filter,
|
||||
bool &result) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int cmp_res = 0;
|
||||
if (OB_FAIL(type_cmp_func_(cur_datum, filter.get_datums().at(0), cmp_res))) {
|
||||
LOG_WARN("Failed to compare datum", K(ret), K(cur_datum), K(filter.get_datums().at(0)));
|
||||
} else {
|
||||
result = get_cmp_ret_(cmp_res);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRawDecoder::ObRawDecoderFilterBetweenFunc::operator()(
|
||||
const ObObjMeta &obj_meta,
|
||||
const ObDatum &cur_datum,
|
||||
const sql::ObWhiteFilterExecutor &filter,
|
||||
bool &result) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int left_cmp_res = 0;
|
||||
int right_cmp_res = 0;
|
||||
if (OB_FAIL(type_cmp_func_(cur_datum, filter.get_datums().at(0), left_cmp_res))) {
|
||||
LOG_WARN("Failed to compare datum", K(ret), K(cur_datum), K(filter.get_datums().at(0)));
|
||||
} else if (OB_FAIL(type_cmp_func_(cur_datum, filter.get_datums().at(1), right_cmp_res))) {
|
||||
LOG_WARN("Failed to compare datum", K(ret), K(cur_datum), K(filter.get_datums().at(1)));
|
||||
} else {
|
||||
result = get_ge_cmp_ret_(left_cmp_res) && get_le_cmp_ret_(right_cmp_res);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRawDecoder::ObRawDecoderFilterInFunc::operator()(
|
||||
const ObObjMeta &obj_meta,
|
||||
const ObDatum &cur_datum,
|
||||
const sql::ObWhiteFilterExecutor &filter,
|
||||
bool &result) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObObj cur_obj;
|
||||
if (OB_FAIL(cur_datum.to_obj(cur_obj, obj_meta))) {
|
||||
LOG_WARN("convert datum to obj failed", K(ret), K(cur_datum), K(obj_meta));
|
||||
} else if (OB_FAIL(filter.exist_in_obj_set(cur_obj, result))) {
|
||||
LOG_WARN("Failed to check obj in hashset", K(ret), K(cur_obj));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <typename DataType>
|
||||
struct RawEqualsOp
|
||||
{
|
||||
|
||||
@ -236,6 +236,54 @@ private:
|
||||
const sql::PushdownFilterInfo &pd_filter_info,
|
||||
ObBitmap &result_bitmap,
|
||||
Operator const &eval) const;
|
||||
private:
|
||||
class ObRawDecoderFilterCmpFunc
|
||||
{
|
||||
public:
|
||||
ObRawDecoderFilterCmpFunc(
|
||||
const ObDatumCmpFuncType &type_cmp_func,
|
||||
const ObGetFilterCmpRetFunc &get_cmp_ret)
|
||||
: type_cmp_func_(type_cmp_func), get_cmp_ret_(get_cmp_ret) {}
|
||||
~ObRawDecoderFilterCmpFunc() = default;
|
||||
int operator()(
|
||||
const ObObjMeta &obj_meta,
|
||||
const ObDatum &cur_datum,
|
||||
const sql::ObWhiteFilterExecutor &filter,
|
||||
bool &result) const;
|
||||
private:
|
||||
const ObDatumCmpFuncType &type_cmp_func_;
|
||||
const ObGetFilterCmpRetFunc &get_cmp_ret_;
|
||||
};
|
||||
class ObRawDecoderFilterBetweenFunc
|
||||
{
|
||||
public:
|
||||
ObRawDecoderFilterBetweenFunc(const ObDatumCmpFuncType &type_cmp_func) : type_cmp_func_(type_cmp_func)
|
||||
{
|
||||
get_le_cmp_ret_ = get_filter_cmp_ret_func(sql::WHITE_OP_LE);
|
||||
get_ge_cmp_ret_ = get_filter_cmp_ret_func(sql::WHITE_OP_GE);
|
||||
}
|
||||
~ObRawDecoderFilterBetweenFunc() = default;
|
||||
int operator()(
|
||||
const ObObjMeta &obj_meta,
|
||||
const ObDatum &cur_datum,
|
||||
const sql::ObWhiteFilterExecutor &filter,
|
||||
bool &result) const;
|
||||
private:
|
||||
const ObDatumCmpFuncType &type_cmp_func_;
|
||||
ObGetFilterCmpRetFunc get_le_cmp_ret_;
|
||||
ObGetFilterCmpRetFunc get_ge_cmp_ret_;
|
||||
};
|
||||
class ObRawDecoderFilterInFunc
|
||||
{
|
||||
public:
|
||||
ObRawDecoderFilterInFunc() {}
|
||||
~ObRawDecoderFilterInFunc() = default;
|
||||
int operator()(
|
||||
const ObObjMeta &obj_meta,
|
||||
const ObDatum &cur_datum,
|
||||
const sql::ObWhiteFilterExecutor &filter,
|
||||
bool &result) const;
|
||||
};
|
||||
|
||||
private:
|
||||
ObObjTypeStoreClass store_class_;
|
||||
|
||||
@ -536,7 +536,7 @@ void ObSSTablePrinter::print_store_row(
|
||||
ObMemAttr mem_attr;
|
||||
mem_attr.label_ = "TX_DATA_TABLE";
|
||||
void *p = op_alloc(ObSliceAlloc);
|
||||
auto slice_allocator = new (p) ObSliceAlloc(storage::TX_DATA_SLICE_SIZE, mem_attr);
|
||||
common::ObSliceAlloc *slice_allocator = new (p) ObSliceAlloc(storage::TX_DATA_SLICE_SIZE, mem_attr);
|
||||
|
||||
ObTxData tx_data;
|
||||
tx_data.tx_id_ = tx_id;
|
||||
|
||||
Reference in New Issue
Block a user