-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add support for Azure Synapse External Tables #44
Conversation
@swanderz This looks really cool! I have a few issues and PRs in this repo to catch up on. I'm out for a few days, but I plan to get to these by the end of next week. |
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.
@swanderz Really neat, sorry for my delay getting back to you, and above all, thank you for wanting to contribute to this package.
I left a few comments:
- to make this implementation consistent with how the others work, especially regarding
var('ext_full_refresh')
(which is my hack for--full-refresh
) - to clarify my own understanding about how external tables work in AzureSQL / Synapse
I added very simple integration tests to this package over the weekend, so as to:
- help folks contribute small fixes to this package
- establish a low-level baseline of common functionality across databases
I don't have a way presently to stand up a Synapse instance such that CircleCI could connect to it. Even so, do you want to take a swing at staging the fixture data? (s3://dbt-external-tables-testing
, gs://dbt-external-tables-testing
)
exttbl doesn't already exits
…ternal-tables into synapse_support
@jtcohen6 I took all your suggestions and ran with them.I'm 86% confident there's a typo somewhere, we'll find it as soon as we get the env_vars plugged into CircleCI.
|
Nice! I plugged in the Synapse creds to CircleCI, though now it looks like we're getting the error:
I wonder if As far as fixing tests on the other databases, could you add these lines to sources:
dbt_external_tables_integration_tests:
...
sqlserver_external:
+enabled: "{{ target.type == 'sqlserver' }}" |
a lot of naming shenanigans that caused lots of head+keyboard here...
Some potential outstanding items:
|
Heroic work here, @swanderz. This feels like it's in really solid, workable shape. There's some reorganization I'd like to do, which I can manage after merging.
I'm surprised this hasn't come up before. The simplest and most thorough way to solve this is by overriding the @dataclass
class SQLServerIncludePolicy(Policy):
database: bool = False
schema: bool = True
identifier: bool = True
@dataclass(frozen=True, eq=False, repr=False)
class SQLServerRelation(BaseRelation):
include_policy: SQLServerIncludePolicy = SQLServerIncludePolicy() If we could add that to the adapters, then we won't need to override the tests in this package.
As far as one-off syntactical weirdnesses go, I think this is nbd. Let's open new issues for:
|
Description & motivation
Now users of Azure SQL (using
dbt-sqlserver
) and Azure Synapse (usingdbt-azuresynapse
) can usedbt-external-tables
to stage external tables.I mostly copied the
redshift
implementation, but, because Synapse has no notion of external table "refresh", I removed that.hanging chads
I left comments in code of ways to make these macros more robust, but can take those comments out if that's not y'alls convention. Basically I think it would be "cool" to be able to set:
not_null
test associated with it. (tests don't seem to be an attribute of a table node?)the ability to setQUOTED_IDENTIFIER
andANSI_NULLS
in the config rather than always being set toON
.Checklist