Skip to content

Add support of UUID values when encoding avro#971

Merged
shnapz merged 36 commits intomasterfrom
akabas/fix-uuid-in-array
May 27, 2025
Merged

Add support of UUID values when encoding avro#971
shnapz merged 36 commits intomasterfrom
akabas/fix-uuid-in-array

Conversation

@shnapz
Copy link
Contributor

@shnapz shnapz commented Mar 18, 2025

Checklist for PR author(s)

  • Changes are covered by unit tests (no major decrease in code coverage %) and/or integration tests.
  • Ensure code formating (use mvn com.coveo:fmt-maven-plugin:format org.codehaus.mojo:license-maven-plugin:update-file-header)
  • Document any relevant additions/changes in the appropriate spot in javadocs/docs/README.

@shnapz shnapz changed the title Add support of UUID column type Add support of UUID values when writing avro bytes Mar 18, 2025
@shnapz shnapz changed the title Add support of UUID values when writing avro bytes Add support of UUID values when encoding avro Mar 18, 2025
@codecov
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 94.11765% with 5 lines in your changes missing coverage. Please review.

Project coverage is 91.92%. Comparing base (e4b739f) to head (c7960a9).
Report is 7 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #971      +/-   ##
============================================
+ Coverage     91.67%   91.92%   +0.24%     
- Complexity      253      283      +30     
============================================
  Files            26       27       +1     
  Lines           949     1015      +66     
  Branches         71       86      +15     
============================================
+ Hits            870      933      +63     
- Misses           52       54       +2     
- Partials         27       28       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

e2e/ddl.sql Outdated
E'\\000'::bytea AS bytes_field,
ARRAY['foo', 'bar']::text[] AS arr1
ARRAY['foo', 'bar']::text[] AS arr1,
ARRAY[gen_random_uuid(), gen_random_uuid()]::uuid[] AS arr2
Copy link

@farzad-sedghi farzad-sedghi Mar 18, 2025

Choose a reason for hiding this comment

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

I assume the test(s) failed because of this addition, before the actual fix in the code

Copy link
Contributor

@charles-tan charles-tan left a comment

Choose a reason for hiding this comment

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

lgtm, should be able to close #959 after these changes as well.

Comment on lines +319 to +330
private static SchemaBuilder.UnionAccumulator<SchemaBuilder.NullDefault<Schema>>
buildAvroFieldTypeFromPGType(
final String columnTypeName,
final boolean useLogicalTypes,
final SchemaBuilder.BaseTypeBuilder<
SchemaBuilder.UnionAccumulator<SchemaBuilder.NullDefault<Schema>>>
field) {
switch (columnTypeName) {
case "uuid":
if (useLogicalTypes) {
return field.stringBuilder().prop("logicalType", "uuid").endString();
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this handle nested array type? for instance array[array[int]]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it won't handle that

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to handle it? If not, maybe we should be clear in docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, will add to docs

shnapz and others added 14 commits May 7, 2025 20:10
Bumps [org.mariadb.jdbc:mariadb-java-client](https://github.com/mariadb-corporation/mariadb-connector-j) from 3.5.1 to 3.5.3.
- [Release notes](https://github.com/mariadb-corporation/mariadb-connector-j/releases)
- [Changelog](https://github.com/mariadb-corporation/mariadb-connector-j/blob/master/CHANGELOG.md)
- [Commits](mariadb-corporation/mariadb-connector-j@3.5.1...3.5.3)

---
updated-dependencies:
- dependency-name: org.mariadb.jdbc:mariadb-java-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….3 (#975)

Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.5.2...surefire-3.5.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.15.2 to 5.17.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v5.15.2...v5.17.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-version: 5.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.21.1 to 10.23.0.
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](checkstyle/checkstyle@checkstyle-10.21.1...checkstyle-10.23.0)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-version: 10.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.12 to 0.8.13.
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](jacoco/jacoco@v0.8.12...v0.8.13)

---
updated-dependencies:
- dependency-name: org.jacoco:jacoco-maven-plugin
  dependency-version: 0.8.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@shnapz shnapz merged commit 817ceb9 into master May 27, 2025
8 checks passed
@shnapz shnapz deleted the akabas/fix-uuid-in-array branch May 27, 2025 18:06
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.

4 participants