Skip to content

Conversation

@Cai-Yao
Copy link
Contributor

@Cai-Yao Cai-Yao commented Jan 9, 2023

Proposed changes

Issue Number: close #xxx

Problem summary

delete schema scanner::get_next_row,change to get_to_block

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


virtual Status start(RuntimeState* state);
virtual Status get_next_row(Tuple* tuple, MemPool* pool, bool* eos);
virtual Status get_next_block(vectorized::Block* block, bool* eos);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]

Suggested change
virtual Status get_next_block(vectorized::Block* block, bool* eos);
Status get_next_block(vectorized::Block* block, bool* eos) override;

if (!slot_desc->is_materialized()) {
continue;
if (mem_reuse) {
columns[i] = std::move(*block->get_by_position(i).column).mutate();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: std::move of the const expression has no effect; remove std::move() [performance-move-const-arg]

Suggested change
columns[i] = std::move(*block->get_by_position(i).column).mutate();
columns[i] = *block->get_by_position(i).column.mutate();

DCHECK(block->rows() == 0);
if (_schema_scanner->type() == TSchemaTableType::SCH_TABLES) {
do {
bool mem_reuse = block->mem_reuse();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use mem reuse here, just call block->clear() to clear all columns in block and then reinsert columns.

sizeof(_s_tbls_columns) / sizeof(SchemaScanner::ColumnDesc)),
_db_index(0),
_table_index(0) {}
_table_index(0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_table_index is useless

@hello-stephen
Copy link
Contributor

hello-stephen commented Jan 9, 2023

TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 35.13 seconds
load time: 504 seconds
storage size: 17122503506 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230129191323_clickbench_pr_86664.html

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

SchemaTablesScanner();
virtual ~SchemaTablesScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

virtual ~SchemaTablesScanner();

virtual Status start(RuntimeState* state);
virtual Status get_next_row(Tuple* tuple, MemPool* pool, bool* eos);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'get_next_row' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status get_next_row(Tuple* tuple, MemPool* pool, bool* eos);
                   ^

be/src/exec/schema_scanner.h:85: overridden virtual function is here

    virtual Status get_next_row(Tuple* tuple, MemPool* pool, bool* eos);
                   ^


Status SchemaTablesScanner::fill_one_row(vectorized::Block* block) {
const TTableStatus& tbl_status = _table_result.tables[_table_index];
Status SchemaTablesScanner::fill_block_imp(vectorized::Block* block) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fill_block_impl

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

public:
SchemaColumnsScanner();
virtual ~SchemaColumnsScanner();
virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

public:
SchemaDummyScanner();
virtual ~SchemaDummyScanner();
virtual Status start(RuntimeState* state = nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state = nullptr);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaFilesScanner();
virtual ~SchemaFilesScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaPartitionsScanner();
virtual ~SchemaPartitionsScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaSchemaPrivilegesScanner();
virtual ~SchemaSchemaPrivilegesScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaSchemataScanner();
virtual ~SchemaSchemataScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaTablePrivilegesScanner();
virtual ~SchemaTablePrivilegesScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaUserPrivilegesScanner();
virtual ~SchemaUserPrivilegesScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaVariablesScanner(TVarType::type type);
virtual ~SchemaVariablesScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

SchemaViewsScanner();
virtual ~SchemaViewsScanner();

virtual Status start(RuntimeState* state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'start' overrides a member function but is not marked 'override' [clang-diagnostic-inconsistent-missing-override]

    virtual Status start(RuntimeState* state);
                   ^

be/src/exec/schema_scanner.h:84: overridden virtual function is here

    virtual Status start(RuntimeState* state);
                   ^

}

RETURN_IF_ERROR(_schema_scanner->get_next_row(_src_tuple, _tuple_pool.get(), &scanner_eos));
// RETURN_IF_ERROR(_schema_scanner->get_next_row(_src_tuple, _tuple_pool.get(), &scanner_eos));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just remove the code

return Status::InternalError("input pointer is nullptr.");
}

*eos = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rowsets 这个表不一定可以一个block 一下子装进去的,可能有10000000个rowset

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

if (!block->has(slot_desc->col_name())) {
return Status::OK();
}
vectorized::IColumn* col_ptr = const_cast<vectorized::IColumn*>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里你不要直接使用裸指针, 尽量使用 ColumnPtr 这种类似智能指针的结构

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

return Status::OK();
}
vectorized::MutableColumnPtr column_ptr =
std::move(*block->get_by_name(slot_desc->col_name()).column).mutate();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: std::move of the const expression has no effect; remove std::move() [performance-move-const-arg]

Suggested change
std::move(*block->get_by_name(slot_desc->col_name()).column).mutate();
*block->get_by_name(slot_desc->col_name()).column.mutate();

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

return Status::OK();
}
vectorized::MutableColumnPtr column_ptr =
std::move(*block->get_by_name(slot_desc->col_name()).column).assume_mutable();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: std::move of the const expression has no effect; remove std::move() [performance-move-const-arg]

Suggested change
std::move(*block->get_by_name(slot_desc->col_name()).column).assume_mutable();
*block->get_by_name(slot_desc->col_name()).column.assume_mutable();

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

return Status::OK();
}
vectorized::MutableColumnPtr column_ptr =
std::move(*block->get_by_name(col_desc.name).column).assume_mutable();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: std::move of the const expression has no effect; remove std::move() [performance-move-const-arg]

Suggested change
std::move(*block->get_by_name(col_desc.name).column).assume_mutable();
*block->get_by_name(col_desc.name).column.assume_mutable();

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

_columns = nullptr;
}
}
SchemaScanner::~SchemaScanner() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use '= default' to define a trivial destructor [modernize-use-equals-default]

Suggested change
SchemaScanner::~SchemaScanner() {}
SchemaScanner::~SchemaScanner() = default;

delete[] reinterpret_cast<char*>(_dest_single_tuple);
_dest_single_tuple = nullptr;
}
VSchemaScanNode::~VSchemaScanNode() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use '= default' to define a trivial destructor [modernize-use-equals-default]

Suggested change
VSchemaScanNode::~VSchemaScanNode() {}
VSchemaScanNode::~VSchemaScanNode() = default;

Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yiguolei yiguolei merged commit 69e748b into apache:master Jan 30, 2023
dutyu pushed a commit to dutyu/doris that referenced this pull request Feb 1, 2023
dutyu pushed a commit to dutyu/doris that referenced this pull request Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants