Add support of UUID values when encoding avro#971
Conversation
Codecov ReportAttention: Patch coverage is
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:
|
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 |
There was a problem hiding this comment.
I assume the test(s) failed because of this addition, before the actual fix in the code
dbeam-core/src/main/java/com/spotify/dbeam/avro/JdbcAvroSchema.java
Outdated
Show resolved
Hide resolved
charles-tan
left a comment
There was a problem hiding this comment.
lgtm, should be able to close #959 after these changes as well.
| 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 { |
There was a problem hiding this comment.
Does this handle nested array type? for instance array[array[int]]
There was a problem hiding this comment.
I think it won't handle that
There was a problem hiding this comment.
Do we want to handle it? If not, maybe we should be clear in docs
There was a problem hiding this comment.
Good point, will add to docs
Co-authored-by: Charles Tan <ctan417@gmail.com>
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>
Checklist for PR author(s)
mvn com.coveo:fmt-maven-plugin:format org.codehaus.mojo:license-maven-plugin:update-file-header)