@@ -1543,6 +1543,10 @@ void WaitForCompaction(Tests::TServer* server, const TString& path, bool compact
15431543}
15441544
15451545NJson::TJsonValue SimplifyPlan (NJson::TJsonValue& opt, const TGetPlanParams& params) {
1546+ Cout << opt.GetStringRobust () << Endl;
1547+ if (!opt.IsMap ()) {
1548+ return {};
1549+ }
15461550 const auto & [_, nodeType] = *opt.GetMapSafe ().find (" Node Type" );
15471551 bool isShuffle = nodeType.GetStringSafe ().find (" HashShuffle" ) != TString::npos;
15481552
@@ -1574,8 +1578,12 @@ NJson::TJsonValue SimplifyPlan(NJson::TJsonValue& opt, const TGetPlanParams& par
15741578 }
15751579 }
15761580
1577- auto firstPlan = opt.GetMapSafe ().at (" Plans" ).GetArraySafe ()[0 ];
1578- return SimplifyPlan (firstPlan, params);
1581+ if (opt.IsMap () && opt.GetMapSafe ().contains (" Plans" )) {
1582+ auto firstPlan = opt.GetMapSafe ().at (" Plans" ).GetArraySafe ()[0 ];
1583+ return SimplifyPlan (firstPlan, params);
1584+ }
1585+
1586+ return {};
15791587}
15801588
15811589bool JoinOrderAndAlgosMatch (const NJson::TJsonValue& opt, const NJson::TJsonValue& ref) {
@@ -1653,6 +1661,10 @@ NJson::TJsonValue GetDetailedJoinOrder(const TString& deserializedPlan, const TG
16531661}
16541662
16551663NJson::TJsonValue GetJoinOrderImpl (const NJson::TJsonValue& opt) {
1664+ if (!opt.IsMap ()) {
1665+ return {};
1666+ }
1667+
16561668 if (!opt.GetMapSafe ().contains (" Plans" )) {
16571669 auto op = opt.GetMapSafe ().at (" Operators" ).GetArraySafe ()[0 ];
16581670 return op.GetMapSafe ().at (" Table" ).GetStringSafe ();
@@ -1676,6 +1688,10 @@ NJson::TJsonValue GetJoinOrder(const TString& deserializedPlan) {
16761688}
16771689
16781690NJson::TJsonValue GetJoinOrderFromDetailedJoinOrderImpl (const NJson::TJsonValue& opt) {
1691+ if (!opt.IsMap ()) {
1692+ return {};
1693+ }
1694+
16791695 if (!opt.GetMapSafe ().contains (" table" )) {
16801696 NJson::TJsonValue res;
16811697 auto args = opt.GetMapSafe ().at (" args" ).GetArraySafe ();
0 commit comments