mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 17:44:23 +00:00
Merge pull request #6083 from yandex/odbc-initial-load-fix
Fix for initial load of external dictionaries via ODBC
This commit is contained in:
commit
c6b468d435
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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. */
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user