reformat source code
according to code styles, 'AccessModifierOffset' should be -2.
This commit is contained in:
@ -27,9 +27,9 @@ class ObExecContext;
|
||||
class ObFakeCTETable : public ObNoChildrenPhyOperator {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
class ObFakeCTETableOperatorCtx : public ObPhyOperatorCtx {
|
||||
public:
|
||||
public:
|
||||
explicit ObFakeCTETableOperatorCtx(ObExecContext& ctx)
|
||||
: ObPhyOperatorCtx(ctx), empty_(false), pump_row_(nullptr), alloc_(ctx.get_allocator())
|
||||
{}
|
||||
@ -45,14 +45,14 @@ class ObFakeCTETable : public ObNoChildrenPhyOperator {
|
||||
int add_row(common::ObNewRow*& row);
|
||||
void reuse();
|
||||
|
||||
public:
|
||||
public:
|
||||
bool empty_;
|
||||
common::ObNewRow* pump_row_;
|
||||
common::ObSEArray<int64_t, 64> column_involved_offset_;
|
||||
ObIAllocator& alloc_;
|
||||
};
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObFakeCTETable(common::ObIAllocator& alloc) : ObNoChildrenPhyOperator(alloc), column_involved_offset_(alloc)
|
||||
{}
|
||||
virtual ~ObFakeCTETable()
|
||||
|
||||
@ -27,7 +27,7 @@ class ObExecContext;
|
||||
class ObFakeCTETableSpec : public ObOpSpec {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObFakeCTETableSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type)
|
||||
: ObOpSpec(alloc, type), column_involved_offset_(alloc), column_involved_exprs_(alloc)
|
||||
{}
|
||||
@ -40,7 +40,7 @@ class ObFakeCTETableSpec : public ObOpSpec {
|
||||
};
|
||||
|
||||
class ObFakeCTETableOp : public ObOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObFakeCTETableOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input)
|
||||
: ObOperator(exec_ctx, spec, input), empty_(false), pump_row_(nullptr), allocator_(exec_ctx.get_allocator())
|
||||
{}
|
||||
@ -70,7 +70,7 @@ class ObFakeCTETableOp : public ObOperator {
|
||||
const common::ObIArray<int64_t>& chosen_index, int64_t extra_size, common::ObIAllocator& allocator);
|
||||
const static int64_t ROW_EXTRA_SIZE = 0;
|
||||
|
||||
private:
|
||||
private:
|
||||
bool empty_;
|
||||
const ObChunkDatumStore::StoredRow* pump_row_;
|
||||
ObIAllocator& allocator_;
|
||||
|
||||
@ -31,12 +31,12 @@ class ObRecursiveInnerData {
|
||||
friend class ObRecursiveUnionAllOperatorCtx;
|
||||
friend class ObRecursiveUnionAll;
|
||||
|
||||
public:
|
||||
public:
|
||||
struct RowComparer;
|
||||
enum RecursiveUnionState { R_UNION_BEGIN, R_UNION_READ_LEFT, R_UNION_READ_RIGHT, R_UNION_END, R_UNION_STATE_COUNT };
|
||||
enum SearchStrategyType { DEPTH_FRIST, BREADTH_FRIST };
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObRecursiveInnerData(common::ObIAllocator& alloc)
|
||||
: state_(RecursiveUnionState::R_UNION_READ_LEFT),
|
||||
stored_row_buf_(ObModIds::OB_SQL_CTE_ROW),
|
||||
@ -89,7 +89,7 @@ class ObRecursiveInnerData {
|
||||
calc_buf_ = calc_buf;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
void destroy();
|
||||
int add_pseudo_column(const ObNewRow* row, bool cycle = false);
|
||||
int try_get_left_rows(ObExecContext& exec_ctx, const ObNewRow*& row);
|
||||
@ -110,7 +110,7 @@ class ObRecursiveInnerData {
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObRecursiveInnerData);
|
||||
|
||||
private:
|
||||
private:
|
||||
RecursiveUnionState state_;
|
||||
common::ObArenaAllocator stored_row_buf_;
|
||||
const ObFakeCTETable* pump_operator_;
|
||||
|
||||
@ -30,12 +30,12 @@ class ObRecursiveInnerDataOp {
|
||||
friend class ObRecursiveUnionAllOp;
|
||||
friend class ObRecursiveUnionAllSpec;
|
||||
|
||||
public:
|
||||
public:
|
||||
struct RowComparer;
|
||||
enum RecursiveUnionState { R_UNION_BEGIN, R_UNION_READ_LEFT, R_UNION_READ_RIGHT, R_UNION_END, R_UNION_STATE_COUNT };
|
||||
enum SearchStrategyType { DEPTH_FRIST, BREADTH_FRIST };
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObRecursiveInnerDataOp(ObEvalCtx& eval_ctx, ObExecContext& exec_ctx, const ExprFixedArray& left_output,
|
||||
const common::ObIArray<ObSortFieldCollation>& sort_collations,
|
||||
const common::ObIArray<uint64_t>& cycle_by_col_lists, const common::ObIArray<ObExpr*>& output_union_exprs)
|
||||
@ -89,7 +89,7 @@ class ObRecursiveInnerDataOp {
|
||||
cte_columns_ = exprs;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
void destroy();
|
||||
int add_pseudo_column(bool cycle = false);
|
||||
int try_get_left_rows();
|
||||
@ -115,7 +115,7 @@ class ObRecursiveInnerDataOp {
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObRecursiveInnerDataOp);
|
||||
|
||||
private:
|
||||
private:
|
||||
RecursiveUnionState state_;
|
||||
common::ObArenaAllocator stored_row_buf_;
|
||||
ObFakeCTETableOp* pump_operator_;
|
||||
|
||||
@ -28,9 +28,9 @@ namespace sql {
|
||||
class ObRecursiveUnionAll : public ObMergeSetOperator {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
class ObRecursiveUnionAllOperatorCtx : public ObPhyOperatorCtx {
|
||||
public:
|
||||
public:
|
||||
explicit ObRecursiveUnionAllOperatorCtx(ObExecContext& ctx)
|
||||
: ObPhyOperatorCtx(ctx), inner_data_(ctx.get_allocator())
|
||||
{}
|
||||
@ -52,12 +52,12 @@ class ObRecursiveUnionAll : public ObMergeSetOperator {
|
||||
int init();
|
||||
int ctx_close();
|
||||
|
||||
public:
|
||||
public:
|
||||
common::ObExprCtx expr_ctx_;
|
||||
ObRecursiveInnerData inner_data_;
|
||||
};
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObRecursiveUnionAll(common::ObIAllocator& alloc);
|
||||
~ObRecursiveUnionAll();
|
||||
virtual void reset();
|
||||
@ -74,7 +74,7 @@ class ObRecursiveUnionAll : public ObMergeSetOperator {
|
||||
};
|
||||
int set_cycle_pseudo_values(ObSqlExpression& v, ObSqlExpression& d_v);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/**
|
||||
* @brief for specified phy operator to print it's member variable with json key-value format
|
||||
* @param buf[in] to string buffer
|
||||
@ -116,11 +116,11 @@ class ObRecursiveUnionAll : public ObMergeSetOperator {
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObRecursiveUnionAll);
|
||||
|
||||
public:
|
||||
public:
|
||||
common::ObFixedArray<ObSortColumn, common::ObIAllocator> search_by_col_lists_;
|
||||
common::ObFixedArray<common::ObColumnInfo, common::ObIAllocator> cycle_by_col_lists_;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
static const int32_t CMP_DIRECTION_ASC = 1;
|
||||
static const int32_t CMP_DIRECTION_DESC = -1;
|
||||
const ObFakeCTETable* pump_operator_;
|
||||
|
||||
@ -26,7 +26,7 @@ namespace sql {
|
||||
class ObRecursiveUnionAllSpec : public ObOpSpec {
|
||||
OB_UNIS_VERSION_V(1);
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObRecursiveUnionAllSpec(common::ObIAllocator& alloc, const ObPhyOperatorType type);
|
||||
~ObRecursiveUnionAllSpec();
|
||||
friend class ObRecursiveUnionAllOp;
|
||||
@ -49,7 +49,7 @@ class ObRecursiveUnionAllSpec : public ObOpSpec {
|
||||
int set_cycle_pseudo_values(ObExpr* v, ObExpr* d_v);
|
||||
static const int64_t UNUSED_POS;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/**
|
||||
* @brief for specified phy operator to print it's member variable with json key-value format
|
||||
* @param buf[in] to string buffer
|
||||
@ -60,14 +60,14 @@ class ObRecursiveUnionAllSpec : public ObOpSpec {
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObRecursiveUnionAllSpec);
|
||||
|
||||
public:
|
||||
public:
|
||||
common::ObFixedArray<ObSortFieldCollation, common::ObIAllocator> sort_collations_;
|
||||
common::ObFixedArray<uint64_t, common::ObIAllocator> cycle_by_col_lists_;
|
||||
// T_OP_UNION expression in the output of recursive uion all operator.
|
||||
// copy datums of inner_data rows to datums of these exprs.
|
||||
common::ObFixedArray<ObExpr*, common::ObIAllocator> output_union_exprs_;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
static const int32_t CMP_DIRECTION_ASC = 1;
|
||||
static const int32_t CMP_DIRECTION_DESC = -1;
|
||||
uint64_t pump_operator_id_;
|
||||
@ -79,7 +79,7 @@ class ObRecursiveUnionAllSpec : public ObOpSpec {
|
||||
};
|
||||
|
||||
class ObRecursiveUnionAllOp : public ObOperator {
|
||||
public:
|
||||
public:
|
||||
explicit ObRecursiveUnionAllOp(ObExecContext& exec_ctx, const ObOpSpec& spec, ObOpInput* input)
|
||||
: ObOperator(exec_ctx, spec, input),
|
||||
inner_data_(*exec_ctx.get_eval_ctx(), exec_ctx, // spec.output_,
|
||||
@ -106,7 +106,7 @@ class ObRecursiveUnionAllOp : public ObOperator {
|
||||
return static_cast<const ObRecursiveUnionAllSpec&>(spec_);
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
ObRecursiveInnerDataOp inner_data_;
|
||||
};
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObSearchMethod {
|
||||
public:
|
||||
public:
|
||||
typedef struct _BreadthFirstSearchTreeNode {
|
||||
_BreadthFirstSearchTreeNode() : child_num_(0), row_(nullptr), children_(nullptr), parent_(nullptr)
|
||||
{}
|
||||
@ -70,7 +70,7 @@ class ObSearchMethod {
|
||||
return bret;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
const common::ObIArray<ObSortColumn>& sort_columns_;
|
||||
int* err_;
|
||||
};
|
||||
@ -78,7 +78,7 @@ class ObSearchMethod {
|
||||
// initial size of hash table for loop search
|
||||
static const int64_t CTE_SET_NUM = 1 << 5l;
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObSearchMethod(common::ObIAllocator& allocator)
|
||||
: allocator_(allocator), input_rows_(), sort_columns_(), cycle_by_columns_(), sort_(), op_schema_objs_(nullptr){};
|
||||
virtual ~ObSearchMethod() = default;
|
||||
@ -105,7 +105,7 @@ class ObSearchMethod {
|
||||
return input_rows_.count();
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
common::ObIAllocator& allocator_;
|
||||
common::ObArray<common::ObNewRow*> input_rows_;
|
||||
common::ObSEArray<ObSortColumn, 32> sort_columns_;
|
||||
@ -118,7 +118,7 @@ class ObSearchMethod {
|
||||
class ObDepthFisrtSearch : public ObSearchMethod {
|
||||
typedef common::hash::ObHashSet<ObHashCols, common::hash::NoPthreadDefendMode> RowMap;
|
||||
|
||||
public:
|
||||
public:
|
||||
ObDepthFisrtSearch(common::ObIAllocator& allocator)
|
||||
: ObSearchMethod(allocator),
|
||||
hash_filter_rows_(),
|
||||
@ -150,10 +150,10 @@ class ObDepthFisrtSearch : public ObSearchMethod {
|
||||
int get_next_non_cycle_node(
|
||||
common::ObList<ObTreeNode, common::ObIAllocator>& result_output, ObTreeNode& node) override;
|
||||
|
||||
private:
|
||||
private:
|
||||
int is_depth_cycle_node(ObTreeNode& node);
|
||||
|
||||
private:
|
||||
private:
|
||||
RowMap hash_filter_rows_;
|
||||
common::ObSEArray<common::ObColumnInfo, 32> hash_col_idx_;
|
||||
// record level of current row in the tree.
|
||||
@ -163,7 +163,7 @@ class ObDepthFisrtSearch : public ObSearchMethod {
|
||||
};
|
||||
|
||||
class ObBreadthFisrtSearch : public ObSearchMethod {
|
||||
public:
|
||||
public:
|
||||
ObBreadthFisrtSearch(common::ObIAllocator& allocator)
|
||||
: ObSearchMethod(allocator),
|
||||
bst_root_(),
|
||||
@ -185,12 +185,12 @@ class ObBreadthFisrtSearch : public ObSearchMethod {
|
||||
common::ObList<ObTreeNode, common::ObIAllocator>& result_output, ObTreeNode& node) override;
|
||||
int update_parent_node(ObTreeNode& node);
|
||||
|
||||
private:
|
||||
private:
|
||||
int init_new_nodes(ObBFSTreeNode* last_bstnode, int64_t child_num);
|
||||
int is_breadth_cycle_node(ObTreeNode& node);
|
||||
int add_new_level();
|
||||
|
||||
private:
|
||||
private:
|
||||
ObBFSTreeNode bst_root_;
|
||||
/**
|
||||
* A
|
||||
|
||||
@ -24,7 +24,7 @@ namespace oceanbase {
|
||||
namespace sql {
|
||||
|
||||
class ObSearchMethodOp {
|
||||
public:
|
||||
public:
|
||||
typedef struct _BreadthFirstSearchTreeNode {
|
||||
_BreadthFirstSearchTreeNode() : child_num_(0), stored_row_(nullptr), children_(nullptr), parent_(nullptr)
|
||||
{}
|
||||
@ -97,14 +97,14 @@ class ObSearchMethodOp {
|
||||
return bret;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
const common::ObIArray<ObSortFieldCollation>& sort_collations_;
|
||||
const common::ObIArray<ObExpr*>& exprs_;
|
||||
int* err_;
|
||||
};
|
||||
|
||||
class ObCycleHash {
|
||||
public:
|
||||
public:
|
||||
ObCycleHash() : row_(NULL), hash_col_idx_(NULL), exprs_(NULL), hash_val_(0)
|
||||
{}
|
||||
ObCycleHash(const ObChunkDatumStore::StoredRow* row, const common::ObIArray<uint64_t>* hash_col_idx,
|
||||
@ -125,7 +125,7 @@ class ObSearchMethodOp {
|
||||
uint64_t inner_hash() const;
|
||||
bool operator==(const ObCycleHash& other) const;
|
||||
|
||||
public:
|
||||
public:
|
||||
const ObChunkDatumStore::StoredRow* row_;
|
||||
const common::ObIArray<uint64_t>* hash_col_idx_;
|
||||
const common::ObIArray<ObExpr*>* exprs_;
|
||||
@ -136,7 +136,7 @@ class ObSearchMethodOp {
|
||||
// initial size of hash table for loop search
|
||||
static const int64_t CTE_SET_NUM = 1 << 5l;
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit ObSearchMethodOp(common::ObIAllocator& allocator, const ExprFixedArray& left_output,
|
||||
const common::ObIArray<ObSortFieldCollation>& sort_collations, const common::ObIArray<uint64_t>& cycle_by_columns)
|
||||
: allocator_(allocator),
|
||||
@ -163,7 +163,7 @@ class ObSearchMethodOp {
|
||||
}
|
||||
const static int64_t ROW_EXTRA_SIZE = 0;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// hard code seed, 24bit max prime number
|
||||
static const int64_t HASH_SEED = 16777213;
|
||||
common::ObIAllocator& allocator_;
|
||||
@ -177,7 +177,7 @@ class ObSearchMethodOp {
|
||||
class ObDepthFisrtSearchOp : public ObSearchMethodOp {
|
||||
typedef common::hash::ObHashSet<ObCycleHash, common::hash::NoPthreadDefendMode> RowMap;
|
||||
|
||||
public:
|
||||
public:
|
||||
ObDepthFisrtSearchOp(common::ObIAllocator& allocator, const ExprFixedArray& left_output,
|
||||
const common::ObIArray<ObSortFieldCollation>& sort_collations, const common::ObIArray<uint64_t>& cycle_by_columns)
|
||||
: ObSearchMethodOp(allocator, left_output, sort_collations, cycle_by_columns),
|
||||
@ -206,10 +206,10 @@ class ObDepthFisrtSearchOp : public ObSearchMethodOp {
|
||||
int get_next_non_cycle_node(
|
||||
common::ObList<ObTreeNode, common::ObIAllocator>& result_output, ObTreeNode& node) override;
|
||||
|
||||
private:
|
||||
private:
|
||||
int is_depth_cycle_node(ObTreeNode& node);
|
||||
|
||||
private:
|
||||
private:
|
||||
RowMap hash_filter_rows_;
|
||||
common::ObSEArray<uint64_t, 32> hash_col_idx_;
|
||||
// record level of current row in the tree.
|
||||
@ -219,7 +219,7 @@ class ObDepthFisrtSearchOp : public ObSearchMethodOp {
|
||||
};
|
||||
|
||||
class ObBreadthFisrtSearchOp : public ObSearchMethodOp {
|
||||
public:
|
||||
public:
|
||||
ObBreadthFisrtSearchOp(common::ObIAllocator& allocator, const ExprFixedArray& left_output,
|
||||
const common::ObIArray<ObSortFieldCollation>& sort_collations, const common::ObIArray<uint64_t>& cycle_by_columns)
|
||||
: ObSearchMethodOp(allocator, left_output, sort_collations, cycle_by_columns),
|
||||
@ -242,12 +242,12 @@ class ObBreadthFisrtSearchOp : public ObSearchMethodOp {
|
||||
common::ObList<ObTreeNode, common::ObIAllocator>& result_output, ObTreeNode& node) override;
|
||||
int update_parent_node(ObTreeNode& node);
|
||||
|
||||
private:
|
||||
private:
|
||||
int init_new_nodes(ObBFSTreeNode* last_bstnode, int64_t child_num);
|
||||
int is_breadth_cycle_node(ObTreeNode& node);
|
||||
int add_new_level();
|
||||
|
||||
private:
|
||||
private:
|
||||
ObBFSTreeNode bst_root_;
|
||||
/**
|
||||
* A
|
||||
|
||||
Reference in New Issue
Block a user