Skip to content

Commit 099e4ed

Browse files
committed
basic_example_v1: added comments on TablePathPrefix usage to avoid confusion
1 parent 0c9e662 commit 099e4ed

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

examples/basic_example_v1/basic_example.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
import ydb
55
import basic_example_data
66

7+
# Table path prefix allows to put the working tables into the specific directory
8+
# inside the YDB database. Putting `PRAGMA TablePathPrefix("some/path")`
9+
# at the beginning of the query allows to reference the tables through
10+
# their names "under" the specified directory.
11+
#
12+
# TablePathPrefix can be defined as an absolute path (starting with slash),
13+
# or as a relative path. Absolute path has to be started with the current
14+
# database location.
15+
#
16+
# https://ydb.tech/ru/docs/yql/reference/syntax/pragma#table-path-prefix
17+
718
FillDataQuery = """PRAGMA TablePathPrefix("{}");
819
920
DECLARE $seriesData AS List<Struct<
@@ -310,6 +321,8 @@ def run(endpoint, database, path):
310321

311322
ensure_path_exists(driver, database, path)
312323

324+
# absolute path - prefix to the table's names,
325+
# including the database location
313326
full_path = os.path.join(database, path)
314327

315328
create_tables(pool, full_path)

0 commit comments

Comments
 (0)