printExprcontributes one key-value pair to the PRINT statement's JSON object result. The optional AS clause sets the JSON key for the expression, overriding the default key (explained below).
printExprmay be one of the following:
UNION INTERSECT MINUS
+ - * / . %Bit:
<< >> & |
printExprincludes the optional AS name clause, then the name sets the key for that expression in the JSON output. Otherwise, the following rules determine the key: If the expression is simply a single variable (local variable, global variable, global accumulator, or vertex set variable), then the key is the variable name. Also, for a vertex expression set, the key is the vertex set variable name. Otherwise, the key is the entire expression, represented as a string.
DOUBLEvalue, and a
INTvalue. For container accumulators, simply consider whether the output is a list, set, bag, or map.
GroupByAccum: list of tuples
PRINT C[C.country]prints the vertex set variable C, except that the "attributes" field will contain only "country", instead of 3 fields.
PRINT C[C.id+"_ex", [email protected]+1]prints the vertex set variable C, except that the "attributes" field contains the following:
TO_CSVfollowed by the
FILE. If the
TO_CSVfeature only supports data with a simple one- or two-dimension structure.
FILE printlnstatement writes data to a
FILEobject. Unlike the
FILE printlnstatement can be either a query-body level statement or a DML-sub-statement.
printlnis a method of a FILE object variable. The
printlnstatement can be used either at the query-body level or a DML-sub-statement, e.g., within the ACCUM clause of a SELECT block. Each time
printlnis called, it adds one new line of values to the
FILEobject, and then to the corresponding file.
printlnfunction can print any expression that can be printed by a
printlnstatement has a list of expressions to print, it will produce a comma-separated list of values. If an expression refers to a list or set, then the output will be a list of values separated by spaces.
TO_CSVoption, so there is no JSON output to the console.
FILEobject. In the query definition, the line
"header"is printed first, followed by the
printlnstatements in the
"footer"is printed last. The output in the file follows this order because the order of query-body level statements is maintained in the output.
ACCUMclause itself, the order of the
printlnstatements is not guranteed.
RETURNstatement can be any base type or accumulator type, but must be the same type as indicated by the
RETURNSclause of the subquery.