GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: add PG OID support by tlhquynh · Pull Request #2736 · googleapis/java-spanner
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
Conversation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Both aforementioned TODOs regarding class incompatible due to mismatched serialVersionUID and rebasing after #2703 is merged are done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good to me. The biggest question that I have is whether there is any value in adding all the getPgOid(..) methods, or whether it would be better to just say 'use getLong(..) for both normal INT64 and PG.OID values'.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1 @@ | |||
| 17.0.9 | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remove this file (and potentially add the file name to .gitignore to prevent it from being included in commits in the future)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,4 @@ | |||
| { | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same as above: Remove file from GitHub and add the filename to .gitignore
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| throw new UnsupportedOperationException("Not implemented"); | ||
| } | ||
|
|
||
| protected abstract long getPgOidInternal(int columnIndex); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add a default implementation for this and the other methods that are being added to this class. The default implementation should just throw UnsupportedOperationException. This prevents this change from being a breaking change, as anyone who has a class that extends AbstractStructReader does not get a compile error.
That should also remove the requirement to add the method names to clirr-ignored-differences.xml
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| <method>java.util.List getPgJsonbList(java.lang.String)</method> | ||
| </difference> | ||
| <!-- PG OID --> | ||
| <difference> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It should not be necessary to add the internal methods to this file, if those methods are given a default implementation that just throws UnsupportedOperationException
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
These entries in clirr-ignored-differences.xml for StructReader can be removed, as we don't have those methods anymore.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
final nit (I promise :-)): I think that the two remaining additions to this file for getPgOid() and getPgOidArray() can also be removed, as these methods are no longer added to the Value class.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @Override | ||
| public long getPgOid(int columnIndex) { | ||
| checkNonNullOfType(columnIndex, Type.pgOid(), columnIndex); | ||
| return getPgOidInternal(columnIndex); | ||
| } | ||
|
|
||
| @Override | ||
| public long getPgOid(String columnName) { | ||
| int columnIndex = getColumnIndex(columnName); | ||
| checkNonNullOfType(columnIndex, Type.pgOid(), columnName); | ||
| return getPgOidInternal(columnIndex); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth considering not adding any of this at all, and instead instruct users that they have to get PG.OID values in the same way as INT64? So just call getLong(..) and the other corresponding methods. This is otherwise all just a copy-paste of those methods, and there's no additional validation of the values that we are getting.
I know that it is not what we have done for other types (e.g. we could in theory have done the same for JSON by telling users to just call getString(...)). But this might be the right time to start to prevent us from doing double work for future types, while it does not add any additional type safety or features for users.
@skuruppu Any thoughts on this?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
I had an offline chat with @skuruppu and treating OID as Long is actually what we are doing for the other clients. I have removed all external PG.OID getters.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Map<String, Value> params = request.getParams().getFieldsMap(); | ||
| assertEquals(20, paramTypes.size()); | ||
| assertEquals(20, params.size()); | ||
| System.out.println("Dialect = " + dialect); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* chore: keep session pool ordering when pinging Pinging sessions would move the sessions that were pinged to either the front or the back of the pool (dependingin the session pool configuration), instead of keeping the sessions in the place where they were when being pinged. Bringing a session that is pinged to the front of the pool means that we will prefer using a session that has not really been used for a while, other than for the ping. Keeping the sessions in place is therefore preferable. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
To enable Direct Access, [both `setAttemptDirectPath` and `setAttemptDirectPathXds` should be called](https://togithub.com/googleapis/sdk-platform-java/blob/4b44a7851dc1d4fd2ac21a54df6c24db5625223c/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java#L373-L386) for gax to append the correct google-c2p scheme. This PR adds a env var `GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS` to control the enable/disable of Direct Access. When it is true, it calls `setAttemptDirectPathXds` which effectively turns on Direct Access (as `options.isAttemptDirectPath` is by default true and we don't need to call `setAttemptDirectPath` again).
…r-plugin to v3.13.0 (googleapis#2956)
…y-plugin to v3.7.1 (googleapis#2955)
| <method>java.util.List getPgJsonbList(java.lang.String)</method> | ||
| </difference> | ||
| <!-- PG OID --> | ||
| <difference> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
These entries in clirr-ignored-differences.xml for StructReader can be removed, as we don't have those methods anymore.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| throw new UnsupportedOperationException("Not implemented"); | ||
| } | ||
|
|
||
| protected long getPgOidInternal(int columnIndex) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think that you can remove this method (and the equivalent array methods below) as well, and instead just use the getLongInternal method.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| checkNonNullOfCodes( | ||
| columnIndex, Arrays.asList(Code.ENUM, Code.PG_OID, Code.INT64), columnIndex); | ||
| return getColumnType(columnIndex).getCode() == Code.PG_OID | ||
| ? getPgOidInternal(columnIndex) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think that this can be simplified to just calling getLongInternal. The same also applies to the array methods below.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| @Override | ||
| protected long getPgOidInternal(int columnIndex) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
remove and rely on getLongInternal instead
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| @Override | ||
| protected Int64Array getPgOidListInternal(int columnIndex) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remove and use getLongListInternal instead
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ionFuture interfaces. (googleapis#2973) * chore: add multiplexed session implementations for CachedSession/SessionFuture interfaces. * chore: add comments. * chore: add session replacement handler for multiplexed session. * chore: address comments. * chore: fix comments. * chore: fix comments.
🤖 I have created a release *beep* *boop* --- ## [6.62.1](https://togithub.com/googleapis/java-spanner/compare/v6.62.0...v6.62.1) (2024-03-28) ### Dependencies * Update dependency com.google.cloud:google-cloud-monitoring to v3.39.0 ([googleapis#2966](https://togithub.com/googleapis/java-spanner/issues/2966)) ([a5cb1dd](https://togithub.com/googleapis/java-spanner/commit/a5cb1ddd065100497d9215eff30d57361d7e84de)) * Update dependency com.google.cloud:google-cloud-trace to v2.38.0 ([googleapis#2967](https://togithub.com/googleapis/java-spanner/issues/2967)) ([b2dc788](https://togithub.com/googleapis/java-spanner/commit/b2dc788d5a54244d83a192ecac894ff931f884c4)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…googleapis#2959) * Add support for transaction-level exclusion from change streams * cleanup * refactor: introduce PartitionedUpdateOption * Revert "refactor: introduce PartitionedUpdateOption" This reverts commit 96b508b. * Add error handling in DML update APIs where excludeTxnFromChangeStreams option is not applicable * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…3.40.0 (googleapis#2987) * deps: update dependency com.google.cloud:google-cloud-monitoring to v3.40.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…35.0 (googleapis#2989) * chore(deps): update dependency com.google.cloud:libraries-bom to v26.35.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
* chore: clean up some warnings and malformed comments * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…to v6.63.0 (googleapis#2992) * chore(deps): update dependency com.google.cloud:google-cloud-spanner to v6.63.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Adds an 'endpoint' connection URL property for the Connection API. This property can be used instead of adding the endpoint to the host group part of the Connection URL, which again removes the need to actually change the connection URL when connecting to for example the emulator from the JDBC driver. The latter can instead just add the endpoint to the Properties set that is given to the JDBC driver.
* feat: support max_commit_delay in Connection API Adds support for max_commit_delay to the Connection API: 1. Adds a setMaxCommitDelay(Duration) method to Connection 2. Adds a maxCommitDelay connection URL property 3. Adds a SET MAX_COMMIT_DELAY=<duration> SQL statement * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore: minor improvements to default benchmarks. * chore: lint issues fix. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
googleapis#2971) Source-Link: googleapis/synthtool@ca7a716 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:cecae6152a85d55c932a64515643cf2e32a1f1b6e17503080eb07744b2177f28 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
googleapis#2932) * feat: Add instance partition support to spanner instance proto PiperOrigin-RevId: 611127452 Source-Link: googleapis/googleapis@618d47c Source-Link: https://github.com/googleapis/googleapis-gen/commit/92d855588828430e8b428ed78219e23ee666da78 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTJkODU1NTg4ODI4NDMwZThiNDI4ZWQ3ODIxOWUyM2VlNjY2ZGE3OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): Update the Java code generator (gapic-generator-java) to 2.37.0 PiperOrigin-RevId: 611816371 Source-Link: googleapis/googleapis@2a40f63 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d30ff0767777b381fb1617f67a90e3abd3bdc6dc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDMwZmYwNzY3Nzc3YjM4MWZiMTYxN2Y2N2E5MGUzYWJkM2JkYzZkYyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add SessionPoolOptions, SpannerOptions protos in executor protos PiperOrigin-RevId: 621265883 Source-Link: googleapis/googleapis@fed9845 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c66a76957e2e16347bc1dd3f4c638223f065ee80 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzY2YTc2OTU3ZTJlMTYzNDdiYzFkZDNmNGM2MzgyMjNmMDY1ZWU4MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
| <method>java.util.List getPgJsonbList(java.lang.String)</method> | ||
| </difference> | ||
| <!-- PG OID --> | ||
| <difference> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
final nit (I promise :-)): I think that the two remaining additions to this file for getPgOid() and getPgOidArray() can also be removed, as these methods are no longer added to the Value class.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.