-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 #50434
base: move/destination-mssql-v2
Are you sure you want to change the base?
wip #50434
Conversation
This reverts commit 90aa35e.
Co-authored-by: Jonathan Pearlin <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Co-authored-by: Jonathan Pearlin <[email protected]>
} | ||
} else { | ||
try { | ||
when (value) { |
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.
It may make this cleaner to encapsulate this logic in an extension function on the value -- something like value.setStatementValue(statement=statement)
. The extension function would encapsulate this when block, making this code easier to test separate from the type conversion expectations.
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.
Updated
.filter { field -> field.name !in airbyteFields } | ||
.map { field -> | ||
try { | ||
when (field.type.type) { |
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 comment as above...this feels like another good use of an extension function on the type to encapsulate this conversion logic and make it easier to test.
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.
Updated.
private val dataSourceFactory: MSSQLDataSourceFactory | ||
) : DestinationWriter { | ||
override fun createStreamLoader(stream: DestinationStream): StreamLoader { | ||
val dataSource = dataSourceFactory.getDataSource(config) |
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.
We may want to do this in the constructor/init/post construct method. Otherwise, we are creating a data source per stream, which means d x s connections instead of just d connections if the data source is shared between streams (preferred to limit connections).
} | ||
} | ||
} catch (ex: Exception) { | ||
KotlinLogging.logger {}.error(ex) { ex.message } |
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.
This should probably be a file level variable to avoid creating the logger each time that the code catches.
...2/src/test-integration/kotlin/io/airbyte/integrations/destination/mssql/v2/MSSQLCheckTest.kt
Outdated
Show resolved
Hide resolved
This reverts commit 90aa35e.
Co-authored-by: Jonathan Pearlin <[email protected]>
Co-authored-by: Jonathan Pearlin <[email protected]>
140aeda
to
57bcf83
Compare
57bcf83
to
bc730ce
Compare
What
How
Review guide
User Impact
Can this PR be safely reverted and rolled back?