Merge pull request #6083 from yandex/odbc-initial-load-fix

Fix for initial load of external dictionaries via ODBC
This commit is contained in:
alexey-milovidov 2019-07-20 04:26:22 +03:00 committed by GitHub
commit c6b468d435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 9 deletions

View File

@ -115,8 +115,7 @@ std::string ClickHouseDictionarySource::getUpdateFieldAndDate()
else
{
update_time = std::chrono::system_clock::now();
std::string str_time("0000-00-00 00:00:00"); ///for initial load
return query_builder.composeUpdateQuery(update_field, str_time);
return query_builder.composeLoadAllQuery();
}
}

View File

@ -167,7 +167,7 @@ std::string ExternalQueryBuilder::composeUpdateQuery(const std::string & update_
else
update_query = " WHERE " + update_field + " >= '" + time_point + "'";
return out.insert(out.size() - 1, update_query); ///This is done to insert "update_query" before "out"'s semicolon
return out.insert(out.size() - 1, update_query); /// This is done to insert "update_query" before "out"'s semicolon
}

View File

@ -35,7 +35,7 @@ struct ExternalQueryBuilder
/** Generate a query to load all data. */
std::string composeLoadAllQuery() const;
/** Generate a query to load data after certain time point*/
/** Generate a query to load data after certain time point */
std::string composeUpdateQuery(const std::string & update_field, const std::string & time_point) const;
/** Generate a query to load data by set of UInt64 keys. */

View File

@ -66,7 +66,6 @@ void HTTPDictionarySource::getUpdateFieldAndDate(Poco::URI & uri)
else
{
update_time = std::chrono::system_clock::now();
uri.addQueryParameter(update_field, "0000-00-00 00:00:00");
}
}

View File

@ -109,8 +109,7 @@ std::string MySQLDictionarySource::getUpdateFieldAndDate()
else
{
update_time = std::chrono::system_clock::now();
std::string str_time("0000-00-00 00:00:00"); ///for initial load
return query_builder.composeUpdateQuery(update_field, str_time);
return query_builder.composeLoadAllQuery();
}
}

View File

@ -127,8 +127,7 @@ std::string XDBCDictionarySource::getUpdateFieldAndDate()
else
{
update_time = std::chrono::system_clock::now();
std::string str_time("0000-00-00 00:00:00"); ///for initial load
return query_builder.composeUpdateQuery(update_field, str_time);
return query_builder.composeLoadAllQuery();
}
}