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

SNOW-1553624 - structured types bindings test all types #1841

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sfc-gh-pmotacki
Copy link
Contributor

@sfc-gh-pmotacki sfc-gh-pmotacki commented Jul 23, 2024

Overview

SNOW-1553624

Pre-review self checklist

  • PR branch is updated with all the changes from master branch
  • The code is correctly formatted (run mvn -P check-style validate)
  • New public API is not unnecessary exposed (run mvn verify and inspect target/japicmp/japicmp.html)
  • The pull request name is prefixed with SNOW-XXXX:
  • Code is in compliance with internal logging requirements

External contributors - please answer these questions before submitting a pull request. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Issue: #NNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency or upgrading an existing one
    • I am adding new public/protected component not marked with @SnowflakeJdbcInternalApi (note that public/protected methods/fields in classes marked with this annotation are already internal)
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

ErrorCode.FEATURE_UNSUPPORTED,
"Can't construct array for data type: " + columnSubType);
}
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we inverse the condition and skip then else to make less changes here?

src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java Outdated Show resolved Hide resolved
public Connection init() throws SQLException {
Connection conn = BaseJDBCTest.getConnection(BaseJDBCTest.DONT_INJECT_SOCKET_TIMEOUT);
try (Statement stmt = conn.createStatement()) {
stmt.execute("alter session set ENABLE_STRUCTURED_TYPES_IN_CLIENT_RESPONSE = true");
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we change the alter session to update all parameters in one call?

stmt.executeUpdate();

try (ResultSet resultSet = statement.executeQuery("SELECT * from array_of_varchars"); ) {
resultSet.next();
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's wrap next calls with assertTrue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@sfc-gh-pmotacki sfc-gh-pmotacki force-pushed the structured_types_binding branch from 6f9c168 to 39b7927 Compare July 24, 2024 00:05
@sfc-gh-pmotacki sfc-gh-pmotacki force-pushed the structured_types_binding branch from 39b7927 to 5631aa7 Compare July 24, 2024 00:09
@sfc-gh-pmotacki sfc-gh-pmotacki force-pushed the structured_types_binding branch from 14ddc4e to ae00e43 Compare July 24, 2024 06:13
* statement; if a database access error occurs or this method is called on a closed <code>
* PreparedStatement</code>
* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
* @since 1.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it copied from the JDBC docs? we should validate that since the info here may be misleading

/**
* Sets the designated parameter to the given Map instance.
*
* @param parameterIndex
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add some description for the parameters

@sfc-gh-pmotacki sfc-gh-pmotacki changed the title SNOW-XXXXXX - structured types bindings test all types SNOW-1553624 - structured types bindings test all types Jul 24, 2024
@sfc-gh-pmotacki sfc-gh-pmotacki force-pushed the structured_types_binding branch from 0ed5b76 to e50d465 Compare July 24, 2024 09:23
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.

2 participants