Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apiserver/api_server_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void APIServerImpl::RegisterPut() {

for (int i = 0; i < cnt; ++i) {
if (!AppendJsonValue(arr[i], schema->GetColumnType(i), schema->IsColumnNotNull(i), row)) {
writer << resp.Set(absl::StrCat("convertion failed on col ", schema->GetColumnName(i), "[",
writer << resp.Set(absl::StrCat("conversion failed on col ", schema->GetColumnName(i), "[",
schema->GetColumnType(i), "] with value ", arr[i].GetString()));
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/apiserver/api_server_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ TEST_F(APIServerTest, validPut) {
JsonReader reader(cntl.response_attachment().to_string().c_str());
reader >> resp;
ASSERT_EQ(-1, resp.code) << resp.msg;
ASSERT_STREQ("convertion failed on col field4[7] with value 2021-0 4-27", resp.msg.c_str());
ASSERT_STREQ("conversion failed on col field4[7] with value 2021-0 4-27", resp.msg.c_str());
}

// valid data
Expand Down Expand Up @@ -1164,7 +1164,7 @@ TEST_F(APIServerTest, getDBs) {
{
hybridse::sdk::Status status;
for (auto& db : test_dbs) {
// empty db can be droped
// empty db can be dropped
env->cluster_remote->DropDB(db, &status);
ASSERT_TRUE(env->cluster_remote->CreateDB(db, &status));
}
Expand Down
4 changes: 2 additions & 2 deletions src/base/endianconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#endif /* BYTE_ORDER */

/* Sometimes after including an OS-specific header that defines the
* endianess we end with __BYTE_ORDER but not with BYTE_ORDER that is what
* endianness we end with __BYTE_ORDER but not with BYTE_ORDER that is what
* the Redis code uses. In this case let's define everything without the
* underscores. */
#ifndef BYTE_ORDER
Expand Down Expand Up @@ -121,7 +121,7 @@ uint16_t intrev16(uint16_t v);
uint32_t intrev32(uint32_t v);
uint64_t intrev64(uint64_t v);

/* variants of the function doing the actual convertion only if the target
/* variants of the function doing the actual conversion only if the target
* host is big endian */
#if (BYTE_ORDER == LITTLE_ENDIAN)
#define memrev16ifbe(p)
Expand Down
6 changes: 3 additions & 3 deletions src/base/linenoise.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
*
* DSR (Device Status Report)
* Sequence: ESC [ 6 n
* Effect: reports the current cusor position as ESC [ n ; m R
* Effect: reports the current cursor position as ESC [ n ; m R
* where n is the row and m is the column
*
* When multi line mode is enabled, we also use an additional escape
Expand Down Expand Up @@ -562,7 +562,7 @@ static void refreshMultiLine(struct linenoiseState *l) {
int rows = (plen + l->len + l->cols - 1) / l->cols; /* rows used by current buf. */
int rpos = (plen + l->oldpos + l->cols) / l->cols; /* cursor relative row. */
int rpos2; /* rpos after refresh. */
int col; /* colum position, zero-based. */
int col; /* column position, zero-based. */
int old_rows = l->maxrows;
int fd = l->ofd, j;
struct abuf ab;
Expand Down Expand Up @@ -756,7 +756,7 @@ void linenoiseEditBackspace(struct linenoiseState *l) {
}
}

/* Delete the previosu word, maintaining the cursor at the start of the
/* Delete the previous word, maintaining the cursor at the start of the
* current word. */
void linenoiseEditDeletePrevWord(struct linenoiseState *l) {
size_t old_pos = l->pos;
Expand Down
4 changes: 2 additions & 2 deletions src/base/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum ReturnCode {
kSnapshotRecycled = 147,
kQueryFailed = 148,
kPutBadFormat = 149,
kUnkownTableType = 150,
kUnknownTableType = 150,
kColNameNotFound = 151,
kEncodeError = 152,
kAddTypeToColumnDescFailed = 153,
Expand Down Expand Up @@ -144,7 +144,7 @@ enum ReturnCode {
kTermLeCurTerm = 406,
kZoneNameNotEqual = 407,
kAlreadyJoinZone = 408,
kUnkownServerMode = 409,
kUnknownServerMode = 409,
kZoneNotEmpty = 410,
kCreateZkFailed = 450,
kGetZkFailed = 451,
Expand Down
4 changes: 2 additions & 2 deletions src/catalog/client_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ bool AsyncTablesHandler::SyncAllTableHandlers() {
return false;
}
if (!iter) {
status_.msg = "fail to sync table hander: iter is null";
status_.msg = "fail to sync table handler: iter is null";
status_.code = hybridse::common::kResponseError;
LOG(WARNING) << status_;
return false;
Expand Down Expand Up @@ -348,7 +348,7 @@ std::shared_ptr<hybridse::vm::RowHandler> TabletsAccessor::SubQuery(uint32_t tas
const hybridse::codec::Row& row,
const bool is_procedure, const bool is_debug) {
return std::make_shared<::hybridse::vm::ErrorRowHandler>(::hybridse::common::kRpcError,
"TabletsAccessor Unsupport SubQuery with request");
"TabletsAccessor Unsupported SubQuery with request");
}

std::shared_ptr<hybridse::vm::TableHandler> TabletsAccessor::SubQuery(uint32_t task_id, const std::string& db,
Expand Down
12 changes: 6 additions & 6 deletions src/catalog/distribute_iterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ const ::hybridse::codec::Row& FullTableIterator::GetValue() {
slice_row = kv_it_->GetValue();
}
size_t sz = slice_row.size();
int8_t* copyed_row_data = reinterpret_cast<int8_t*>(malloc(sz));
memcpy(copyed_row_data, slice_row.data(), sz);
auto shared_slice = ::hybridse::base::RefCountedSlice::CreateManaged(copyed_row_data, sz);
int8_t* copied_row_data = reinterpret_cast<int8_t*>(malloc(sz));
memcpy(copied_row_data, slice_row.data(), sz);
auto shared_slice = ::hybridse::base::RefCountedSlice::CreateManaged(copied_row_data, sz);
buffered_slices_.push_back(shared_slice);
value_.Reset(shared_slice);
return value_;
Expand Down Expand Up @@ -419,9 +419,9 @@ const ::hybridse::codec::Row& RemoteWindowIterator::GetValue() {
size_t sz = slice_row.size();
// for distributed environment, slice_row's data probably become invalid when the DistributeWindowIterator
// iterator goes out of scope. so copy action occurred here
int8_t* copyed_row_data = reinterpret_cast<int8_t*>(malloc(sz));
memcpy(copyed_row_data, slice_row.data(), sz);
auto shared_slice = ::hybridse::base::RefCountedSlice::CreateManaged(copyed_row_data, sz);
int8_t* copied_row_data = reinterpret_cast<int8_t*>(malloc(sz));
memcpy(copied_row_data, slice_row.data(), sz);
auto shared_slice = ::hybridse::base::RefCountedSlice::CreateManaged(copied_row_data, sz);
row_.Reset(shared_slice);
DLOG(INFO) << "get value pk " << pk_ << " ts_key " << kv_it_->GetKey() << " ts " << ts_;
valid_value_ = true;
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/distribute_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FullTableIterator : public ::hybridse::codec::ConstIterator<uint64_t, ::hy
FullTableIterator(uint32_t tid, std::shared_ptr<Tables> tables,
const std::map<uint32_t, std::shared_ptr<::openmldb::client::TabletClient>>& tablet_clients);
void Seek(const uint64_t& ts) override {
LOG(ERROR) << "Unsupport Seek in FullTableIterator";
LOG(ERROR) << "Unsupported Seek in FullTableIterator";
}

void SeekToFirst() override;
Expand Down
4 changes: 2 additions & 2 deletions src/catalog/tablet_catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class TabletSegmentHandler : public ::hybridse::vm::TableHandler {
class TabletPartitionHandler : public ::hybridse::vm::PartitionHandler,
public std::enable_shared_from_this<hybridse::vm::PartitionHandler> {
public:
TabletPartitionHandler(std::shared_ptr<::hybridse::vm::TableHandler> table_hander, const std::string &index_name)
: PartitionHandler(), table_handler_(table_hander), index_name_(index_name) {}
TabletPartitionHandler(std::shared_ptr<::hybridse::vm::TableHandler> table_handler, const std::string &index_name)
: PartitionHandler(), table_handler_(table_handler), index_name_(index_name) {}

~TabletPartitionHandler() {}

Expand Down
2 changes: 1 addition & 1 deletion src/client/taskmanager_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ::openmldb::base::Status TaskManagerClient::ShowJobs(bool only_unfinished, int j

auto st = client_.SendRequestSt(&::openmldb::taskmanager::TaskManagerServer_Stub::ShowJobs, &request, &response,
job_timeout, 1);
// if ok, cntl won't failed, only check repsonse
// if ok, cntl won't failed, only check response
if (st.OK()) {
if (response.code() == 0) {
for (int32_t i = 0; i < response.jobs_size(); i++) {
Expand Down
20 changes: 10 additions & 10 deletions src/cmd/openmldb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void HandleNSSwitchMode(const std::vector<std::string>& parts, ::openmldb::clien
ok = client->SwitchMode(::openmldb::nameserver::kLEADER, msg);
}
if (!ok) {
std::cout << "Fail to swith mode. error msg: " << msg << std::endl;
std::cout << "Fail to switch mode. error msg: " << msg << std::endl;
return;
}
std::cout << "switchmode ok" << std::endl;
Expand Down Expand Up @@ -1682,7 +1682,7 @@ void HandleNSCount(const std::vector<std::string>& parts, ::openmldb::client::Ns
}
std::map<std::string, std::string> parameter_map;
if (!GetParameterMap("table_name", parts, "=", parameter_map)) {
std::cout << "count format erro! eg. count tid=xxx pid=xxx key=xxx "
std::cout << "count format error! eg. count tid=xxx pid=xxx key=xxx "
"index_name=xxx ts=xxx ts_name=xxx [filter_expired_data]"
<< std::endl;
return;
Expand Down Expand Up @@ -2327,7 +2327,7 @@ void HandleNSClientHelp(const std::vector<std::string>& parts, ::openmldb::clien
printf("info - show information of the table\n");
printf("addrepcluster - add remote replica cluster\n");
printf("showrepcluster - show remote replica cluster\n");
printf("removerepcluster - remove remote replica cluste \n");
printf("removerepcluster - remove remote replica cluster \n");
printf("switchmode - switch cluster mode\n");
printf("synctable - synctable from leader cluster to replica cluster\n");
printf("deleteindx - delete index of specified table\n");
Expand All @@ -2339,7 +2339,7 @@ void HandleNSClientHelp(const std::vector<std::string>& parts, ::openmldb::clien
printf("usage: create table_meta_file_path\n");
printf(
"usage: create table_name ttl partition_num replica_num "
"[colum_name1:type:index colum_name2:type ...]\n");
"[column_name1:type:index column_name2:type ...]\n");
printf("example: create ./table_meta.txt\n");
printf("example: create table1 144000 8 3\n");
printf("example: create table2 latest:10 8 3\n");
Expand Down Expand Up @@ -2587,7 +2587,7 @@ void HandleNSClientHelp(const std::vector<std::string>& parts, ::openmldb::clien
printf("usage: dropdb database_name\n");
printf("example: dropdb db1");
} else {
printf("unsupport cmd %s\n", parts[1].c_str());
printf("unsupported cmd %s\n", parts[1].c_str());
}
} else {
printf("help format error!\n");
Expand Down Expand Up @@ -3121,7 +3121,7 @@ void HandleClientHelp(const std::vector<std::string> parts, ::openmldb::client::
printf("ex: setttl 2 0 latest 10\n");
printf("ex: setttl 3 0 latest 10 ts1\n");
} else {
printf("unsupport cmd %s\n", parts[1].c_str());
printf("unsupported cmd %s\n", parts[1].c_str());
}
} else {
printf("help format error!\n");
Expand Down Expand Up @@ -3460,7 +3460,7 @@ void HandleClientCount(const std::vector<std::string>& parts, ::openmldb::client
}
std::map<std::string, std::string> parameter_map;
if (!GetParameterMap("tid", parts, "=", parameter_map)) {
std::cout << "count format erro! eg. count tid=xxx pid=xxx key=xxx "
std::cout << "count format error! eg. count tid=xxx pid=xxx key=xxx "
"index_name=xxx ts=xxx ts_name=xxx [filter_expired_data]"
<< std::endl;
return;
Expand Down Expand Up @@ -3758,21 +3758,21 @@ void StartNsClient() {
return;
}
std::string display_prefix = endpoint + " " + client.GetDb() + "> ";
std::string multi_line_perfix = std::string(display_prefix.length() - 3, ' ') + "-> ";
std::string multi_line_prefix = std::string(display_prefix.length() - 3, ' ') + "-> ";
std::string sql;
bool multi_line = false;
while (true) {
std::string buffer;
display_prefix = endpoint + " " + client.GetDb() + "> ";
multi_line_perfix = std::string(display_prefix.length() - 3, ' ') + "-> ";
multi_line_prefix = std::string(display_prefix.length() - 3, ' ') + "-> ";
if (!FLAGS_cmd.empty()) {
buffer = FLAGS_cmd;
if (!FLAGS_database.empty()) {
std::string error;
client.Use(FLAGS_database, error);
}
} else {
char* line = ::openmldb::base::linenoise(multi_line ? multi_line_perfix.c_str() : display_prefix.c_str());
char* line = ::openmldb::base::linenoise(multi_line ? multi_line_prefix.c_str() : display_prefix.c_str());
if (line == NULL) {
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/sql_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const std::string VERSION = std::to_string(OPENMLDB_VERSION_MAJOR) + "." + // N
::openmldb::sdk::DBSDK* cs = nullptr;
::openmldb::sdk::SQLClusterRouter* sr = nullptr;

// strip any whitespace characters begining of the last unfinished statement from `input` (string after last semicolon)
// strip any whitespace characters beginning of the last unfinished statement from `input` (string after last semicolon)
// final SQL strings are appended into `output`
//
// this help handle SQL strings that has space trailing but do not expected to be a statement after semicolon
Expand Down Expand Up @@ -255,12 +255,12 @@ void Shell() {
ns_endpoint = ns_client->GetEndpoint();
}
std::string display_prefix = ns_endpoint + "/" + sr->GetDatabase() + "> ";
std::string multi_line_perfix = std::string(display_prefix.length() - 3, ' ') + "-> ";
std::string multi_line_prefix = std::string(display_prefix.length() - 3, ' ') + "-> ";
std::string sql;
bool multi_line = false;
while (true) {
std::string buffer;
char* line = ::openmldb::base::linenoise(multi_line ? multi_line_perfix.c_str() : display_prefix.c_str());
char* line = ::openmldb::base::linenoise(multi_line ? multi_line_prefix.c_str() : display_prefix.c_str());
if (line == nullptr) {
return;
}
Expand All @@ -283,7 +283,7 @@ void Shell() {
HandleSQL(sql);
multi_line = false;
display_prefix = ns_endpoint + "/" + sr->GetDatabase() + "> ";
multi_line_perfix = std::string(display_prefix.length() - 3, ' ') + "-> ";
multi_line_prefix = std::string(display_prefix.length() - 3, ' ') + "-> ";
sql.clear();
} else {
sql.append("\n");
Expand Down
20 changes: 10 additions & 10 deletions src/cmd/sql_cmd_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,17 @@ TEST_F(SqlCmdTest, SelectIntoOutfile) {
router->ExecuteSQL(select_into_sql, &status);
ASSERT_TRUE(status.IsOK());

// False - Type un-supproted
// False - Type un-supported
select_into_sql = "select * from " + name + " into outfile '" + file_path + "' options (mode = 1)";
router->ExecuteSQL(select_into_sql, &status);
ASSERT_FALSE(status.IsOK());

// False - Type un-supproted
// False - Type un-supported
select_into_sql = "select * from " + name + " into outfile '" + file_path + "' options (quote = '__')";
router->ExecuteSQL(select_into_sql, &status);
ASSERT_FALSE(status.IsOK());

// False - Type un-supproted
// False - Type un-supported
select_into_sql = "select * from " + name + " into outfile '" + file_path + "' options (delimiter = '')";
router->ExecuteSQL(select_into_sql, &status);
ASSERT_FALSE(status.IsOK());
Expand Down Expand Up @@ -3210,7 +3210,7 @@ TEST_P(DBSDKTest, LongWindowAnyWhereWithDataOutOfOrder) {
EXPECT_EQ(4.0, res->GetDoubleUnsafe(11));
}

TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportRowsBucket) {
TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportedRowsBucket) {
auto cli = GetParam();
cs = cli->cs;
sr = cli->sr;
Expand Down Expand Up @@ -3240,20 +3240,20 @@ TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportRowsBucket) {
dp_, table_),
&status);
ASSERT_FALSE(status.IsOK());
EXPECT_EQ(status.msg, "unsupport *_where op (avg_where) for rows bucket type long window")
EXPECT_EQ(status.msg, "unsupported *_where op (avg_where) for rows bucket type long window")
<< "code=" << status.code << ", msg=" << status.msg << "\n"
<< status.trace;
}
void TearDownDeployment() override {}
};

// unsupport: deploy any_where with rows bucket
// unsupported: deploy any_where with rows bucket
DeployLongWindowAnyWhereEnv env(sr);
env.SetUp();
absl::Cleanup clean = [&env]() { env.TearDown(); };
}

TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportTimeFilter) {
TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportedTimeFilter) {
auto cli = GetParam();
cs = cli->cs;
sr = cli->sr;
Expand All @@ -3275,7 +3275,7 @@ TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportTimeFilter) {
dp_, table_),
&status);
ASSERT_FALSE(status.IsOK());
EXPECT_EQ(status.msg, "unsupport date or timestamp as filter column (date_col)")
EXPECT_EQ(status.msg, "unsupported date or timestamp as filter column (date_col)")
<< "code=" << status.code << ", msg=" << status.msg << "\n"
<< status.trace;
}
Expand Down Expand Up @@ -3304,7 +3304,7 @@ TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportTimeFilter) {
dp_, table_),
&status);
ASSERT_FALSE(status.IsOK());
EXPECT_EQ(status.msg, "unsupport date or timestamp as filter column (t_col)")
EXPECT_EQ(status.msg, "unsupported date or timestamp as filter column (t_col)")
<< "code=" << status.code << ", msg=" << status.msg << "\n"
<< status.trace;
}
Expand All @@ -3317,7 +3317,7 @@ TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportTimeFilter) {
}
}

TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportHDDTable) {
TEST_P(DBSDKTest, LongWindowAnyWhereUnsupportedHDDTable) {
// *_where over HDD/SSD table main table not support
auto cli = GetParam();
cs = cli->cs;
Expand Down
Loading
Loading