Skip to content

Commit b965a37

Browse files
temp
1 parent 074cb03 commit b965a37

File tree

2 files changed

+400
-79
lines changed

2 files changed

+400
-79
lines changed

singlestoredb/fusion/handlers/stage.py

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212

1313
class ShowStageFilesHandler(SQLHandler):
1414
"""
15-
SHOW STAGE FILES [ in_group ]
15+
SHOW STAGE FILES [ in_deployment ]
1616
[ at_path ] [ <like> ]
1717
[ <order-by> ]
1818
[ <limit> ] [ recursive ] [ extended ];
1919
20-
# Workspace group
21-
in_group = IN GROUP { group_id | group_name }
20+
# Deployment
21+
in_deployment = IN { deployment_id | deployment_name }
2222
23-
# ID of group
24-
group_id = ID '<group-id>'
23+
# ID of deployment
24+
deployment_id = ID '<deployment-id>'
2525
26-
# Name of group
27-
group_name = '<group-name>'
26+
# Name of deployment
27+
deployment_name = '<deployment-name>'
2828
2929
# Stage path to list
3030
at_path = AT '<path>'
@@ -44,10 +44,10 @@ class ShowStageFilesHandler(SQLHandler):
4444
4545
Arguments
4646
---------
47-
* ``<group_id>``: The ID of the workspace group in which
48-
the Stage is attached.
49-
* ``<group_name>``: The name of the workspace group in which
47+
* ``<deployment_id>``: The ID of the deployment in which
5048
the Stage is attached.
49+
* ``<deployment_name>``: The name of the deployment in which
50+
which the Stage is attached.
5151
* ``<path>``: A path in the Stage.
5252
* ``<pattern>``: A pattern similar to SQL LIKE clause.
5353
Uses ``%`` as the wildcard character.
@@ -62,8 +62,8 @@ class ShowStageFilesHandler(SQLHandler):
6262
key. By default, the results are sorted in the ascending order.
6363
* The ``AT PATH`` clause specifies the path in the Stage to list
6464
the files from.
65-
* The ``IN GROUP`` clause specifies the ID or the name of the
66-
workspace group in which the Stage is attached.
65+
* The ``IN`` clause specifies the ID or the name of the
66+
deployment in which the Stage is attached.
6767
* Use the ``RECURSIVE`` clause to list the files recursively.
6868
* To return more information about the files, use the ``EXTENDED``
6969
clause.
@@ -72,12 +72,12 @@ class ShowStageFilesHandler(SQLHandler):
7272
--------
7373
The following command lists the files at a specific path::
7474
75-
SHOW STAGE FILES IN GROUP 'wsg1' AT PATH "/data/";
75+
SHOW STAGE FILES IN 'wsg1' AT PATH "/data/";
7676
7777
The following command lists the files recursively with
7878
additional information::
7979
80-
SHOW STAGE FILES IN GROUP 'wsg1' RECURSIVE EXTENDED;
80+
SHOW STAGE FILES IN 'wsg1' RECURSIVE EXTENDED;
8181
8282
See Also
8383
--------
@@ -132,20 +132,20 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
132132
class UploadStageFileHandler(SQLHandler):
133133
"""
134134
UPLOAD FILE TO STAGE stage_path
135-
[ in_group ]
135+
[ in_deployment ]
136136
FROM local_path [ overwrite ];
137137
138138
# Path to stage file
139139
stage_path = '<stage-path>'
140140
141-
# Workspace group
142-
in_group = IN GROUP { group_id | group_name }
141+
# Deployment
142+
in_deployment = IN { deployment_id | deployment_name }
143143
144-
# ID of group
145-
group_id = ID '<group-id>'
144+
# ID of deployment
145+
deployment_id = ID '<deployment-id>'
146146
147-
# Name of group
148-
group_name = '<group-name>'
147+
# Name of deployment
148+
deployment_name = '<deployment-name>'
149149
150150
# Path to local file
151151
local_path = '<local-path>'
@@ -163,16 +163,16 @@ class UploadStageFileHandler(SQLHandler):
163163
Arguments
164164
---------
165165
* ``<stage_path>``: The path in the Stage where the file is uploaded.
166-
* ``<group_id>``: The ID of the workspace group in which the Stage
166+
* ``<deployment_id>``: The ID of the deployment in which the Stage
167167
is attached.
168-
* ``<group_name>``: The name of the workspace group in which the
169-
Stage is attached.
168+
* ``<deployment_name>``: The name of the deployment in which
169+
which the Stage is attached.
170170
* ``<local-path>``: The path to the file to upload in the local
171171
directory.
172172
173173
Remarks
174174
-------
175-
* The ``IN GROUP`` clause specifies the ID or the name of the workspace
175+
* The ``IN`` clause specifies the ID or the name of the workspace
176176
group in which the Stage is attached.
177177
* If the ``OVERWRITE`` clause is specified, any existing file at the
178178
specified path in the Stage is overwritten.
@@ -182,7 +182,7 @@ class UploadStageFileHandler(SQLHandler):
182182
The following command uploads a file to a Stage and overwrites any
183183
existing files at the specified path::
184184
185-
UPLOAD FILE TO STAGE '/data/stats.csv' IN GROUP 'wsg1'
185+
UPLOAD FILE TO STAGE '/data/stats.csv' IN 'wsg1'
186186
FROM '/tmp/user/stats.csv' OVERWRITE;
187187
188188
See Also
@@ -206,22 +206,22 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
206206
class DownloadStageFileHandler(SQLHandler):
207207
"""
208208
DOWNLOAD STAGE FILE stage_path
209-
[ in_group ]
209+
[ in_deployment ]
210210
[ local_path ]
211211
[ overwrite ]
212212
[ encoding ];
213213
214214
# Path to stage file
215215
stage_path = '<stage-path>'
216216
217-
# Workspace group
218-
in_group = IN GROUP { group_id | group_name }
217+
# Deployment
218+
in_deployment = IN { deployment_id | deployment_name }
219219
220-
# ID of group
221-
group_id = ID '<group-id>'
220+
# ID of deployment
221+
deployment_id = ID '<deployment-id>'
222222
223-
# Name of group
224-
group_name = '<group-name>'
223+
# Name of deployment
224+
deployment_name = '<deployment-name>'
225225
226226
# Path to local file
227227
local_path = TO '<local-path>'
@@ -242,10 +242,10 @@ class DownloadStageFileHandler(SQLHandler):
242242
Arguments
243243
---------
244244
* ``<stage_path>``: The path to the file to download in a Stage.
245-
* ``<group_id>``: The ID of the workspace group in which the
246-
Stage is attached.
247-
* ``<group_name>``: The name of the workspace group in which the
245+
* ``<deployment_id>``: The ID of the deployment in which the
248246
Stage is attached.
247+
* ``<deployment_name>``: The name of the deployment in which
248+
which the Stage is attached.
249249
* ``<encoding>``: The encoding to apply to the downloaded file.
250250
* ``<local-path>``: Specifies the path in the local directory
251251
where the file is downloaded.
@@ -254,8 +254,8 @@ class DownloadStageFileHandler(SQLHandler):
254254
-------
255255
* If the ``OVERWRITE`` clause is specified, any existing file at
256256
the download location is overwritten.
257-
* The ``IN GROUP`` clause specifies the ID or the name of the
258-
workspace group in which the Stage is attached.
257+
* The ``IN`` clause specifies the ID or the name of the
258+
deployment in which the Stage is attached.
259259
* By default, files are downloaded in binary encoding. To view
260260
the contents of the file on the standard output, use the
261261
``ENCODING`` clause and specify an encoding.
@@ -267,12 +267,12 @@ class DownloadStageFileHandler(SQLHandler):
267267
The following command displays the contents of the file on the
268268
standard output::
269269
270-
DOWNLOAD STAGE FILE '/data/stats.csv' IN GROUP 'wsgroup1' ENCODING 'utf8';
270+
DOWNLOAD STAGE FILE '/data/stats.csv' IN 'wsgroup1' ENCODING 'utf8';
271271
272272
The following command downloads a file to a specific location and
273273
overwrites any existing file with the name ``stats.csv`` on the local storage::
274274
275-
DOWNLOAD STAGE FILE '/data/stats.csv' IN GROUP 'wsgroup1'
275+
DOWNLOAD STAGE FILE '/data/stats.csv' IN 'wsgroup1'
276276
TO '/tmp/data.csv' OVERWRITE;
277277
278278
See Also
@@ -309,19 +309,19 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
309309
class DropStageFileHandler(SQLHandler):
310310
"""
311311
DROP STAGE FILE stage_path
312-
[ in_group ];
312+
[ in_deployment ];
313313
314314
# Path to stage file
315315
stage_path = '<stage-path>'
316316
317-
# Workspace group
318-
in_group = IN GROUP { group_id | group_name }
317+
# Deployment
318+
in_deployment = IN { deployment_id | deployment_name }
319319
320-
# ID of group
321-
group_id = ID '<group-id>'
320+
# ID of deployment
321+
deployment_id = ID '<deployment-id>'
322322
323-
# Name of group
324-
group_name = '<group-name>'
323+
# Name of deployment
324+
deployment_name = '<deployment-name>'
325325
326326
Description
327327
-----------
@@ -333,22 +333,22 @@ class DropStageFileHandler(SQLHandler):
333333
Arguments
334334
---------
335335
* ``<stage_path>``: The path to the file to delete in a Stage.
336-
* ``<group_id>``: The ID of the workspace group in which the
336+
* ``<deployment_id>``: The ID of the deployment in which the
337337
Stage is attached.
338-
* ``<group_name>``: The name of the workspace group in which
339-
the Stage is attached.
338+
* ``<deployment_name>``: The name of the deployment in which
339+
which the Stage is attached.
340340
341341
Remarks
342342
-------
343-
* The ``IN GROUP`` clause specifies the ID or the name of the
344-
workspace group in which the Stage is attached.
343+
* The ``IN`` clause specifies the ID or the name of the
344+
deployment in which the Stage is attached.
345345
346346
Example
347347
--------
348348
The following command deletes a file from a Stage attached to
349-
a workspace group named **wsg1**::
349+
a deployment named **wsg1**::
350350
351-
DROP STAGE FILE '/data/stats.csv' IN GROUP 'wsg1';
351+
DROP STAGE FILE '/data/stats.csv' IN 'wsg1';
352352
353353
See Also
354354
--------
@@ -368,20 +368,20 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
368368
class DropStageFolderHandler(SQLHandler):
369369
"""
370370
DROP STAGE FOLDER stage_path
371-
[ in_group ]
371+
[ in_deployment ]
372372
[ recursive ];
373373
374374
# Path to stage folder
375375
stage_path = '<stage-path>'
376376
377-
# Workspace group
378-
in_group = IN GROUP { group_id | group_name }
377+
# Deployment
378+
in_deployment = IN { deployment_id | deployment_name }
379379
380-
# ID of group
381-
group_id = ID '<group-id>'
380+
# ID of deployment
381+
deployment_id = ID '<deployment-id>'
382382
383-
# Name of group
384-
group_name = '<group-name>'
383+
# Name of deployment
384+
deployment_name = '<deployment-name>'
385385
386386
# Should folers be deleted recursively?
387387
recursive = RECURSIVE
@@ -396,10 +396,10 @@ class DropStageFolderHandler(SQLHandler):
396396
Arguments
397397
---------
398398
* ``<stage_path>``: The path to the folder to delete in a Stage.
399-
* ``<group_id>``: The ID of the workspace group in which the
400-
Stage is attached.
401-
* ``<group_name>``: The name of the workspace group in which the
399+
* ``<deployment_id>``: The ID of the deployment in which the
402400
Stage is attached.
401+
* ``<deployment_name>``: The name of the deployment in which
402+
which the Stage is attached.
403403
404404
Remarks
405405
-------
@@ -409,9 +409,9 @@ class DropStageFolderHandler(SQLHandler):
409409
Example
410410
-------
411411
The following command recursively deletes a folder from a Stage
412-
attached to a workspace group named **wsg1**::
412+
attached to a deployment named **wsg1**::
413413
414-
DROP STAGE FOLDER '/data/' IN GROUP 'wsg1' RECURSIVE;
414+
DROP STAGE FOLDER '/data/' IN 'wsg1' RECURSIVE;
415415
416416
See Also
417417
--------
@@ -434,17 +434,17 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
434434
class CreateStageFolderHandler(SQLHandler):
435435
"""
436436
CREATE STAGE FOLDER stage_path
437-
[ in_group ]
437+
[ in_deployment ]
438438
[ overwrite ];
439439
440-
# Workspace group
441-
in_group = IN GROUP { group_id | group_name }
440+
# Deployment
441+
in_deployment = IN { deployment_id | deployment_name }
442442
443-
# ID of group
444-
group_id = ID '<group-id>'
443+
# ID of deployment
444+
deployment_id = ID '<deployment-id>'
445445
446-
# Name of group
447-
group_name = '<group-name>'
446+
# Name of deployment
447+
deployment_name = '<deployment-name>'
448448
449449
# Path to stage folder
450450
stage_path = '<stage-path>'
@@ -460,24 +460,24 @@ class CreateStageFolderHandler(SQLHandler):
460460
---------
461461
* ``<stage_path>``: The path in a Stage where the folder
462462
is created. The path must end with a trailing slash (/).
463-
* ``<group_id>``: The ID of the workspace group in which
463+
* ``<deployment_id>``: The ID of the deployment in which
464464
the Stage is attached.
465-
* ``<group_name>``: The name of the workspace group in
465+
* ``<deployment_name>``: The name of the deployment in which
466466
which the Stage is attached.
467467
468468
Remarks
469469
-------
470470
* If the ``OVERWRITE`` clause is specified, any existing
471471
folder at the specified path is overwritten.
472-
* The ``IN GROUP`` clause specifies the ID or the name of
473-
the workspace group in which the Stage is attached.
472+
* The ``IN`` clause specifies the ID or the name of
473+
the deployment in which the Stage is attached.
474474
475475
Example
476476
-------
477477
The following command creates a folder in a Stage attached
478-
to a workspace group named **wsg1**::
478+
to a deployment named **wsg1**::
479479
480-
CREATE STAGE FOLDER `/data/csv/` IN GROUP 'wsg1';
480+
CREATE STAGE FOLDER `/data/csv/` IN 'wsg1';
481481
482482
"""
483483

0 commit comments

Comments
 (0)