-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ingestion was not working properly due to multiple issues so it's being fixed. - The plugin now seamlessly integrates with the VDK connection interface, making it easier to manage DuckDB connections instead of relying on custom DuckDB Connection - The ingestion insertion mechanism fixes: - The ingestion method was not registered (so job_input.send(method='duckdb') was not working) - Change the insertion to be batch and not one by one (which is very slow) - added ingestion tests to cover regressions and verify it's working - Renamed duckdb_file to database (which is what duckdb name for that parameter is) Signed-off-by: Antoni Ivanov <[email protected]>
- Loading branch information
1 parent
dd34c06
commit 6c4a89f
Showing
10 changed files
with
166 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
projects/vdk-plugins/vdk-duckdb/src/vdk/plugin/duckdb/duckdb_connection.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
projects/vdk-plugins/vdk-duckdb/tests/jobs/job-using-a-plugin/10_dummy.py
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
projects/vdk-plugins/vdk-duckdb/tests/jobs/test-duckdb-job/10_create_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
CREATE TABLE stocks (date text, symbol text, price real) |
1 change: 1 addition & 0 deletions
1
projects/vdk-plugins/vdk-duckdb/tests/jobs/test-duckdb-job/20_populate_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
INSERT INTO stocks VALUES ('2020-01-01', 'GOOG', 123.0), ('2020-01-01', 'GOOG', 123.0) |
18 changes: 18 additions & 0 deletions
18
projects/vdk-plugins/vdk-duckdb/tests/jobs/test-duckdb-job/30_ingest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import decimal | ||
|
||
from vdk.api.job_input import IJobInput | ||
|
||
|
||
def run(job_input: IJobInput): | ||
payload = { | ||
"str_col": "str", | ||
"int_col": 2, | ||
"bool_col": False, | ||
"dec_col": decimal.Decimal(1.234), | ||
} | ||
|
||
job_input.send_object_for_ingestion( | ||
payload=payload, destination_table="test_duckdb_table", method="duckdb" | ||
) |
Oops, something went wrong.