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

Refactor decoding arrays #1194

Merged
merged 110 commits into from Aug 6, 2020
Merged

Refactor decoding arrays #1194

merged 110 commits into from Aug 6, 2020

Conversation

bokken
Copy link
Member

@bokken bokken commented May 17, 2018

Refactor decoding arrays to make more extensible and to more closely align the binary and String processing.

checkstyle issues and test for unsupported character
Add binary support for varchar[].
Add array support for bytea[].
Add binary support for multi-dimensional arrays when the base type
supports binary representation.
# Conflicts:
#	pgjdbc/src/test/java/org/postgresql/test/jdbc2/Jdbc2TestSuite.java
address handling of reading offsets into binary multi-dimensional array
fix unit test for `Object[]`
explicitly set null elements when reading binary array
Rename class to make clear only support for encoding arrays
Refactor decoding arrays to make more extensible and to more closely
align the binary and String processing.
Add missing type mappings.
code style, remove incorret asserts
@codecov-io
Copy link

codecov-io commented May 17, 2018

Codecov Report

Merging #1194 into master will increase coverage by 0.02%.
The diff coverage is 83.33%.

@@             Coverage Diff              @@
##             master    #1194      +/-   ##
============================================
+ Coverage     70.02%   70.05%   +0.02%     
  Complexity     4160     4160              
============================================
  Files           188      188              
  Lines         17537    17550      +13     
  Branches       2872     2874       +2     
============================================
+ Hits          12281    12294      +13     
+ Misses         3977     3976       -1     
- Partials       1279     1280       +1

use List.subList to handle index/count
add support for OID_ARRAY as binary type
@bokken
Copy link
Member Author

bokken commented May 18, 2018

@vlsi or @davecramer
Can you help me interpret the failing travis issue:

+wget --quiet -O /tmp/openj9.tar.gz https://github.com/AdoptOpenJDK/openjdk9-openj9-releases/releases/download/jdk-9%2B181/OpenJDK9-OPENJ9_x64_Linux_jdk-9.181.tar.gz
The command "./.travis/travis_install_openj9.sh" failed and exited with 8 during .
Your build has been stopped.

It does not seem like this is code related, but I am not familiar enough with travis to know what exiting with 8 means.

@vlsi
Copy link
Member

vlsi commented May 18, 2018

That means wget exit code was 8, and it means there was a server error.
It turns out the URL is no longer valid.

We might want to use https://ci.adoptopenjdk.net/job/openjdk9_openj9_build_x86-64_linux/ (or even OpenJDK10-Open9J), however filename is different for each build there.

@jorsol
Copy link
Member

jorsol commented May 18, 2018

This makes me think that the openj9 is not production-ready and that it actually does not provide any benefit in testing, after all it's the same openjdk with a different engine, and in fact it slows down the testing... I will send a PR drooping that job for consideration.

@bokken
Copy link
Member Author

bokken commented May 31, 2018

@vlsi and @davecramer, is there a page in the documentation covering what data types are supported for binary transfer? This PR adds support for binary transfer of OID_ARRAY and it is not clear to me if that should be documented somewhere.

@davecramer
Copy link
Member

@bokken Good question. I suspect not, but I would like to see it documented somewhere

@bokken
Copy link
Member Author

bokken commented Jul 14, 2018

Can we target this for 42.3?

@davecramer
Copy link
Member

I was just talking to @vlsi about that and no we don't care about 9 anymore. I have a PR to try 14 #1844

@vlsi
Copy link
Member

vlsi commented Aug 6, 2020

@bokken , there's a default qualifier for NonNull

@DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.FIELD)
@DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.PARAMETER)
@DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.RETURN)
package org.postgresql;
, so please refrain from adding @NonNull in trivial cases like arr and connection below

    public void populateFromString(@NonNull A arr, List<@Nullable String> strings, @NonNull BaseConnection connection) throws SQLException {


}

private interface ArrayDecoder<@NonNull A> {
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried ArrayDecoder<A extends @NonNull Object> here? (I assume you intend that A should be non-nullable)

https://checkerframework.org/manual/#inherited-wildcard-annotations

Parameters and return values are not null by default => remove NonNull
Generics are nullable by default => add NonNull when needed.
@davecramer
Copy link
Member

@bokken is this ready to merge ?

@bokken
Copy link
Member Author

bokken commented Aug 6, 2020

@davecramer Yes!!!
Thanks to @vlsi getting the checker framework happy, this should be good to go.

@davecramer davecramer merged commit 0fd0939 into pgjdbc:master Aug 6, 2020
42.3.0 Release automation moved this from In progress to Done Aug 6, 2020
@bokken bokken deleted the decode_arrays branch August 7, 2020 12:37
snuyanzin added a commit to snuyanzin/flink that referenced this pull request Apr 5, 2022
snuyanzin added a commit to snuyanzin/flink that referenced this pull request Apr 5, 2022
MartijnVisser pushed a commit to MartijnVisser/flink that referenced this pull request Apr 5, 2022
MartijnVisser added a commit to MartijnVisser/flink that referenced this pull request Apr 5, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. This closes apache#18604
MartijnVisser added a commit to MartijnVisser/flink that referenced this pull request Apr 5, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. This closes apache#18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
MartijnVisser added a commit to MartijnVisser/flink that referenced this pull request Apr 5, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. This closes apache#18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
MartijnVisser added a commit to MartijnVisser/flink that referenced this pull request Apr 7, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. PG's bytea[] now uses primitive arrays. This closes apache#18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
MartijnVisser added a commit to apache/flink that referenced this pull request Apr 7, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. PG's bytea[] now uses primitive arrays. This closes #18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
JasonLeeCoding pushed a commit to JasonLeeCoding/flink that referenced this pull request May 27, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. PG's bytea[] now uses primitive arrays. This closes apache#18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
zstraw pushed a commit to zstraw/flink that referenced this pull request Jul 4, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. PG's bytea[] now uses primitive arrays. This closes apache#18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
MartijnVisser added a commit to MartijnVisser/flink-connector-jdbc that referenced this pull request Nov 28, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. PG's bytea[] now uses primitive arrays. This closes #18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
MartijnVisser added a commit to apache/flink-connector-jdbc that referenced this pull request Nov 29, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. PG's bytea[] now uses primitive arrays. This closes #18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
MartijnVisser added a commit to MartijnVisser/flink-connector-jdbc that referenced this pull request Dec 14, 2022
…2.3.3. This required adding support for smallserial and applying changes after refactoring pgjdbc/pgjdbc#1194. PG's bytea[] now uses primitive arrays. This closes #18604

Co-authored-by: Sergey Nuyanzin <snuyanzin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/needs-review Issue that needs a review - remove label if all is clear
Projects
Development

Successfully merging this pull request may close these issues.

None yet

9 participants