@@ -3433,12 +3433,21 @@ private static TypeSymbol SeriesDecomposeAnomaliesResult(CustomReturnTypeContext
34333433 context =>
34343434 {
34353435 if ( context . Arguments . Count > 0
3436- && context . Arguments [ 0 ] is Expression arg
3437- && arg . GetFirstAncestor < GraphMatchOperator > ( ) is GraphMatchOperator graphMatch
3438- && graphMatch . Parent is PipeExpression p
3439- && p . Expression . ResultType is GraphSymbol gs )
3436+ && context . Arguments [ 0 ] is Expression arg )
34403437 {
3441- return new TupleSymbol ( gs . NodeShape ? . Columns ?? new ColumnSymbol [ 0 ] ) ;
3438+ if ( arg . GetFirstAncestor < GraphMatchOperator > ( ) is GraphMatchOperator graphMatch
3439+ && graphMatch . Parent is PipeExpression pGM
3440+ && pGM . Expression . ResultType is GraphSymbol gsGM )
3441+ {
3442+ return new TupleSymbol ( gsGM . NodeShape ? . Columns ?? new ColumnSymbol [ 0 ] ) ;
3443+ }
3444+
3445+ if ( arg . GetFirstAncestor < GraphShortestPathsOperator > ( ) is GraphShortestPathsOperator graphShortestPaths
3446+ && graphShortestPaths . Parent is PipeExpression pSP
3447+ && pSP . Expression . ResultType is GraphSymbol gsSP )
3448+ {
3449+ return new TupleSymbol ( gsSP . NodeShape ? . Columns ?? new ColumnSymbol [ 0 ] ) ;
3450+ }
34423451 }
34433452
34443453 // could not find node schema
@@ -3449,6 +3458,7 @@ private static TypeSymbol SeriesDecomposeAnomaliesResult(CustomReturnTypeContext
34493458 . WithCustomAvailability ( context =>
34503459 {
34513460 var inGM = context . Location . GetFirstAncestor < GraphMatchOperator > ( ) != null ;
3461+ var inSP = context . Location . GetFirstAncestor < GraphShortestPathsOperator > ( ) != null ;
34523462
34533463 // can only occur in first argument of all/any/map functions
34543464 var inGraphLambda =
@@ -3460,7 +3470,7 @@ private static TypeSymbol SeriesDecomposeAnomaliesResult(CustomReturnTypeContext
34603470 && ( context . Location == fc . ArgumentList
34613471 || ( fc . ArgumentList . Expressions . Count > 0
34623472 && fc . ArgumentList . Expressions [ 0 ] . Element . IsAncestorOf ( context . Location ) ) ) ;
3463- return inGM && inGraphLambda ;
3473+ return ( inSP || inGM ) && inGraphLambda ;
34643474 } ) ;
34653475
34663476 public static readonly FunctionSymbol NodeDegreeIn =
@@ -3490,8 +3500,13 @@ private static TypeSymbol SeriesDecomposeAnomaliesResult(CustomReturnTypeContext
34903500
34913501 private static bool InGraphWhereOrProjectClause ( CustomAvailabilityContext context )
34923502 {
3493- return context . Location . GetFirstAncestor < GraphMatchOperator > ( ) is GraphMatchOperator gm &&
3494- ( InClause ( gm . WhereClause ) || InClause ( gm . ProjectClause ) ) ;
3503+ var gmMatch = ( context . Location . GetFirstAncestor < GraphMatchOperator > ( ) is GraphMatchOperator gm &&
3504+ ( InClause ( gm . WhereClause ) || InClause ( gm . ProjectClause ) ) ) ;
3505+
3506+ var spMatch = ( context . Location . GetFirstAncestor < GraphShortestPathsOperator > ( ) is GraphShortestPathsOperator sp &&
3507+ ( InClause ( sp . WhereClause ) || InClause ( sp . ProjectClause ) ) ) ;
3508+
3509+ return gmMatch || spMatch ;
34953510
34963511 bool InClause ( SyntaxNode clause ) =>
34973512 clause != null &&
0 commit comments