@@ -818,7 +818,7 @@ class TDqExecTransformer: public TExecTransformerBase, TCounters
818818 bool fallbackFlag = BuildUploadList (uploadList, localRun, explorer, typeEnv, files);
819819
820820 if (fallbackFlag) {
821- YQL_CLOG (DEBUG , ProviderDq) << " Fallback: " << NCommon::ExprToPrettyString (ctx, *input);
821+ YQL_CLOG (TRACE , ProviderDq) << " Fallback: " << NCommon::ExprToPrettyString (ctx, *input);
822822 return Fallback ();
823823 } else {
824824 *lambda = SerializeRuntimeNode (root, typeEnv);
@@ -921,6 +921,33 @@ class TDqExecTransformer: public TExecTransformerBase, TCounters
921921 }
922922 }
923923
924+ bool hasErrors = false ;
925+ auto fallback = [&ctx, &hasErrors](const TExprNode& n, const TString& msg) {
926+ auto issues = TIssues{TIssue (ctx.GetPosition (n.Pos ()), msg).SetCode (TIssuesIds::DQ_GATEWAY_NEED_FALLBACK_ERROR, TSeverityIds::S_WARNING)};
927+ ctx.AssociativeIssues .emplace (&n, std::move (issues));
928+ hasErrors = true ;
929+ };
930+
931+ VisitExpr (*input.Get (), [&fallback, &hasErrors](const TExprNode& n) {
932+ if (TCoScriptUdf::Match (&n) && NKikimr::NMiniKQL::IsSystemPython (NKikimr::NMiniKQL::ScriptTypeFromStr (n.Head ().Content ()))) {
933+ fallback (n, TStringBuilder () << " Cannot execute system python udf " << n.Content () << " in DQ" );
934+ return false ;
935+ }
936+ if ((TCoScriptUdf::Match (&n) && n.ChildrenSize () > 4 ) || (TCoUdf::Match (&n) && n.ChildrenSize () == 8 )) {
937+ for (const auto & setting: n.Child (TCoScriptUdf::Match (&n) ? 4 : 7 )->Children ()) {
938+ YQL_ENSURE (setting->Head ().IsAtom ());
939+ if (setting->Head ().Content () == " layers" ) {
940+ fallback (n, TStringBuilder () << " Cannot execute udf " << n.Head ().Content () << " with layers in DQ" );
941+ return false ;
942+ }
943+ }
944+ }
945+ return !hasErrors;
946+ });
947+ if (hasErrors) {
948+ return Fallback ();
949+ }
950+
924951 THashMap<TString, TString> secureParams;
925952 NCommon::FillSecureParams (resInput, *State->TypeCtx , secureParams);
926953
@@ -1074,7 +1101,7 @@ class TDqExecTransformer: public TExecTransformerBase, TCounters
10741101 return IGraphTransformer::TStatus (IGraphTransformer::TStatus::Error);
10751102 }
10761103
1077- YQL_CLOG (DEBUG , ProviderDq) << " Fallback from gateway: " << NCommon::ExprToPrettyString (ctx, *input);
1104+ YQL_CLOG (TRACE , ProviderDq) << " Fallback from gateway: " << NCommon::ExprToPrettyString (ctx, *input);
10781105 TIssue warning (ctx.GetPosition (input->Pos ()), " DQ cannot execute the query" );
10791106 warning.Severity = TSeverityIds::S_INFO;
10801107 ctx.IssueManager .RaiseIssue (warning);
0 commit comments