WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@aukponmwan
Copy link
Contributor

Replacing the SQL Server Connector for Apache Spark documentation.

@prmerger-automator
Copy link
Contributor

@aukponmwan : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 0508e1f:

💡 Validation status: suggestions

File Status Preview URL Details
articles/synapse-analytics/spark/data-sources/apache-spark-sql-connector.md 💡Suggestion Details

articles/synapse-analytics/spark/data-sources/apache-spark-sql-connector.md

  • Line 188, Column 3: [Suggestion: docs-link-absolute - See documentation] Absolute link 'https://learn.microsoft.com/fabric/database/sql/overview' will be broken in isolated environments. Replace with a relative link.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@prmerger-automator
Copy link
Contributor

PRMerger Results

Issue Description
File Change Percent This PR contains file(s) with more than 30% file change.

@v-dirichards
Copy link
Contributor

@eric-urban

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged tracking label for the PR review team label Dec 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the Apache Spark SQL Server connector documentation with updated guidance for the new Spark connector for SQL databases (Preview). The update reflects a modernized connector preinstalled in Synapse Spark 3.5 runtime with enhanced capabilities.

Key changes:

  • Introduces the preview Spark connector for SQL databases with support for multiple SQL database types (Azure SQL, SQL Managed Instance, SQL Server on Azure VM, and Fabric SQL databases)
  • Updates authentication guidance to emphasize integrated Microsoft Entra ID authentication as the default method
  • Replaces legacy code examples with modern PySpark and Scala examples using the .mssql() method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.option("hostNameInCertificate", "*.database.windows.net") \
.load()
```python
import com.microsoft.sqlserver.jdbc.spark
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import statement uses Java/Scala syntax in a PySpark code block. Python doesn't use this import syntax. Remove this line or use the correct Python import if one is required for the connector.

Suggested change
import com.microsoft.sqlserver.jdbc.spark

Copilot uses AI. Check for mistakes.
.option("encrypt", "true") \
.option("hostNameInCertificate", "*.database.windows.net") \
.load()
import com.microsoft.sqlserver.jdbc.spark
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import statement uses Java/Scala syntax in a PySpark code block. Python doesn't use this import syntax. Remove this line or use the correct Python import if one is required for the connector.

Suggested change
import com.microsoft.sqlserver.jdbc.spark

Copilot uses AI. Check for mistakes.
# [User/Password](#tab/userandpassword)

```python
import com.microsoft.sqlserver.jdbc.spark
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import statement uses Java/Scala syntax in a PySpark code block. Python doesn't use this import syntax. Remove this line or use the correct Python import if one is required for the connector.

Suggested change
import com.microsoft.sqlserver.jdbc.spark

Copilot uses AI. Check for mistakes.
import org.apache.spark.sql.types._
val url = "jdbc:sqlserver://<server>:<port>;database=<database>;"
val row_data = Seq(
Row("Alice", 2),
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Age value for 'Alice' is inconsistent with the PySpark example (line 87) where it's 1. This inconsistency could confuse readers trying to understand the examples.

Suggested change
Row("Alice", 2),
Row("Alice", 1),

Copilot uses AI. Check for mistakes.
Comment on lines +148 to +149
df.write.mode("overwrite").option("url", url).option("accesstoken", token).mssql("dbo.publicExample")
spark.read.option("accesstoken", token).mssql("dbo.publicExample").show()
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The option name 'accesstoken' is inconsistent with typical casing conventions. Consider using 'accessToken' (camelCase) to match the option naming pattern shown in the legacy code examples and common convention.

Suggested change
df.write.mode("overwrite").option("url", url).option("accesstoken", token).mssql("dbo.publicExample")
spark.read.option("accesstoken", token).mssql("dbo.publicExample").show()
df.write.mode("overwrite").option("url", url).option("accessToken", token).mssql("dbo.publicExample")
spark.read.option("accessToken", token).mssql("dbo.publicExample").show()

Copilot uses AI. Check for mistakes.
@ms-arali
Copy link
Contributor

ms-arali commented Dec 5, 2025

#sign-off

@prmerger-automator
Copy link
Contributor

Invalid command: '#sign-off'. Only the assigned author of one or more file in this PR can sign off. @eric-urban

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants