Insert statement execution in Distributed Syntax V2 query

Can anyone please give an example , how can we execute Insert Statement in a distributed query of Syntax v2 version?

@praneeth.kumar This query here is declaring v2 syntax although I’m not really using multi-hops.

Have you tried a query where the INSERT INTO wasn’t working as expected? Or was your questions around a basic example that uses v2 and INSERT INTO?

CREATE DISTRIBUTED QUERY myQuery(/* Parameters here */) FOR GRAPH myGraph SYNTAX v2 {   
    MapAccum<STRING,VERTEX<a1>> @@mapV;
    seed(a1) = {a1.*};
    seed2(a2) ={a2.*};

      S1 = SELECT s 
           FROM seed:s 
           ACCUM @@mapV += (s.attr1->s);
      
      S2 = SELECT tgt 
               FROM seed2:tgt 
               ACCUM 
                  IF @@mapV.containsKey(tgt.attr1) THEN
                     INSERT INTO MY_EDGE (FROM, TO) VALUES (@@mapV.get(tgt.attr1), tgt)
            END;
}

Hi Jon,
yes,I Tried to use multi hop query patterns along with Insert statement in distributed syntax and GraphStudio is throwing the error that this combination of multi hop pattern with insert is not supported.
But if i use only the insert statement with no multi hop query pattern under v2, the query doesn’t give any error.

Attached the ss of error below

sample:
CREATE DISTRIBUTED QUERY myQuery(/* Parameters here */) FOR GRAPH myGraph SYNTAX v2 {
SumAccum @accum;
Res = SELECT test FROM a-(edge1>:e1)-b-(edge2>:e2)-c:test
ACCUM
test.@accum += b.attr1;
InsertResult = SELECT a FROM Res:a
ACCUM
INSERT INTO SomeVertex VALUES (id, " ", value2(a.@accum));
}