relate-executor 1.1.0

In-memory graph and Cypher physical executor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
//! `Scalar`-category function rows: the single-value accessors, entity
//! accessors and value conversions, plus the `Path`-classified
//! shortest-path pair and the `UUID` family (CIP-84's category vocabulary).

use super::{FunctionCategory, FunctionMeta};
use crate::catalog_meta::{DeprecatedBy, ProcArgMeta};

pub(super) const ENTRIES: &[FunctionMeta] = &[
    FunctionMeta {
        name: "id",
        category: FunctionCategory::Scalar,
        description: "Returns the id of a `NODE` or `RELATIONSHIP`.",
        special_signature: None,
        args: &[
            ProcArgMeta::described("input", "A node or a relationship.", "NODE | RELATIONSHIP"),
        ],
        return_type: "INTEGER",
        deprecated_by: Some(DeprecatedBy::identified(
            "elementId",
            "elementId or consider using an application-generated id",
        )),
    },
    FunctionMeta::described(
        "elementId",
        FunctionCategory::Scalar,
        "Returns the element id of a `NODE` or `RELATIONSHIP`.",
        &[
            ProcArgMeta::described(
                "input",
                "An element id of a node or a relationship.",
                "NODE | RELATIONSHIP",
            ),
        ],
        "STRING",
    ),
    FunctionMeta::described(
        "type",
        FunctionCategory::Scalar,
        "Returns a `STRING` representation of the `RELATIONSHIP` type.",
        &[
            ProcArgMeta::described("input", "A relationship.", "RELATIONSHIP"),
        ],
        "STRING",
    ),
    FunctionMeta::described(
        "properties",
        FunctionCategory::Scalar,
        "Returns a `MAP` containing all the properties of a `NODE`, `RELATIONSHIP` or `MAP`.",
        &[
            ProcArgMeta::described(
                "input",
                "An entity to return the properties from.",
                "NODE | RELATIONSHIP | MAP",
            ),
        ],
        "MAP",
    ),
    FunctionMeta::described(
        "size",
        FunctionCategory::Scalar,
        "Returns the number of items in a `LIST<ANY>`, the number of Unicode characters in a `STRING` or the dimension of a `VECTOR`.",
        &[
            ProcArgMeta::described(
                "input",
                "A value whose length is to be calculated.",
                "STRING | VECTOR | LIST<ANY>",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "length",
        FunctionCategory::Scalar,
        "Returns the length of a `PATH`.",
        &[
            ProcArgMeta::described(
                "input",
                "A path whose relationships will be counted.",
                "PATH",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "head",
        FunctionCategory::Scalar,
        "Returns the first element in a `LIST<ANY>`.",
        &[
            ProcArgMeta::described(
                "list",
                "A list from which the first element will be returned.",
                "LIST<ANY>",
            ),
        ],
        "ANY",
    ),
    FunctionMeta::described(
        "last",
        FunctionCategory::Scalar,
        "Returns the last element in a `LIST<ANY>`.",
        &[
            ProcArgMeta::described(
                "list",
                "A list from which the last element will be returned.",
                "LIST<ANY>",
            ),
        ],
        "ANY",
    ),
    FunctionMeta {
        name: "coalesce",
        category: FunctionCategory::Scalar,
        description: "Returns the first non-null value in a list of expressions.",
        special_signature: Some("(input :: ANY ...) :: ANY"),
        args: &[
            ProcArgMeta::described(
                "input",
                "If this is the first non-`NULL` value, it will be returned.",
                "ANY",
            ),
        ],
        return_type: "ANY",
        deprecated_by: None,
    },
    FunctionMeta::described(
        "uuid",
        FunctionCategory::Uuid,
        "Returns a randomly generated `UUID`.",
        &[],
        "UUID",
    ),
    FunctionMeta::described(
        "uuid",
        FunctionCategory::Uuid,
        "Converts a `STRING` value to a `UUID`.",
        &[
            ProcArgMeta::described(
                "name",
                "The `STRING` must be 32 hexadecimal digits displayed in 5 groups, separated by 4 hyphens.",
                "STRING",
            ),
        ],
        "UUID",
    ),
    FunctionMeta::described(
        "uuid",
        FunctionCategory::Uuid,
        "Converts two `INTEGER` values to a `UUID`.",
        &[
            ProcArgMeta::described("mostSigBits", "The most significant bits.", "INTEGER"),
            ProcArgMeta::described("leastSigBits", "The least significant bits.", "INTEGER"),
        ],
        "UUID",
    ),
    FunctionMeta::described(
        "uuid.mostSignificantBits",
        FunctionCategory::Uuid,
        "Returns the most significant bits from the given `UUID`.",
        &[
            ProcArgMeta::described(
                "uuid",
                "The `UUID` to return the most significant bits from.",
                "UUID",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "uuid.leastSignificantBits",
        FunctionCategory::Uuid,
        "Returns the least significant bits from the given `UUID`.",
        &[
            ProcArgMeta::described(
                "uuid",
                "The `UUID` to return the least significant bits from.",
                "UUID",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "randomUUID",
        FunctionCategory::Scalar,
        "Generates a random UUID.",
        &[],
        "STRING",
    ),
    FunctionMeta::described(
        "toInteger",
        FunctionCategory::Scalar,
        "Converts a `BOOLEAN`, `STRING`, `INTEGER` or `FLOAT` value to an `INTEGER` value. For `BOOLEAN` values, true is defined to be 1 and false is defined to be 0.",
        &[
            ProcArgMeta::described(
                "input",
                "A value to be converted into an integer.",
                "BOOLEAN | STRING | INTEGER | FLOAT",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "toFloat",
        FunctionCategory::Scalar,
        "Converts a `STRING`, `INTEGER` or `FLOAT` value to a `FLOAT` value.",
        &[
            ProcArgMeta::described(
                "input",
                "A value to be converted into a float.",
                "STRING | INTEGER | FLOAT",
            ),
        ],
        "FLOAT",
    ),
    FunctionMeta::described(
        "toBoolean",
        FunctionCategory::Scalar,
        "Converts a `BOOLEAN`, `STRING` or `INTEGER` value to a `BOOLEAN` value. For `INTEGER` values, 0 is defined to be false and any other `INTEGER` is defined to be true.",
        &[
            ProcArgMeta::described(
                "input",
                "A value to be converted into a boolean.",
                "BOOLEAN | STRING | INTEGER",
            ),
        ],
        "BOOLEAN",
    ),
    FunctionMeta::described(
        "toBooleanOrNull",
        FunctionCategory::Scalar,
        "Converts a value to a `BOOLEAN` value, or null if the value cannot be converted.",
        &[
            ProcArgMeta::described(
                "input",
                "A value to be converted into a boolean or null.",
                "ANY",
            ),
        ],
        "BOOLEAN",
    ),
    FunctionMeta::described(
        "toFloatOrNull",
        FunctionCategory::Scalar,
        "Converts a value to a `FLOAT` value, or null if the value cannot be converted.",
        &[
            ProcArgMeta::described(
                "input",
                "A value to be converted into a float or null.",
                "ANY",
            ),
        ],
        "FLOAT",
    ),
    FunctionMeta::described(
        "toIntegerOrNull",
        FunctionCategory::Scalar,
        "Converts a value to an `INTEGER` value, or null if the value cannot be converted.",
        &[
            ProcArgMeta::described(
                "input",
                "A value to be converted into an integer or null.",
                "ANY",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "startNode",
        FunctionCategory::Scalar,
        "Returns the start `NODE` of a `RELATIONSHIP`.",
        &[
            ProcArgMeta::described("input", "A relationship.", "RELATIONSHIP"),
        ],
        "NODE",
    ),
    FunctionMeta::described(
        "endNode",
        FunctionCategory::Scalar,
        "Returns the end `NODE` of a `RELATIONSHIP`.",
        &[
            ProcArgMeta::described("input", "A relationship.", "RELATIONSHIP"),
        ],
        "NODE",
    ),
    FunctionMeta::described(
        "timestamp",
        FunctionCategory::Scalar,
        "Returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC",
        &[],
        "INTEGER",
    ),
    FunctionMeta::described(
        "nullIf",
        FunctionCategory::Scalar,
        "Returns null if the two given parameters are equivalent, otherwise returns the value of the first parameter.",
        &[
            ProcArgMeta::described(
                "v1",
                "A first value to be returned if the second value is not equivalent.",
                "ANY",
            ),
            ProcArgMeta::described(
                "v2",
                "A second value against which the first value is compared.",
                "ANY",
            ),
        ],
        "ANY",
    ),
    FunctionMeta::described(
        "valueType",
        FunctionCategory::Scalar,
        "Returns a `STRING` representation of the most precise value type that the given expression evaluates to.",
        &[
            ProcArgMeta::described("input", "A value to return the type of.", "ANY"),
        ],
        "STRING",
    ),
    FunctionMeta::described(
        "linenumber",
        FunctionCategory::Scalar,
        "Returns the line number that LOAD CSV is currently using.",
        &[],
        "INTEGER",
    ),
    FunctionMeta::described(
        "file",
        FunctionCategory::Scalar,
        "Returns the absolute path of the file that LOAD CSV is using.",
        &[],
        "STRING",
    ),
    FunctionMeta::described(
        "cardinality",
        FunctionCategory::Scalar,
        "Returns the number of keys in a `MAP`, the number of elements in a `LIST`, or the number of nodes and relationships in a `PATH`.",
        &[
            ProcArgMeta::described(
                "input",
                "A map, list or path whose cardinality is to be calculated.",
                "MAP | LIST<ANY> | PATH",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "char_length",
        FunctionCategory::Scalar,
        "Returns the number of Unicode characters in a `STRING`.",
        &[
            ProcArgMeta::described(
                "input",
                "A string value whose length in characters is to be calculated.",
                "STRING",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "character_length",
        FunctionCategory::Scalar,
        "Returns the number of Unicode characters in a `STRING`.",
        &[
            ProcArgMeta::described(
                "input",
                "A string value whose length in characters is to be calculated.",
                "STRING",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "path_length",
        FunctionCategory::Scalar,
        "Returns the length of a `PATH`.",
        &[
            ProcArgMeta::described(
                "input",
                "A path whose relationships will be counted.",
                "PATH",
            ),
        ],
        "INTEGER",
    ),
    FunctionMeta::described(
        "shortestPath",
        FunctionCategory::Path,
        "Returns the shortest path for a given path pattern with a variable-length relationship. If multiple shortest paths exist, one is returned non-deterministically.",
        &[
            ProcArgMeta::described(
                "pathPattern",
                "A path pattern containing a variable-length relationship.",
                "PATH",
            ),
        ],
        "PATH",
    ),
    FunctionMeta::described(
        "allShortestPaths",
        FunctionCategory::List,
        "Returns all shortest paths for a given path pattern with a variable-length relationship.",
        &[
            ProcArgMeta::described(
                "pathPattern",
                "A path pattern containing a variable-length relationship.",
                "PATH",
            ),
        ],
        "LIST<PATH>",
    ),
];