Skip to content

Commit

Permalink
[Refactor] Fixes some be typo part 2 (apache#4747)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzhg authored Oct 20, 2020
1 parent 34d5ab8 commit 09f97f8
Show file tree
Hide file tree
Showing 224 changed files with 744 additions and 745 deletions.
4 changes: 2 additions & 2 deletions be/src/common/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ static void init_doris_metrics(const std::vector<StorePath>& store_paths) {
if (init_system_metrics) {
auto st = DiskInfo::get_disk_devices(paths, &disk_devices);
if (!st.ok()) {
LOG(WARNING) << "get disk devices failed, stauts=" << st.get_error_msg();
LOG(WARNING) << "get disk devices failed, status=" << st.get_error_msg();
return;
}
st = get_inet_interfaces(&network_interfaces);
if (!st.ok()) {
LOG(WARNING) << "get inet interfaces failed, stauts=" << st.get_error_msg();
LOG(WARNING) << "get inet interfaces failed, status=" << st.get_error_msg();
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion be/src/env/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Env {
//
// The function call extra cost is acceptable. Compared with returning all children
// into a given vector, the performance of this method is 5% worse. However this
// approach is more flexiable and efficient in fulfilling other requirements.
// approach is more flexible and efficient in fulfilling other requirements.
//
// Returns OK if "dir" exists.
// NotFound if "dir" does not exist, the calling process does not have
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/broker_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Status BrokerWriter::write(const uint8_t* buf, size_t buf_len, size_t* written_l
return status;
}

// we do not re-try simplely, because broker server may already write data
// we do not re-try simply, because broker server may already write data
try {
client->pwrite(response, request);
} catch (apache::thrift::transport::TTransportException& e) {
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/decompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Status GzipDecompressor::decompress(
ret = inflateReset(&_z_strm);
if (ret != Z_OK) {
std::stringstream ss;
ss << "Failed to inflateRset. return code: " << ret;
ss << "Failed to inflateReset. return code: " << ret;
return Status::InternalError(ss.str());
}
} else if (ret != Z_OK) {
Expand Down
12 changes: 6 additions & 6 deletions be/src/exec/es/es_predicate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) {
// process binary predicate
if (TExprNodeType::BINARY_PRED == conjunct->node_type()) {
if (conjunct->children().size() != 2) {
return Status::InternalError("build disjuncts failed: number of childs is not 2");
return Status::InternalError("build disjuncts failed: number of children is not 2");
}
SlotRef* slot_ref = nullptr;
TExprOpcode::type op;
Expand All @@ -238,7 +238,7 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) {
// doris on es should ignore this doris native cast transformation, we push down this `cast` to elasticsearch
// conjunct->get_child(0)->node_type() return CAST_EXPR
// conjunct->get_child(1)->node_type()return FLOAT_LITERAL
// the left child is literal and right child is SlotRef maybe not happend, but here we just process
// the left child is literal and right child is SlotRef maybe not happened, but here we just process
// this situation regardless of the rewrite logic from the FE's Query Engine
if (TExprNodeType::SLOT_REF == conjunct->get_child(0)->node_type()
|| TExprNodeType::CAST_EXPR == conjunct->get_child(0)->node_type()) {
Expand Down Expand Up @@ -288,7 +288,7 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) {
std::string fname = conjunct->fn().name.function_name;
if (fname == "esquery") {
if (conjunct->children().size() != 2) {
return Status::InternalError("build disjuncts failed: number of childs is not 2");
return Status::InternalError("build disjuncts failed: number of children is not 2");
}
Expr* expr = conjunct->get_child(1);
ExtLiteral literal(expr->type().type, _context->get_value(expr, NULL));
Expand All @@ -310,7 +310,7 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) {
_disjuncts.push_back(predicate);
} else if (fname == "is_null_pred" || fname == "is_not_null_pred") {
if (conjunct->children().size() != 1) {
return Status::InternalError("build disjuncts failed: number of childs is not 1");
return Status::InternalError("build disjuncts failed: number of children is not 1");
}
// such as sub-query: select * from (select split_part(k, "_", 1) as new_field from table) t where t.new_field > 1;
// conjunct->get_child(0)->node_type() == TExprNodeType::FUNCTION_CALL, at present doris on es can not support push down function
Expand All @@ -330,7 +330,7 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) {
_disjuncts.push_back(predicate);
} else if (fname == "like") {
if (conjunct->children().size() != 2) {
return Status::InternalError("build disjuncts failed: number of childs is not 2");
return Status::InternalError("build disjuncts failed: number of children is not 2");
}
SlotRef* slot_ref = nullptr;
Expr* expr = nullptr;
Expand Down Expand Up @@ -426,7 +426,7 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) {
return Status::OK();
}
if (TExprNodeType::COMPOUND_PRED == conjunct->node_type()) {
// processe COMPOUND_AND, such as:
// process COMPOUND_AND, such as:
// k = 1 or (k1 = 7 and (k2 in (6,7) or k3 = 12))
// k1 = 7 and (k2 in (6,7) or k3 = 12) is compound pred, we should rebuild this sub tree
if (conjunct->op() == TExprOpcode::COMPOUND_AND) {
Expand Down
6 changes: 3 additions & 3 deletions be/src/exec/es/es_query_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ BooleanQueryBuilder::BooleanQueryBuilder(const std::vector<ExtPredicate*>& predi
break;
}
case TExprNodeType::IS_NULL_PRED: {
ExtIsNullPredicate* is_null_preidicate = (ExtIsNullPredicate *)predicate;
ExistsQueryBuilder* exists_query = new ExistsQueryBuilder(*is_null_preidicate);
if (is_null_preidicate->is_not_null) {
ExtIsNullPredicate* is_null_predicate = (ExtIsNullPredicate *)predicate;
ExistsQueryBuilder* exists_query = new ExistsQueryBuilder(*is_null_predicate);
if (is_null_predicate->is_not_null) {
_should_clauses.push_back(exists_query);
} else {
BooleanQueryBuilder* bool_query = new BooleanQueryBuilder();
Expand Down
4 changes: 2 additions & 2 deletions be/src/exec/es/es_query_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class WildCardQueryBuilder : public QueryBuilder {
std::string _field;
};

// no predicates: all doccument match
// no predicates: all document match
class MatchAllQueryBuilder : public QueryBuilder {

public:
Expand All @@ -109,7 +109,7 @@ class ExistsQueryBuilder : public QueryBuilder {
std::string _field;
};

// proccess bool compound query, and play the role of a bridge for transferring predicates to es native query
// process bool compound query, and play the role of a bridge for transferring predicates to es native query
class BooleanQueryBuilder : public QueryBuilder {

public:
Expand Down
6 changes: 3 additions & 3 deletions be/src/exec/es/es_scan_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ESScanReader {
std::string _type;
// push down filter
std::string _query;
// elaticsearch shards to fetch document
// Elasticsearch shards to fetch document
std::string _shards;
// distinguish the first scroll phase and the following scroll
bool _is_first;
Expand All @@ -81,7 +81,7 @@ class ESScanReader {
// Each call to the scroll API returns the next batch of results until there are no more results left to return
std::string _next_scroll_url;

// _search_url used to exeucte just only one search request to Elasticsearch
// _search_url used to execute just only one search request to Elasticsearch
// _search_url would go into effect when `limit` specified:
// select * from es_table limit 10 -> /es_table/doc/_search?terminate_after=10
std::string _search_url;
Expand All @@ -91,7 +91,7 @@ class ESScanReader {
std::string _cached_response;
// keep-alive for es scroll
std::string _scroll_keep_alive;
// timeout for es http connetion
// timeout for es http connection
int _http_timeout_ms;

bool _exactly_once;
Expand Down
14 changes: 7 additions & 7 deletions be/src/exec/es/es_scroll_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static const string ERROR_COL_DATA_IS_ARRAY = "Data source returned an array for
ss << "Expected value of type: " \
<< type_to_string(type) \
<< "; but found type: " << json_type_to_string(col.GetType()) \
<< "; Docuemnt slice is : " << json_value_to_string(col); \
<< "; Document slice is : " << json_value_to_string(col); \
return Status::RuntimeError(ss.str()); \
} \
} while (false)
Expand All @@ -99,7 +99,7 @@ static const string ERROR_COL_DATA_IS_ARRAY = "Data source returned an array for
ss << "Expected value of type: " \
<< type_to_string(type) \
<< "; but found type: " << json_type_to_string(col.GetType()) \
<< "; Docuemnt source slice is : " << json_value_to_string(col); \
<< "; Document source slice is : " << json_value_to_string(col); \
return Status::RuntimeError(ss.str()); \
} \
} while (false)
Expand All @@ -123,7 +123,7 @@ static const string ERROR_COL_DATA_IS_ARRAY = "Data source returned an array for
ss << "Expected value of type: " \
<< type_to_string(type) \
<< "; but found type: " << json_type_to_string(col.GetType()) \
<< "; Docuemnt source slice is : " << json_value_to_string(col); \
<< "; Document source slice is : " << json_value_to_string(col); \
return Status::RuntimeError(ss.str()); \
} \
} while (false)
Expand All @@ -134,7 +134,7 @@ static const string ERROR_COL_DATA_IS_ARRAY = "Data source returned an array for
ss << "Expected value of type: " \
<< type_to_string(type) \
<< "; but found type: " << json_type_to_string(col.GetType()) \
<< "; Docuemnt slice is : " << json_value_to_string(col); \
<< "; Document slice is : " << json_value_to_string(col); \
return Status::RuntimeError(ss.str()); \
} while (false)

Expand Down Expand Up @@ -219,7 +219,7 @@ Status ScrollParser::parse(const std::string& scroll_result, bool exactly_once)
}

if (!exactly_once && !_document_node.HasMember(FIELD_SCROLL_ID)) {
LOG(WARNING) << "Document has not a scroll id field scroll reponse:" << scroll_result;
LOG(WARNING) << "Document has not a scroll id field scroll response:" << scroll_result;
return Status::InternalError("Document has not a scroll id field");
}

Expand Down Expand Up @@ -454,7 +454,7 @@ Status ScrollParser::fill_tuple(const TupleDescriptor* tuple_desc,
// Doris On ES needs to be consistent with ES, so just divided by 1000 because the unit for from_unixtime is seconds
RETURN_IF_ERROR(fill_date_slot_with_timestamp(slot, col, type));
} else if (col.IsArray() && pure_doc_value) {
// this would happend just only when `enable_docvalue_scan = true`
// this would happened just only when `enable_docvalue_scan = true`
// ES add default format for all field after ES 6.4, if we not provided format for `date` field ES would impose
// a standard date-format for date field as `2020-06-16T00:00:00.000Z`
// At present, we just process this string format date. After some PR were merged into Doris, we would impose `epoch_mills` for
Expand All @@ -466,7 +466,7 @@ Status ScrollParser::fill_tuple(const TupleDescriptor* tuple_desc,
// ES would return millisecond timestamp for date field, divided by 1000 because the unit for from_unixtime is seconds
RETURN_IF_ERROR(fill_date_slot_with_timestamp(slot, col[0], type));
} else {
// this would happend just only when `enable_docvalue_scan = false`, and field has string format date from _source
// this would happened just only when `enable_docvalue_scan = false`, and field has string format date from _source
RETURN_ERROR_IF_COL_IS_ARRAY(col, type);
RETURN_ERROR_IF_COL_IS_NOT_STRING(col, type);
RETURN_IF_ERROR(fill_date_slot_with_strval(slot, col, type));
Expand Down
4 changes: 2 additions & 2 deletions be/src/exec/es/es_scroll_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ std::string ESScrollQueryBuilder::build(const std::map<std::string, std::string>
rapidjson::Document es_query_dsl;
rapidjson::Document::AllocatorType &allocator = es_query_dsl.GetAllocator();
es_query_dsl.SetObject();
// generate the filter caluse
// generate the filter clause
rapidjson::Document scratch_document;
rapidjson::Value query_node(rapidjson::kObjectType);
query_node.SetObject();
Expand Down Expand Up @@ -128,7 +128,7 @@ std::string ESScrollQueryBuilder::build(const std::map<std::string, std::string>
rapidjson::Value field("_doc", allocator);
sort_node.PushBack(field, allocator);
es_query_dsl.AddMember("sort", sort_node, allocator);
// number of docuements returned
// number of documents returned
es_query_dsl.AddMember("size", size, allocator);
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/es/es_scroll_query.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ESScrollQueryBuilder {
static std::string build_next_scroll_body(const std::string& scroll_id, const std::string& scroll);
static std::string build_clear_scroll_body(const std::string& scroll_id);
// @note: predicates should processed before pass it to this method,
// tie breaker for predicate wheather can push down es can reference the push-down filters
// tie breaker for predicate whether can push down es can reference the push-down filters
static std::string build(const std::map<std::string, std::string>& properties,
const std::vector<std::string>& fields, std::vector<EsPredicate*>& predicates, const std::map<std::string, std::string>& docvalue_context,
bool* doc_value_mode);
Expand Down
4 changes: 2 additions & 2 deletions be/src/exec/es_http_scan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ Status EsHttpScanNode::scanner_scan(
if (_runtime_state->is_cancelled()) {
return Status::Cancelled("Cancelled");
}
// Queue size Must be samller than _max_buffered_batches
// Queue size Must be smaller than _max_buffered_batches
_batch_queue.push_back(row_batch);

// Notify reader to
Expand Down Expand Up @@ -430,7 +430,7 @@ void EsHttpScanNode::scanner_worker(int start_idx, int length, std::promise<Stat
const TEsScanRange& es_scan_range =
_scan_ranges[start_idx].scan_range.es_scan_range;

// Collect the informations from scan range to perperties
// Collect the information from scan range to properties
std::map<std::string, std::string> properties(_properties);
properties[ESScanReader::KEY_INDEX] = es_scan_range.index;
if (es_scan_range.__isset.type) {
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/es_http_scan_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class EsHttpScanNode : public ScanNode {
// Collect all scanners 's status
Status collect_scanners_status();

// One scanner worker, This scanner will hanle 'length' ranges start from start_idx
// One scanner worker, This scanner will handle 'length' ranges start from start_idx
void scanner_worker(int start_idx, int length, std::promise<Status>& p_status);

// Scan one range
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/es_scan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ bool EsScanNode::get_disjuncts(ExprContext* context, Expr* conjunct,
vector<TExtPredicate>& disjuncts) {
if (TExprNodeType::BINARY_PRED == conjunct->node_type()) {
if (conjunct->children().size() != 2) {
VLOG(1) << "get disjuncts fail: number of childs is not 2";
VLOG(1) << "get disjuncts fail: number of children is not 2";
return false;
}
SlotRef* slotRef;
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/except_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Status ExceptNode::open(RuntimeState* state) {
bool eos = false;

for (int i = 1; i < _children.size(); ++i) {
// rebuid hash table, for first time will rebuild with the no duplicated _hash_tbl,
// rebuild hash table, for first time will rebuild with the no duplicated _hash_tbl,
if (i > 1) {
SCOPED_TIMER(_build_timer);
std::unique_ptr<HashTable> temp_tbl(
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/except_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MemPool;
class RowBatch;
class TupleRow;

// Node that calulate the except results of its children by either materializing their
// Node that calculate the except results of its children by either materializing their
// evaluated expressions into row batches or passing through (forwarding) the
// batches if the input tuple layout is identical to the output tuple layout
// and expressions don't need to be evaluated. The except node pulls from its
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/hash_join_node_ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace doris {
// This lets us distinguish between the join conjuncts vs. non-join conjuncts
// for codegen.
// Note: don't declare this static. LLVM will pick the fastcc calling convention and
// we will not be able to replace the funcitons with codegen'd versions.
// we will not be able to replace the functions with codegen'd versions.
// TODO: explicitly set the calling convention?
// TODO: investigate using fastcc for all codegen internal functions?
bool IR_NO_INLINE eval_other_join_conjuncts(ExprContext* const* ctxs, int num_ctxs, TupleRow* row) {
Expand Down
4 changes: 2 additions & 2 deletions be/src/exec/hash_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class HashTable {
insert_impl(row);
}

// Insert row into the hash table. if the row is alread exist will not insert
// Insert row into the hash table. if the row is already exist will not insert
void IR_ALWAYS_INLINE insert_unique(TupleRow* row) {
if (find(row, false) == end()) {
insert(row);
Expand Down Expand Up @@ -379,7 +379,7 @@ class HashTable {
const int _num_build_tuples;
// outer join || has null equal join should be true
const bool _stores_nulls;
// true: the null-safe equal '<=>' is true. The row with null shoud be judged.
// true: the null-safe equal '<=>' is true. The row with null should be judged.
// false: the equal '=' is false. The row with null should be filtered.
const std::vector<bool> _finds_nulls;

Expand Down
4 changes: 2 additions & 2 deletions be/src/exec/intersect_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class MemPool;
class RowBatch;
class TupleRow;

// Node that calulate the intersect results of its children by either materializing their
// Node that calculate the intersect results of its children by either materializing their
// evaluated expressions into row batches or passing through (forwarding) the
// batches if the input tuple layout is identical to the output tuple layout
// and expressions don't need to be evaluated. The children should be ordered
// such that all passthrough children come before the children that need
// materialization. The interscet node pulls from its children sequentially, i.e.
// materialization. The intersect node pulls from its children sequentially, i.e.
// it exhausts one child completely before moving on to the next one.
class IntersectNode : public SetOperationNode {
public:
Expand Down
10 changes: 5 additions & 5 deletions be/src/exec/json_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ void JsonReader::_set_tuple_value(rapidjson::Value& objectValue, Tuple* tuple, c
* handle input a simple json.
* A json is a simple json only when user not specifying the json path.
* For example:
* case 1. [{"colunm1":"value1", "colunm2":10}, {"colunm1":"
", "colunm2":30}]
* case 2. {"colunm1":"value1", "colunm2":10}
* case 1. [{"column1":"value1", "column2":10}, {"column1":"
", "column2":30}]
* case 2. {"column1":"value1", "column2":10}
*/
Status JsonReader::_handle_simple_json(Tuple* tuple, const std::vector<SlotDescriptor*>& slot_descs, MemPool* tuple_pool, bool* eof) {
do {
Expand Down Expand Up @@ -570,9 +570,9 @@ Status JsonReader::_handle_nested_complex_json(Tuple* tuple, const std::vector<S
/**
* flat array for json. _json_doc should be an array
* For example:
* [{"colunm1":"value1", "colunm2":10}, {"colunm1":"value2", "colunm2":30}]
* [{"column1":"value1", "column2":10}, {"column1":"value2", "column2":30}]
* Result:
* colunm1 colunm2
* column1 column2
* ------------------
* value1 10
* value2 30
Expand Down
Loading

0 comments on commit 09f97f8

Please sign in to comment.