You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "frankgrimes97 (via GitHub)" <gi...@apache.org> on 2023/03/09 20:43:20 UTC
[GitHub] [avro] frankgrimes97 opened a new pull request, #2137: [AVRO-2943] Add new GenericData String/Utf8 ARRAY comparison test
frankgrimes97 opened a new pull request, #2137:
URL: https://github.com/apache/avro/pull/2137
https://issues.apache.org/jira/browse/AVRO-2943
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] aromanenko-dev commented on pull request #2137: [AVRO-2943] Add new GenericData String/Utf8 ARRAY comparison test
Posted by "aromanenko-dev (via GitHub)" <gi...@apache.org>.
aromanenko-dev commented on PR #2137:
URL: https://github.com/apache/avro/pull/2137#issuecomment-1466068756
@dkulp could you take a look and merge if there are no objections?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] aromanenko-dev commented on a diff in pull request #2137: [AVRO-2943] Add new GenericData String/Utf8 ARRAY comparison test
Posted by "aromanenko-dev (via GitHub)" <gi...@apache.org>.
aromanenko-dev commented on code in PR #2137:
URL: https://github.com/apache/avro/pull/2137#discussion_r1132377399
##########
lang/java/avro/src/test/java/org/apache/avro/generic/TestGenericData.java:
##########
@@ -198,6 +198,25 @@ public void testMapValuesEquals() {
assertEquals(r1, r0);
}
+ @Test
+ public void testArrayValuesEqualsStringAndUtf8Compatibility() {
+ Schema arrayElementSchema = new Schema.Parser().parse("{\"type\": \"string\"}");
Review Comment:
Why don't you use the full schema description for type `array`, like for similar `map` test above?
According to [type specification](https://avro.apache.org/docs/1.10.2/spec.html#Arrays) they have a similar description, don't they?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] aromanenko-dev commented on a diff in pull request #2137: [AVRO-2943] Add new GenericData String/Utf8 ARRAY comparison test
Posted by "aromanenko-dev (via GitHub)" <gi...@apache.org>.
aromanenko-dev commented on code in PR #2137:
URL: https://github.com/apache/avro/pull/2137#discussion_r1132377399
##########
lang/java/avro/src/test/java/org/apache/avro/generic/TestGenericData.java:
##########
@@ -198,6 +198,25 @@ public void testMapValuesEquals() {
assertEquals(r1, r0);
}
+ @Test
+ public void testArrayValuesEqualsStringAndUtf8Compatibility() {
+ Schema arrayElementSchema = new Schema.Parser().parse("{\"type\": \"string\"}");
Review Comment:
Why don't you use the full schema description for type `array`, like for similar `map` test above?
According to [type specification](Just a side question - why here we use the full schema description for type `map` and not ) they have a similar description, don't they?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] frankgrimes97 commented on a diff in pull request #2137: [AVRO-2943] Add new GenericData String/Utf8 ARRAY comparison test
Posted by "frankgrimes97 (via GitHub)" <gi...@apache.org>.
frankgrimes97 commented on code in PR #2137:
URL: https://github.com/apache/avro/pull/2137#discussion_r1132610925
##########
lang/java/avro/src/test/java/org/apache/avro/generic/TestGenericData.java:
##########
@@ -198,6 +198,25 @@ public void testMapValuesEquals() {
assertEquals(r1, r0);
}
+ @Test
+ public void testArrayValuesEqualsStringAndUtf8Compatibility() {
+ Schema arrayElementSchema = new Schema.Parser().parse("{\"type\": \"string\"}");
Review Comment:
Not 100% if this is what you mean, but looking at it again I do see that the code can be simplified as:
```
Field myMapField = new Field("my_map", Schema.createMap(Schema.create(Schema.Type.STRING)), null, null);
Schema schema = Schema.createRecord("my_record", "doc", "mytest", false);
```
and
```
Field myArrayField = new Field("my_array", Schema.createArray(Schema.create(Schema.Type.STRING)), null, null);
Schema schema = Schema.createRecord("my_record", "doc", "mytest", false);
```
I can force-push that if you'd prefer... or am I missing something else?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] aromanenko-dev commented on a diff in pull request #2137: [AVRO-2943] Add new GenericData String/Utf8 ARRAY comparison test
Posted by "aromanenko-dev (via GitHub)" <gi...@apache.org>.
aromanenko-dev commented on code in PR #2137:
URL: https://github.com/apache/avro/pull/2137#discussion_r1132636702
##########
lang/java/avro/src/test/java/org/apache/avro/generic/TestGenericData.java:
##########
@@ -198,6 +198,25 @@ public void testMapValuesEquals() {
assertEquals(r1, r0);
}
+ @Test
+ public void testArrayValuesEqualsStringAndUtf8Compatibility() {
+ Schema arrayElementSchema = new Schema.Parser().parse("{\"type\": \"string\"}");
Review Comment:
```
Field myMapField = new Field("my_map", Schema.createMap(Schema.create(Schema.Type.STRING)), null, null);
Schema schema = Schema.createRecord("my_record", "doc", "mytest", false);
```
Yes, I think this one is more correct (or less confusing). Otherwise, as it was before, it creates nested maps (map in map). Not a big deal since finally it still tests maps comparison.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] frankgrimes97 commented on a diff in pull request #2137: AVRO-2943: Add new GenericData String/Utf8 ARRAY comparison test
Posted by "frankgrimes97 (via GitHub)" <gi...@apache.org>.
frankgrimes97 commented on code in PR #2137:
URL: https://github.com/apache/avro/pull/2137#discussion_r1132610925
##########
lang/java/avro/src/test/java/org/apache/avro/generic/TestGenericData.java:
##########
@@ -198,6 +198,25 @@ public void testMapValuesEquals() {
assertEquals(r1, r0);
}
+ @Test
+ public void testArrayValuesEqualsStringAndUtf8Compatibility() {
+ Schema arrayElementSchema = new Schema.Parser().parse("{\"type\": \"string\"}");
Review Comment:
Not 100% sure if this is what you mean, but looking at it again I do see that the code can be simplified as:
```
Field myMapField = new Field("my_map", Schema.createMap(Schema.create(Schema.Type.STRING)), null, null);
Schema schema = Schema.createRecord("my_record", "doc", "mytest", false);
```
and
```
Field myArrayField = new Field("my_array", Schema.createArray(Schema.create(Schema.Type.STRING)), null, null);
Schema schema = Schema.createRecord("my_record", "doc", "mytest", false);
```
I can force-push that if you'd prefer... or am I missing something else?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] RyanSkraba merged pull request #2137: AVRO-2943: Add new GenericData String/Utf8 ARRAY comparison test
Posted by "RyanSkraba (via GitHub)" <gi...@apache.org>.
RyanSkraba merged PR #2137:
URL: https://github.com/apache/avro/pull/2137
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org