Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get方法,查询count支持根据按partition id查询 #338

Merged
merged 1 commit into from
Nov 28, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ public GetResult get(Get get, BiFunction<String, SearcherScope, Searcher> search
try {
String sql = String.format(
Locale.ROOT,
"select _routing,_seq_no,_primary_term,_version,_source from %s_summary_ where _id='%s'",
"select /*+ SCAN_ATTR(partitionIds='%d')*/ _routing,_seq_no,_primary_term,_version,_source from %s_summary_ where _id='%s'",
shardId.id(),
tableName,
get.id()
);
Expand Down Expand Up @@ -826,7 +827,7 @@ public DocsStats docStats() {
long getDocCount() {
long docCount = 0;
try {
String sql = String.format(Locale.ROOT, "select count(*) from %s", tableName);
String sql = String.format(Locale.ROOT, "select /*+ SCAN_ATTR(partitionIds='%d')*/ count(*) from %s", shardId.id(), tableName);
String kvpair = "format:full_json;timeout:10000;databaseName:" + SQL_DATABASE;
QrsSqlRequest request = new QrsSqlRequest(sql, kvpair);
QrsSqlResponse response = qrsHttpClient.executeSql(request);
Expand Down