-
Notifications
You must be signed in to change notification settings - Fork 437
JSON datatype support #2558
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
base: main
Are you sure you want to change the base?
JSON datatype support #2558
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2558 +/- ##
============================================
- Coverage 51.01% 50.09% -0.93%
+ Complexity 3921 3829 -92
============================================
Files 147 147
Lines 33483 33544 +61
Branches 5609 5619 +10
============================================
- Hits 17081 16803 -278
- Misses 13991 14347 +356
+ Partials 2411 2394 -17 ☔ View full report in Codecov by Sentry. |
src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/RegressionTest.java
Show resolved
Hide resolved
/azp run public-mssql-jdbc.windows |
Azure Pipelines successfully started running 1 pipeline(s). |
No pipelines are associated with this pull request. |
/azp run public-mssql-jdbc.linux |
/azp run CI-MacOS |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java
Outdated
Show resolved
Hide resolved
…m/microsoft/mssql-jdbc into user/divang/json-datatype-support
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.
Copilot reviewed 11 out of 26 changed files in this pull request and generated no comments.
Files not reviewed (15)
- src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java: Evaluated as low risk
- src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyCSVTest.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataTable.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/Column.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSetMetaData.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/DataTypes.java: Evaluated as low risk
- src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/SqlTypeMapping.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java: Evaluated as low risk
- src/main/java/microsoft/sql/Types.java: Evaluated as low risk
- src/main/java/com/microsoft/sqlserver/jdbc/dtv.java: Evaluated as low risk
- src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java: Evaluated as low risk
- src/test/java/com/microsoft/sqlserver/jdbc/tvp/TVPTypesTest.java: Evaluated as low risk
…using the column label instead of the index.
src/test/java/com/microsoft/sqlserver/jdbc/JSONFunctionTest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java
Outdated
Show resolved
Hide resolved
…otes, preventing misclassification of non-JSON braces, and adding test cases based on review comments.
…mnNameWithJson.csv.
…al and local temporary tables, UDF with SELECT, WHERE, and FROM clauses, and SELECT INTO queries.
…ata check, direct function call validation, and assertion for JSON structure.
…BulkCopy=true in connection string
@@ -29,6 +29,7 @@ private Constants() {} | |||
* reqExternalSetup - For tests requiring external setup | |||
* clientCertAuth - - For tests requiring client certificate authentication setup | |||
* Fedauth - - - - - - For Fedauth tests | |||
* JSONTest - - - - - For tests requiring JSON setup |
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 we need to add a separate tag for this? this should always run along with the other datatype tests
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.
@lilgreenbird We would need to exclude these tests against test endpoints that don't support JSON. (I'm kind of surprised we don't have one for Data Classification, for example. But it looks like we've used SQL Server version for that, which isn't quite proper.)
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 need a new tag for new SQL Server version that supports JSON. (SQL Server 2023 or ?)
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.
yeah, why not? data classification was in 2019 only
@@ -158,8 +158,7 @@ public static void setup() throws Exception { | |||
// no config file used | |||
} | |||
|
|||
connectionString = getConfiguredPropertyOrEnv(Constants.MSSQL_JDBC_TEST_CONNECTION_PROPERTIES); | |||
|
|||
connectionString = getConfiguredPropertyOrEnv(Constants.MSSQL_JDBC_TEST_CONNECTION_PROPERTIES); |
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 remove the blank line?
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.
the tests need to take into consideration the SQL server version. JSON support is only avail on SQL 2023 (or ?) so this means we need to exclude this for xSQLv16 and below. Need new tag for this new SQL Server version
@@ -1459,6 +1461,7 @@ final void executeOp(DTVExecuteOp op) throws SQLServerException { | |||
case NVARCHAR: | |||
case LONGNVARCHAR: | |||
case NCLOB: | |||
case JSON: |
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 think we're missing a case in the else (line #1599). This makes me think we're also missing a test case that will go to that path. Check SQL_VARIANT to see where this is tested.
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 think we also need a case for JSON in readSqlVariant, and, a test for that
To add support for the new JSON datatype, the following changes have been made to the codebase: