@@ -29,6 +29,24 @@ using namespace NYT::NApi;
29
29
using namespace NActors ;
30
30
31
31
namespace NYql {
32
+ // This is compat function. YT changed returned type of IClient::GetJobStder.
33
+ // This function is used to be compatible both with new and old versions.
34
+ //
35
+ // Can be removed once arcadia and github both use new version of YT client.
36
+ template <typename T>
37
+ TFuture<NYT::TSharedRef> ToStderrDataFuture (const NYT::TFuture<T>& jobStderrResponse) {
38
+ if constexpr (std::is_same_v<T, NYT::TSharedRef>) {
39
+ return jobStderrResponse.Apply (BIND ([] (const NYT::TSharedRef& rsp) {
40
+ return rsp;
41
+ }));
42
+ } else {
43
+ // T must be TGetJobStderrResponse
44
+ return jobStderrResponse.Apply (BIND ([] (const T& rsp) {
45
+ return rsp.Data ;
46
+ }));
47
+ }
48
+ }
49
+
32
50
struct TRequest : public NYT ::TRefCounted {
33
51
const TActorId SelfId;
34
52
const TActorId Sender;
@@ -624,8 +642,8 @@ namespace NYql {
624
642
for (const auto & job : result.Jobs ) {
625
643
YQL_CLOG (DEBUG, ProviderDq) << " Printing stderr (" << ToString (operationId) << " ," << ToString (job.Id ) << " )" ;
626
644
627
- YT_UNUSED_FUTURE (cli->GetJobStderr (operationId, job.Id )
628
- .Apply (BIND ([jobId = job.Id , operationId](const TSharedRef& data) {
645
+ auto jobStderrData = ToStderrDataFuture (cli->GetJobStderr (operationId, job.Id ));
646
+ YT_UNUSED_FUTURE (jobStderrData .Apply (BIND ([jobId = job.Id , operationId](const NYT:: TSharedRef& data) {
629
647
YQL_CLOG (DEBUG, ProviderDq)
630
648
<< " Stderr ("
631
649
<< ToString (operationId) << " ,"
0 commit comments