Skip to content
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

Set appname and add prefix for SQL Server session #159

Merged
merged 4 commits into from
Jun 20, 2022

Conversation

luxu1-ms
Copy link
Collaborator

@luxu1-ms luxu1-ms commented Nov 5, 2021

This PR set default application name of SQL Server session to "Spark MSSQL Connector", and adds prefix for user input application name. If user specify the application name "appName", the application name of SQL Server session will be "Spark MSSQL Connector appName".
df.write \ .format("com.microsoft.sqlserver.jdbc.spark") \ .mode("append") \ .option("url", url) \ .option("dbtable", dbtable) \ .option("user", user) \ .option("password", password) \ .option("applicationName", "myAPP") \ .save()
The original PR to set default app name is #125 by @arvindshmicrosoft

Test

This PR pased CI, GCI tests.
Run below sql statement during data writing to get program_name (application name) and test this PR.
SELECT * FROM sys.dm_exec_sessions WHERE client_interface_name LIKE 'Microsoft JDBC Driver%'
This PR got tested with BEST_EFFORT, NO_DUPLICATES, data pool.

The change also respects the case when the user passes in applicationName in the `options` Map.
@luxu1-ms luxu1-ms requested review from shanyu and DaniBunny November 10, 2021 07:51
@luxu1-ms luxu1-ms removed the request for review from DaniBunny November 23, 2021 23:55
@shivsood shivsood merged commit 9a07172 into microsoft:master Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants