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 66
77import tech .ydb .core .Issue ;
88import tech .ydb .core .Result ;
9+ import tech .ydb .proto .ValueProtos ;
910import tech .ydb .query .result .QueryInfo ;
1011import tech .ydb .query .result .QueryResultPart ;
1112
1516 */
1617@ ExperimentalApi ("QueryService is experimental and API may change without notice" )
1718public interface QueryStream {
19+
20+ @ FunctionalInterface
1821 interface PartsHandler {
1922 default void onIssues (Issue [] issues ) { }
23+
2024 void onNextPart (QueryResultPart part );
25+
26+ default void onNextRawPart (long index , ValueProtos .ResultSet rs ) {
27+ onNextPart (new QueryResultPart (index , rs ));
28+ }
2129 }
2230
2331 CompletableFuture <Result <QueryInfo >> execute (PartsHandler handler );
Original file line number Diff line number Diff line change 2929import tech .ydb .query .QueryStream ;
3030import tech .ydb .query .QueryTransaction ;
3131import tech .ydb .query .result .QueryInfo ;
32- import tech .ydb .query .result .QueryResultPart ;
3332import tech .ydb .query .result .QueryStats ;
3433import tech .ydb .query .settings .AttachSessionSettings ;
3534import tech .ydb .query .settings .BeginTransactionSettings ;
@@ -304,7 +303,7 @@ public CompletableFuture<Result<QueryInfo>> execute(PartsHandler handler) {
304303 if (msg .hasResultSet ()) {
305304 long index = msg .getResultSetIndex ();
306305 if (handler != null ) {
307- handler .onNextPart ( new QueryResultPart ( index , msg .getResultSet () ));
306+ handler .onNextRawPart ( index , msg .getResultSet ());
308307 } else {
309308 logger .trace ("{} lost result set part with index {}" , SessionImpl .this , index );
310309 }
You can’t perform that action at this time.
0 commit comments