FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
age/sql/agtype_typecast.sql at master · apache/age · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
apache
/
age
Public
Notifications
You must be signed in to change notification settings
Fork
522
Star
4.8k
Code
Issues
218
Pull requests
22
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
age
/
sql
/
agtype_typecast.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
263 lines (235 loc) · 7.58 KB
Breadcrumbs
age
/
sql
/
agtype_typecast.sql
Copy path
File metadata and controls
263 lines (235 loc) · 7.58 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
--
--
function for typecasting an agtype value to another agtype value
--
CREATE
FUNCTION
ag_catalog
.agtype_typecast_int(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.agtype_typecast_numeric(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.agtype_typecast_float(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.agtype_typecast_bool(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.agtype_typecast_vertex(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.agtype_typecast_edge(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.agtype_typecast_path(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
--
original VLE function definition
--
S4: emit start_id/end_id as scalar columns to enable transformer rewrite
--
of terminal-edge quals as integer equalities (see PERF_VLE_TERMINAL_QUAL_PLAN).
CREATE
FUNCTION
ag_catalog
.age_vle(
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
OUT edges agtype,
OUT start_id graphid,
OUT end_id graphid)
RETURNS SETOF record
LANGUAGE C
STABLE
CALLED
ON
NULL
INPUT
PARALLEL UNSAFE
--
might be safe
AS
'
MODULE_PATHNAME
'
;
--
This is an overloaded function definition to allow for the VLE local context
--
caching mechanism to coexist with the previous VLE version.
CREATE
FUNCTION
ag_catalog
.age_vle(
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype,
OUT edges agtype,
OUT start_id graphid,
OUT end_id graphid)
RETURNS SETOF record
LANGUAGE C
STABLE
CALLED
ON
NULL
INPUT
PARALLEL UNSAFE
--
might be safe
AS
'
MODULE_PATHNAME
'
;
--
Unweighted (hop-count) shortest path between two vertices, computed over the
--
cached global graph adjacency via BFS. Returns a single path (0 or 1 rows).
--
Argument order mirrors the Cypher shortestPath() pattern
--
(a)-[:type*min_hops..max_hops]->(b):
--
(graph_name, start, end, edge_types, direction, min_hops, max_hops)
CREATE
FUNCTION
ag_catalog
.age_shortest_path(
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype DEFAULT
NULL
,
IN
agtype DEFAULT
NULL
,
IN
agtype DEFAULT
NULL
,
IN
agtype DEFAULT
NULL
)
RETURNS SETOF agtype
LANGUAGE C
STABLE
CALLED
ON
NULL
INPUT
PARALLEL UNSAFE
AS
'
MODULE_PATHNAME
'
;
--
All unweighted shortest paths between two vertices (one path per row).
--
Same argument order as age_shortest_path.
CREATE
FUNCTION
ag_catalog
.age_all_shortest_paths(
IN
agtype,
IN
agtype,
IN
agtype,
IN
agtype DEFAULT
NULL
,
IN
agtype DEFAULT
NULL
,
IN
agtype DEFAULT
NULL
,
IN
agtype DEFAULT
NULL
)
RETURNS SETOF agtype
LANGUAGE C
STABLE
CALLED
ON
NULL
INPUT
PARALLEL UNSAFE
AS
'
MODULE_PATHNAME
'
;
--
function to build an edge for a VLE match
CREATE
FUNCTION
ag_catalog
.age_build_vle_match_edge(agtype, agtype)
RETURNS agtype
LANGUAGE C
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
--
function to create an AGTV_PATH from a VLE_path_container
CREATE
FUNCTION
ag_catalog
.age_materialize_vle_path(agtype)
RETURNS agtype
LANGUAGE C
STABLE
RETURNS
NULL
ON
NULL
INPUT
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
--
function to create an AGTV_ARRAY of edges from a VLE_path_container
CREATE
FUNCTION
ag_catalog
.age_materialize_vle_edges(agtype)
RETURNS agtype
LANGUAGE C
STABLE
RETURNS
NULL
ON
NULL
INPUT
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_match_vle_edge_to_id_qual(variadic
"
any
"
)
RETURNS
boolean
LANGUAGE C
STABLE
RETURNS
NULL
ON
NULL
INPUT
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
--
list functions
CREATE
FUNCTION
ag_catalog
.age_keys(agtype)
RETURNS agtype
LANGUAGE c
STABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_labels(agtype)
RETURNS agtype
LANGUAGE c
STABLE
RETURNS
NULL
ON
NULL
INPUT
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_nodes(agtype)
RETURNS agtype
LANGUAGE c
STABLE
RETURNS
NULL
ON
NULL
INPUT
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_relationships(agtype)
RETURNS agtype
LANGUAGE c
STABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_range(variadic
"
any
"
)
RETURNS agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_unnest(agtype)
RETURNS SETOF agtype
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_vertex_stats(agtype, agtype)
RETURNS agtype
LANGUAGE c
STABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_graph_stats(agtype)
RETURNS agtype
LANGUAGE c
STABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_delete_global_graphs(agtype)
RETURNS
boolean
LANGUAGE c
STABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.create_complete_graph(graph_name name, nodes
int
,
edge_label name,
node_label name
=
NULL
)
RETURNS void
LANGUAGE c
CALLED
ON
NULL
INPUT
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_create_barbell_graph(graph_name name,
graph_size
int
,
bridge_size
int
,
node_label name
=
NULL
,
node_properties agtype
=
NULL
,
edge_label name
=
NULL
,
edge_properties agtype
=
NULL
)
RETURNS void
LANGUAGE c
CALLED
ON
NULL
INPUT
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
CREATE
FUNCTION
ag_catalog
.age_prepare_cypher(cstring, cstring)
RETURNS
boolean
LANGUAGE c
STABLE
PARALLEL SAFE
AS
'
MODULE_PATHNAME
'
;
--
--
End
--
Back
|
FazBrowse Home
|
New Git URL