Auto-sync from Azure-Kusto-Service

This commit is contained in:
Kusto Build System 2024-11-14 17:03:24 +00:00
Родитель 68121a249d
Коммит e6ecbb6cef
5 изменённых файлов: 62 добавлений и 11 удалений

Просмотреть файл

@ -501,7 +501,19 @@ namespace Kusto.Language.Binding
|| (node.ProjectClause != null && _position >= node.ProjectClause.TextStart))
{
_binder._localScope = new LocalScope(_binder._localScope);
_binder.AddGraphMatchPatternDeclarationsToLocalScope(node);
_binder.AddGraphMatchPatternDeclarationsToLocalScope(node.Patterns);
}
}
public override void VisitGraphShortestPathsOperator(GraphShortestPathsOperator node)
{
base.VisitGraphShortestPathsOperator(node);
if ((node.WhereClause != null && _position >= node.WhereClause.TextStart)
|| (node.ProjectClause != null && _position >= node.ProjectClause.TextStart))
{
_binder._localScope = new LocalScope(_binder._localScope);
_binder.AddGraphMatchPatternDeclarationsToLocalScope(node.Patterns);
}
}

Просмотреть файл

@ -574,13 +574,13 @@ namespace Kusto.Language.Binding
}
}
private void BindGraphMatchPatternDeclarations(GraphMatchOperator graphMatch)
private void BindGraphMatchPatternDeclarations(SyntaxNode operatorNode, SyntaxList<SeparatedElement<GraphMatchPattern>> patterns)
{
var graphScope = GetGraphSymbol(graphMatch);
var graphScope = GetGraphSymbol(operatorNode);
var edgeTuple = graphScope != null ? new TupleSymbol(graphScope.EdgeShape.Columns, graphScope.EdgeShape) : TupleSymbol.Empty;
var nodeTuple = graphScope?.NodeShape != null ? new TupleSymbol(graphScope.NodeShape.Columns, graphScope.NodeShape) : TupleSymbol.Empty;
foreach (var pattern in graphMatch.Patterns)
foreach (var pattern in patterns)
{
foreach (var notation in pattern.Element.PatternElements)
{
@ -615,9 +615,9 @@ namespace Kusto.Language.Binding
return new VariableSymbol(edge.Name.SimpleName, new TupleSymbol(newColumns));
}
private void AddGraphMatchPatternDeclarationsToLocalScope(GraphMatchOperator graphMatch)
private void AddGraphMatchPatternDeclarationsToLocalScope(SyntaxList<SeparatedElement<GraphMatchPattern>> patterns)
{
foreach (var pattern in graphMatch.Patterns)
foreach (var pattern in patterns)
{
foreach (var notation in pattern.Element.PatternElements)
{

Просмотреть файл

@ -3911,8 +3911,20 @@ namespace Kusto.Language.Binding
_binder.CheckQueryOperatorParameters(node.Parameters, QueryOperatorParameters.GraphMarkComponentsParameters, diagnostics);
}
var symbol = new GraphSymbol(this.RowScopeOrEmpty);
return new SemanticInfo(symbol, diagnostics);
// get existing graph symbol from left-side of parent pipe operator
var graphSymbol = (node.Parent as PipeExpression)?.Expression?.ResultType is GraphSymbol g
? new GraphSymbol(g.EdgeShape, g.NodeShape)
: new GraphSymbol(this.RowScopeOrEmpty);
// add component-id column to node shape
var componentIdName = node.Parameters.GetParameterNameValue(QueryOperatorParameters.WithComponentId) as string ?? "ComponentId";
var componentIdColumn = new ColumnSymbol(componentIdName, ScalarTypes.Long);
var newNodeShape = graphSymbol.NodeShape != null
? graphSymbol.NodeShape.AddColumns(componentIdColumn)
: new TableSymbol(new[] { componentIdColumn });
graphSymbol = graphSymbol.WithNodeShape(newNodeShape);
return new SemanticInfo(graphSymbol, diagnostics);
}
finally
{

Просмотреть файл

@ -1118,8 +1118,35 @@ namespace Kusto.Language.Binding
_binder._localScope = new LocalScope(oldLocalScope);
try
{
_binder.BindGraphMatchPatternDeclarations(node);
_binder.AddGraphMatchPatternDeclarationsToLocalScope(node);
node.Parameters.Accept(this);
_binder.BindGraphMatchPatternDeclarations(node, node.Patterns);
_binder.AddGraphMatchPatternDeclarationsToLocalScope(node.Patterns);
node.WhereClause?.Accept(this);
node.ProjectClause?.Accept(this);
}
finally
{
_binder._rowScope = oldScope;
_binder._localScope = oldLocalScope;
}
BindNode(node);
}
public override void VisitGraphShortestPathsOperator(GraphShortestPathsOperator node)
{
var oldScope = _binder._rowScope;
var oldLocalScope = _binder._localScope;
_binder._rowScope = null;
_binder._localScope = new LocalScope(oldLocalScope);
try
{
node.Parameters.Accept(this);
_binder.BindGraphMatchPatternDeclarations(node, node.Patterns);
_binder.AddGraphMatchPatternDeclarationsToLocalScope(node.Patterns);
node.WhereClause?.Accept(this);
node.ProjectClause?.Accept(this);

Просмотреть файл

@ -1 +1 @@
11.7.1
11.7.2