@@ -1399,7 +1399,7 @@ class TYqlCallableType final : public TCallNode {
13991399 return false ;
14001400 }
14011401
1402- if (!dynamic_cast <TTupleNode*>( Args[0 ]. Get () )) {
1402+ if (!Args[0 ]-> GetTupleNode ( )) {
14031403 ui32 numOptArgs;
14041404 if (!Parseui32 (Args[0 ], numOptArgs)) {
14051405 ctx.Error (Args[0 ]->GetPos ()) << " Expected either tuple or number of optional arguments" ;
@@ -1409,12 +1409,12 @@ class TYqlCallableType final : public TCallNode {
14091409 Args[0 ] = Q (Y (BuildQuotedAtom (Args[0 ]->GetPos (), ToString (numOptArgs))));
14101410 }
14111411
1412- if (!dynamic_cast <TTupleNode*>( Args[1 ]. Get () )) {
1412+ if (!Args[1 ]-> GetTupleNode ( )) {
14131413 Args[1 ] = Q (Y (Args[1 ]));
14141414 }
14151415
14161416 for (ui32 index = 2 ; index < Args.size (); ++index) {
1417- if (!dynamic_cast <TTupleNode*>( Args[index]. Get () )) {
1417+ if (!Args[index]-> GetTupleNode ( )) {
14181418 Args[index] = Q (Y (Args[index]));
14191419 }
14201420 }
@@ -2300,7 +2300,7 @@ TNodePtr BuildSqlCall(TContext& ctx, TPosition pos, const TString& module, const
23002300 TVector<TNodePtr> sqlCallArgs;
23012301 sqlCallArgs.push_back (BuildQuotedAtom (pos, fullName));
23022302 if (namedArgs) {
2303- auto tupleNodePtr = dynamic_cast < const TTupleNode*>(positionalArgs. Get () );
2303+ auto tupleNodePtr = positionalArgs-> GetTupleNode ( );
23042304 YQL_ENSURE (tupleNodePtr);
23052305 TNodePtr positionalArgsNode = new TCallNodeImpl (pos, " PositionalArgs" , tupleNodePtr->Elements ());
23062306 sqlCallArgs.push_back (BuildTuple (pos, { positionalArgsNode, namedArgs }));
@@ -2484,7 +2484,7 @@ class TScriptUdf final: public INode {
24842484 return false ;
24852485 }
24862486 auto scriptStrPtr = Args.back ()->GetLiteral (" String" );
2487- if (scriptStrPtr && scriptStrPtr->size () > SQL_MAX_INLINE_SCRIPT_LEN) {
2487+ if (!ctx. CompactNamedExprs && scriptStrPtr && scriptStrPtr->size () > SQL_MAX_INLINE_SCRIPT_LEN) {
24882488 scriptNode = ctx.UniversalAlias (" scriptudf" , std::move (scriptNode));
24892489 }
24902490
@@ -3438,9 +3438,9 @@ TNodePtr BuildBuiltinFunc(TContext& ctx, TPosition pos, TString name, const TVec
34383438 };
34393439 };
34403440
3441- auto structNode = dynamic_cast <TStructNode*>( args[0 ]. Get () );
3441+ auto structNode = args[0 ]-> GetStructNode ( );
34423442 if (!structNode) {
3443- if (auto callNode = dynamic_cast <TCallNode*>( args[0 ]. Get () )) {
3443+ if (auto callNode = args[0 ]-> GetCallNode ( )) {
34443444 if (callNode->GetOpName () == " AsStruct" ) {
34453445 return BuildUdf (ctx, pos, nameSpace, name, makeUdfArgs ());
34463446 }
@@ -3452,7 +3452,7 @@ TNodePtr BuildBuiltinFunc(TContext& ctx, TPosition pos, TString name, const TVec
34523452 for (const auto & item : structNode->GetExprs ()) {
34533453 const auto & label = item->GetLabel ();
34543454 if (label == " Entities" ) {
3455- auto callNode = dynamic_cast <TCallNode*>(item. Get () );
3455+ auto callNode = item-> GetCallNode ( );
34563456 if (!callNode || callNode->GetOpName () != " AsListMayWarn" ) {
34573457 return new TInvalidBuiltin (pos, TStringBuilder () << name << " entities must be list of strings" );
34583458 }
@@ -3627,14 +3627,14 @@ TNodePtr BuildBuiltinFunc(TContext& ctx, TPosition pos, TString name, const TVec
36273627 if (mustUseNamed && *mustUseNamed) {
36283628 *mustUseNamed = false ;
36293629 YQL_ENSURE (args.size () == 2 );
3630- Y_DEBUG_ABORT_UNLESS (dynamic_cast <TTupleNode*>( args[0 ]. Get () ));
3631- auto posArgs = static_cast <TTupleNode*>( args[0 ]. Get () );
3630+ Y_DEBUG_ABORT_UNLESS (args[0 ]-> GetTupleNode ( ));
3631+ auto posArgs = args[0 ]-> GetTupleNode ( );
36323632 if (posArgs->IsEmpty ()) {
36333633 if (normalizedName == " asstruct" ) {
36343634 return args[1 ];
36353635 } else {
3636- Y_DEBUG_ABORT_UNLESS (dynamic_cast <TStructNode*>( args[1 ]. Get () ));
3637- auto namedArgs = static_cast <TStructNode*>( args[1 ]. Get () );
3636+ Y_DEBUG_ABORT_UNLESS (args[1 ]-> GetStructNode ( ));
3637+ auto namedArgs = args[1 ]-> GetStructNode ( );
36383638 return new TStructTypeNode (pos, namedArgs->GetExprs ());
36393639 }
36403640 }
@@ -3650,9 +3650,9 @@ TNodePtr BuildBuiltinFunc(TContext& ctx, TPosition pos, TString name, const TVec
36503650 *mustUseNamed = false ;
36513651 }
36523652 YQL_ENSURE (args.size () == 2 );
3653- auto posArgs = static_cast <TTupleNode*> (args[0 ]. Get ());
3654- Y_DEBUG_ABORT_UNLESS (dynamic_cast <TTupleNode*>( args[0 ]. Get () ));
3655- Y_DEBUG_ABORT_UNLESS ( dynamic_cast <TStructNode*>( args[1 ]. Get ()) );
3653+ Y_DEBUG_ABORT_UNLESS (args[0 ]-> GetTupleNode ());
3654+ Y_DEBUG_ABORT_UNLESS (args[1 ]-> GetStructNode ( ));
3655+ auto posArgs = args[0 ]-> GetTupleNode ( );
36563656 if (posArgs->GetTupleSize () != 1 ) {
36573657 return new TInvalidBuiltin (pos, TStringBuilder () << " ExpandStruct requires all arguments except first to be named" );
36583658 }
@@ -3737,7 +3737,7 @@ TNodePtr BuildBuiltinFunc(TContext& ctx, TPosition pos, TString name, const TVec
37373737
37383738 if (ns == " datetime2" && name == " Update" ) {
37393739 if (namedArgs) {
3740- TStructNode* castedNamedArgs = dynamic_cast <TStructNode*>(namedArgs. Get () );
3740+ TStructNode* castedNamedArgs = namedArgs-> GetStructNode ( );
37413741 Y_DEBUG_ABORT_UNLESS (castedNamedArgs);
37423742 auto exprs = castedNamedArgs->GetExprs ();
37433743 for (auto & arg : exprs) {
0 commit comments