Skip to content

Conversation

g31pranjal
Copy link
Member

@g31pranjal g31pranjal commented Sep 30, 2025

This PR is a follow-up PR in the series for deprecating using sql_type_codes in JDBC, and instead using "richer" Relational types. The support for relational types were introduced some time bakc in #3510. This PR shifts to relational type usage, away from sql_type usage, to make way for retiring the latter field completely from the protobuf. After this, we could remove the field in 2 steps:

  1. stop setting jdbcSqlType fields in JDBC proto and mark them deprecated.
  2. remove from protobuf

@g31pranjal g31pranjal added the cleanup Non-breaking/stylistic code cleanup label Sep 30, 2025
default:
throw new SQLException("JDBC Type: " + type + " not supported");
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

The test gap analysis is claiming this method is uncovered. Unless this is a mistake of the code coverage reporting tool, that would seem to suggest we're not really looking at this part of the code base that changed. Do you know what the issue is?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe at least this method is covered by a test over an external JDBC server and not the in-process one.

public static Parameter ofBoolean(boolean b) {
return Parameter.newBuilder()
.setType(Type.BOOLEAN)
.setJavaSqlTypesCode(Types.BOOLEAN)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would seem to me that for cross-version compatibility reasons, we'd need to keep setting this field at least for one minor version. Otherwise, I'm not sure how old code would make sense of the Parameter's type. Is my understanding wrong, or are we not covering this in mixed mode tests? Or something else?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think setting old fields need to be in-place for another release. The scope of this PR should only be limited to start using new fields in place of old fields.

// Add the metadata and get offset at where to insert data.
int offset = addMetadata(ColumnMetadata.newBuilder()
.setName(fieldName).setJavaSqlTypesCode(Types.BOOLEAN).setType(Type.BOOLEAN).build());
.setName(fieldName).setType(Type.BOOLEAN).build());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to retain the type codes for an additional minor version release? That is, do we need to keep setting the deprecated field until we're dropped cross version support for anything that would expect it to be there

Copy link
Member Author

Choose a reason for hiding this comment

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

replied above!

@g31pranjal g31pranjal changed the title mark sql_type_code are deprecated and remove usage remove sql_type_code remove usage Oct 6, 2025
@g31pranjal g31pranjal force-pushed the remove_sql_types_from_grpc branch from 3a9a283 to 5e3af6a Compare October 6, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Non-breaking/stylistic code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants