[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16637698#comment-16637698 ] ASF GitHub Bot commented on AVRO-2235: -- kojiromike commented on issue #341: Fix AVRO-2235 URL: https://github.com/apache/avro/pull/341#issuecomment-426858213 Ref #342 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16637359#comment-16637359 ] Raymie Stata commented on AVRO-2235: I'm going to keep this open in case someone else wants to comment. But based on what Thiru says, I think I'm going to close this issue as "won't fix." > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16636784#comment-16636784 ] Thiruvalluvan M. G. commented on AVRO-2235: --- The intent was to test the compatibility of the code generated just before and just after AVRO-1684. So that test need not be touched now. In fact, it should probably be deleted because the current generated code is not the same as either of the files here and hence it does not really test anything current. But if we want to test the compatibility between the code generated before AVRO-1684 and the *current* version, we should regenerate both the classes. We need to regenerate them because the schema used for generating those two classes has changed in the meantime. I personally don't think the pain is worth it. However, if it should be done, here is how it can be achieved: # Obtain a copy of old avro-tools jar from [https://mvnrepository.com/artifact/org.apache.avro/avro-tools/1.7.7.] Click on the `jar` button to download the jar. # From lang/java issue the command `java -jar avro-tools-1.7.7.jar compile schema avro/src/test/resources/record_with_logical_types.avsc tmp`. # Massage the generated code (`tmp/org/apache/avro/specific/TestRecordWithLogicalTypes.java`) a bit: `%s/org.apache.avro.specific.TestRecordWithout/TestRecordWithout/g` # `cp tmp/org/apache/avro/specific/TestRecordWithLogicalTypes.java avro/src/test/java/org/apache/avro/specific/TestRecordWithoutLogicalTypes.java` This is not perfect; but it gets something close to what got generated then. > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16636484#comment-16636484 ] Raymie Stata commented on AVRO-2235: I looked at the comment at the top of TestSpecificLogicalTypes and realized that maybe I shouldn't have updated TestRecordWithLogicalTypes. That comment reads: {quote}The classes [TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes]should not be re-generated because they test compatibility of Avro with existing Avro-generated sources. When using classes generated before AVRO-1684, logical types should not be applied by the read or write paths. Those files should behave as they did before. At the same time, [~nkollar] suggested in my (GitHub) pull request for AVRO-2090 that I regenerate TestRecordForLogicalTypes. {quote} So it sounds like this code here is for testing backward compatibility and thus shouldn't be updated. At the same time, in my (GitHub) pull request for AVRO-2090, [~nkollar] suggests that I _do_ regenerate these classes. At this point, I'm not sure what is the right thing to do. Any suggestions? > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16636466#comment-16636466 ] Raymie Stata commented on AVRO-2235: I want to re-regenerate TestRecordForLogicalTypes.java with my modifications to the specific compiler, but would prefer to do that after successfully re-generating it on the master. > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16636464#comment-16636464 ] Raymie Stata commented on AVRO-2235: Does anyone know how TestRecordWithoutLogicalTypes.java was generated? Was it a hand-edit of the generated code for TestRecordWithLogicalTypes.java? > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16636450#comment-16636450 ] ASF GitHub Bot commented on AVRO-2235: -- rstata opened a new pull request #342: AVRO-2235: regenerate TestRecordWithLogicalTypes.java URL: https://github.com/apache/avro/pull/342 My original fix conflicted with patch for AVRO-2079. The AVRO-2079 fixed a typo in record_with_logical_types.avsc. However, while AVRO-2079 made a cosmetic change to RecordWithLogicalTypes.java, it did not regenerate it. I fixed another problem in record_with_logical_types.avsc and regenerated RecordWithLogicalTypes.java. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16636418#comment-16636418 ] ASF GitHub Bot commented on AVRO-2235: -- rstata closed pull request #341: Fix AVRO-2235 URL: https://github.com/apache/avro/pull/341 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithLogicalTypes.java b/lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithLogicalTypes.java index 493a8e67c..851e49a2d 100644 --- a/lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithLogicalTypes.java +++ b/lang/java/avro/src/test/java/org/apache/avro/specific/TestRecordWithLogicalTypes.java @@ -5,16 +5,16 @@ */ package org.apache.avro.specific; -import org.apache.avro.message.BinaryMessageDecoder; +import org.apache.avro.specific.SpecificData; import org.apache.avro.message.BinaryMessageEncoder; +import org.apache.avro.message.BinaryMessageDecoder; +import org.apache.avro.message.SchemaStore; -import java.math.BigDecimal; - -@SuppressWarnings("all") +/** Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes */ @org.apache.avro.specific.AvroGenerated public class TestRecordWithLogicalTypes extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -4211233492739285532L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TestRecordWithLogicalTypes\",\"namespace\":\"org.apache.avro.specific\",\"fields\":[{\"name\":\"b\",\"type\":\"boolean\"},{\"name\":\"i32\",\"type\":\"int\"},{\"name\":\"i64\",\"type\":\"long\"},{\"name\":\"f32\",\"type\":\"float\"},{\"name\":\"f64\",\"type\":\"double\"},{\"name\":\"s\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"d\",\"type\":{\"type\":\"int\",\"logicalType\":\"date\"}},{\"name\":\"t\",\"type\":{\"type\":\"int\",\"logicalType\":\"time-millis\"}},{\"name\":\"ts\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"dec\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":9,\"scale\":2}}]}"); + private static final long serialVersionUID = 6236661767120588912L; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TestRecordWithLogicalTypes\",\"namespace\":\"org.apache.avro.specific\",\"doc\":\"Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes\",\"fields\":[{\"name\":\"b\",\"type\":\"boolean\"},{\"name\":\"i32\",\"type\":\"int\"},{\"name\":\"i64\",\"type\":\"long\"},{\"name\":\"f32\",\"type\":\"float\"},{\"name\":\"f64\",\"type\":\"double\"},{\"name\":\"s\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"d\",\"type\":{\"type\":\"int\",\"logicalType\":\"date\"}},{\"name\":\"t\",\"type\":{\"type\":\"int\",\"logicalType\":\"time-millis\"}},{\"name\":\"ts\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"dec\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":9,\"scale\":2}}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); @@ -25,12 +25,38 @@ private static final BinaryMessageDecoder DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$); - /** Serializes this ${schema.getName()} to a ByteBuffer. */ + /** + * Return the BinaryMessageDecoder instance used by this class. + * @return the message decoder used by this class + */ + public static BinaryMessageDecoder getDecoder() { +return DECODER; + } + + /** + * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. + * @param resolver a {@link SchemaStore} used to find schemas by fingerprint + * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore + */ + public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { +return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); + } + + /** + * Serializes this TestRecordWithLogicalTypes to a ByteBuffer. + * @return a buffer holding the serialized data for this instance + * @throws java.io.IOException if this instance could not be serialized + */ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { return ENCODER.encode(this); } - /** Deserializes a ${schema.getName()} from a ByteBuffer. */ + /** + * Deserializes a
[jira] [Commented] (AVRO-2235) Regenerate TestRecordWithLogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16636404#comment-16636404 ] ASF GitHub Bot commented on AVRO-2235: -- rstata opened a new pull request #341: Fix AVRO-2235 URL: https://github.com/apache/avro/pull/341 Fixed typo in record_with_logical_types.asvc, then regenerated TestRecordWithLogicalTypes.java This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Regenerate TestRecordWithLogicalTypes > - > > Key: AVRO-2235 > URL: https://issues.apache.org/jira/browse/AVRO-2235 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Raymie Stata >Priority: Major > > TestRecordWithLogicalTypes.java is code that was generated by the specific > compiler and then moved into the testing code tree. It hasn't been changed > in a while, although the compiler is evolving. I tried to regenerate it and > found there is a problem with record_with_logical_types.avsc. I will fix the > schema file and then regenerate TestRecordWithLogicalTypes and check both in. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)