Skip to content

Commit

Permalink
[Feature] adapt limit for sqlserver (#48214) (#48248)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8184872)
  • Loading branch information
XinzhuangL authored and LiShuMing committed Aug 13, 2024
1 parent 19369d0 commit 8dfc8c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions be/src/connector/jdbc_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ static std::string get_jdbc_sql(const Slice jdbc_url, const std::string& table,
const std::vector<std::string>& filters, int64_t limit) {
std::ostringstream oss;
oss << "SELECT";
if (limit != -1 && jdbc_url.starts_with("jdbc:sqlserver")) {
oss << fmt::format(" TOP({}) ", limit);
limit = -1;
}
for (size_t i = 0; i < columns.size(); i++) {
oss << (i == 0 ? "" : ",") << " " << columns[i];
}
Expand Down

0 comments on commit 8dfc8c4

Please sign in to comment.