File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
query/src/main/java/tech/ydb/query Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import tech .ydb .core .Issue ;
8
8
import tech .ydb .core .Result ;
9
+ import tech .ydb .proto .ValueProtos ;
9
10
import tech .ydb .query .result .QueryInfo ;
10
11
import tech .ydb .query .result .QueryResultPart ;
11
12
15
16
*/
16
17
@ ExperimentalApi ("QueryService is experimental and API may change without notice" )
17
18
public interface QueryStream {
19
+
20
+ @ FunctionalInterface
18
21
interface PartsHandler {
19
22
default void onIssues (Issue [] issues ) { }
23
+
20
24
void onNextPart (QueryResultPart part );
25
+
26
+ default void onNextRawPart (long index , ValueProtos .ResultSet rs ) {
27
+ onNextPart (new QueryResultPart (index , rs ));
28
+ }
21
29
}
22
30
23
31
CompletableFuture <Result <QueryInfo >> execute (PartsHandler handler );
Original file line number Diff line number Diff line change 29
29
import tech .ydb .query .QueryStream ;
30
30
import tech .ydb .query .QueryTransaction ;
31
31
import tech .ydb .query .result .QueryInfo ;
32
- import tech .ydb .query .result .QueryResultPart ;
33
32
import tech .ydb .query .result .QueryStats ;
34
33
import tech .ydb .query .settings .AttachSessionSettings ;
35
34
import tech .ydb .query .settings .BeginTransactionSettings ;
@@ -304,7 +303,7 @@ public CompletableFuture<Result<QueryInfo>> execute(PartsHandler handler) {
304
303
if (msg .hasResultSet ()) {
305
304
long index = msg .getResultSetIndex ();
306
305
if (handler != null ) {
307
- handler .onNextPart ( new QueryResultPart ( index , msg .getResultSet () ));
306
+ handler .onNextRawPart ( index , msg .getResultSet ());
308
307
} else {
309
308
logger .trace ("{} lost result set part with index {}" , SessionImpl .this , index );
310
309
}
You can’t perform that action at this time.
0 commit comments