-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Synapse Destination #677
Conversation
✅ Deploy Preview for dlt-hub-docs canceled.
|
@@ -10,6 +10,7 @@ | |||
from dlt.destinations.sql_client import SqlClientBase | |||
from dlt.destinations.job_impl import EmptyLoadJob | |||
from dlt.destinations.job_client_impl import SqlJobClientWithStaging | |||
from tests.utils import ACTIVE_DESTINATIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can't imort test code into production code...
else: | ||
# Replace the , with ; | ||
insert_sql.append("".join(chunk).strip()[:-1] + ";\n") | ||
if "synapse" in ACTIVE_DESTINATIONS: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you need a different behavior here for synapse, you need to extend or replace this load job for synapse or somehow manage this with the capabilities object. this code is depended on some var that is only available in the test environment and will not work in production
if not tables: | ||
return | ||
# If a transaction is active, commit it | ||
if not self._conn.autocommit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think you need this kind of code here. In which case is a transaction avtive when you drop the dataset?
def _drop_views(self, *tables: str) -> None: | ||
# Save the current autocommit state | ||
# If a transaction is active, commit it | ||
if not self._conn.autocommit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
def native_connection(self) -> pyodbc.Connection: | ||
return self._conn | ||
|
||
def drop_dataset(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to check if each table exists? can't you just drop all tables in the dataset like it is done in the mssql client?
Description
Adds the Synapse destination to the dlt destinations list.
This destination code is based off of the mssql destination, and makes the following changes:
INSERT INTO
statement) (Insert_job_client.py lines 62-104)Remaining Issues
Azure Blob Storage - We will need to implement method that lands data into Azure Blob Storage and utilizes COPY command to load the data into SQL pools: https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/load-data-overview
Resolve error in tests:
String or binary data would be truncated
for INSERT INTO queries that are inserting values over the max length of 4000Resolve error in tests :
Invalid object name '[TABLE]' (Table _is_ generated by
CREATE TABLE` query but isn't recognized)Resolve Error in
test_data_writer_string_escape
test:Operation cannot be performed within a transaction
Resolve Error in
test_execute_df
test:Parse error at line: 1, column: 102: Incorrect syntax near ','