Skip to content

Commit 01ce9da

Browse files
abhizerryzhyk
authored andcommitted
py: update demos to use register_output_view
Signed-off-by: Abhinav Gyawali <22275402+abhizer@users.noreply.github.com>
1 parent 2e26a3a commit 01ce9da

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- API: Demos are supplied by specifying a local directory rather than URLs,
2121
and the demos endpoint returns the demos directly.
2222
([#1890](https://github.com/feldera/feldera/pull/1890))
23+
- [Python] Support for `register_local_view` and rename`register_view`
24+
to `register_output_view` ([#1884](https://github.com/feldera/feldera/pull/1884))
2325

2426
## [0.18.0] - 2024-06-11
2527

demo/project_demo10-FraudDetectionDeltaLake/notebook.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
" window_30_day AS (PARTITION BY t.cc_num ORDER BY unix_time RANGE BETWEEN 2592000 PRECEDING AND CURRENT ROW);\n",
187187
" \"\"\"\n",
188188
"\n",
189-
" sql.register_view(\"FEATURE\", query)\n",
189+
" sql.register_output_view(\"FEATURE\", query)\n",
190190
" return sql\n"
191191
]
192192
},

demo/project_demo10-FraudDetectionDeltaLake/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def build_program(client, pipeline_name):
278278
window_30_day AS (PARTITION BY t.cc_num ORDER BY unix_time RANGE BETWEEN 2592000 PRECEDING AND CURRENT ROW);
279279
"""
280280

281-
sql.register_view("FEATURE", query)
281+
sql.register_output_view("FEATURE", query)
282282
return sql
283283

284284
# Split input dataframe into train and test sets

docs/use_cases/fraud_detection/fraud_detection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def build_program(client, pipeline_name):
181181
window_30_day AS (PARTITION BY t.cc_num ORDER BY unix_time RANGE BETWEEN 2592000 PRECEDING AND CURRENT ROW);
182182
"""
183183

184-
sql.register_view("FEATURE", query)
184+
sql.register_output_view("FEATURE", query)
185185
return sql
186186
```
187187

python/docs/examples.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ to to call :meth:`.SQLContext.listen` before you call
4545
# here, we provide a query, that gets registered as a view in feldera
4646
# this query will be executed on the data in the table
4747
query = f"SELECT name, ((science + maths + art) / 3) as average FROM {TBL_NAMES[0]} JOIN {TBL_NAMES[1]} on id = student_id ORDER BY average DESC"
48-
sql.register_view(view_name, query)
48+
sql.register_output_view(view_name, query)
4949
5050
# connect the source (a pandas Dataframe in this case) to the tables
5151
sql.connect_source_pandas(TBL_NAMES[0], df_students)
@@ -129,7 +129,7 @@ More on Kafka as the output connector at: https://www.feldera.com/docs/connector
129129
130130
sql = SQLContext('kafka', 'http://localhost:8080').get_or_create()
131131
sql.register_table(TABLE_NAME, SQLSchema({"id": "INT NOT NULL PRIMARY KEY"}))
132-
sql.register_view(VIEW_NAME, f"SELECT COUNT(*) as num_rows FROM {TABLE_NAME}")
132+
sql.register_output_view(VIEW_NAME, f"SELECT COUNT(*) as num_rows FROM {TABLE_NAME}")
133133
134134
source_config = {
135135
"topics": ["example_topic"],
@@ -183,7 +183,7 @@ More on the HTTP GET connector at: https://www.feldera.com/docs/connectors/sourc
183183
184184
sql.register_table(TBL_NAME, SQLSchema({"id": "INT", "name": "STRING"}))
185185
186-
sql.register_view(VIEW_NAME, f"SELECT * FROM {TBL_NAME}")
186+
sql.register_output_view(VIEW_NAME, f"SELECT * FROM {TBL_NAME}")
187187
188188
path = "https://feldera-basics-tutorial.s3.amazonaws.com/part.json"
189189

python/docs/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Key Concepts
8282
8383
# Register Views based on your queries
8484
query = f"SELECT * FROM {tbl_name}"
85-
sql.register_view(view_name, query)
85+
sql.register_output_view(view_name, query)
8686
8787
# name for this connector
8888
in_con = "delta_input_conn"

0 commit comments

Comments
 (0)