[GitHub] [avro] HorizonNet closed pull request #707: AVRO-2068: Improved EnumSchema constructor performance

2020-05-26 Thread GitBox


HorizonNet closed pull request #707:
URL: https://github.com/apache/avro/pull/707


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #741: AVRO-2649 Made argument order non-enforceable avro-tools cli

2020-05-26 Thread GitBox


dkulp merged pull request #741:
URL: https://github.com/apache/avro/pull/741


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #790: AVRO-2068: Improved static class constructor performance

2020-05-26 Thread GitBox


dkulp merged pull request #790:
URL: https://github.com/apache/avro/pull/790


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp closed pull request #838: [AVRO-2768] Use a zip file friendly way to open VERSION.txt

2020-05-26 Thread GitBox


dkulp closed pull request #838:
URL: https://github.com/apache/avro/pull/838


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #535: AVRO-2493: Add custom logical types support for avro-maven-plugin.

2020-05-26 Thread GitBox


dkulp merged pull request #535:
URL: https://github.com/apache/avro/pull/535


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp closed pull request #749: cmake: Use GNUInstallDirs instead of hard-coded paths

2020-05-26 Thread GitBox


dkulp closed pull request #749:
URL: https://github.com/apache/avro/pull/749


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #667: [AVRO-2579]: Fix test by sorting fields for deterministic order

2020-05-26 Thread GitBox


dkulp merged pull request #667:
URL: https://github.com/apache/avro/pull/667


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #782: AVRO-2703: Use KMP Algorithm For Sync Marker Search

2020-05-26 Thread GitBox


dkulp merged pull request #782:
URL: https://github.com/apache/avro/pull/782


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #834: Add example schema for date logical type field to spec docs

2020-05-26 Thread GitBox


dkulp merged pull request #834:
URL: https://github.com/apache/avro/pull/834


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #703: AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields

2020-05-26 Thread GitBox


dkulp merged pull request #703:
URL: https://github.com/apache/avro/pull/703


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #893: AVRO-2844:Avro-js can't parse default value {}

2020-05-26 Thread GitBox


dkulp merged pull request #893:
URL: https://github.com/apache/avro/pull/893


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp closed pull request #887: [AVRO-2806] Upgrade from Netty 3 -> Netty 4

2020-05-26 Thread GitBox


dkulp closed pull request #887:
URL: https://github.com/apache/avro/pull/887


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] RyanSkraba opened a new pull request #894: AVRO-2733: No longer explicitly require rubygems

2020-05-26 Thread GitBox


RyanSkraba opened a new pull request #894:
URL: https://github.com/apache/avro/pull/894


   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [X] My PR addresses the following [Avro 
Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them 
in the PR title. For example, "AVRO-1234: My Avro PR"
 - https://issues.apache.org/jira/browse/AVRO-2733
 - In case you are adding a dependency, check if the license complies with 
the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Tests
   
   - [X] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason: No additional tests, we should just expect no 
regression from the existing tests.
   
   ### Commits
   
   - [X] My commits all reference Jira issues in their subject lines. In 
addition, my commits follow the guidelines from "[How to write a good git 
commit message](https://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - All the public functions and the classes in the PR contain Javadoc that 
explain what it does
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #848: Always read even if skipped (readNull missing)

2020-05-26 Thread GitBox


dkulp merged pull request #848:
URL: https://github.com/apache/avro/pull/848


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Resolved] (AVRO-2844) Avro-js can't parse default value {}

2020-05-26 Thread Zezeng Wang (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zezeng Wang resolved AVRO-2844.
---
Resolution: Fixed

> Avro-js can't parse default value {}
> 
>
> Key: AVRO-2844
> URL: https://issues.apache.org/jira/browse/AVRO-2844
> Project: Apache Avro
>  Issue Type: Bug
>Affects Versions: 1.8.2, 1.9.2
>Reporter: Alexey Trenikhin
>Assignee: Zezeng Wang
>Priority: Major
>
> Avro-js can't parse {code:javascript} default: {} {code}, see full example 
> below:
> {code:javascript}
> const type = avro.parse({
> name: 'Zoo',
> type: 'record',
> fields: [{
> name: 'pet',
> type: {
> name: 'Pet',
> type: 'record',
> fields: [
> {name: 'name', type: 'string', default: ''},
> {name: 'weight', type: 'long', default: 0}
> ]
> },
> default: {}
> }]
> });
> {code}
> Same schema is parsed fine by Java



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [avro] zeshuai007 opened a new pull request #893: AVRO-2844:Avro-js can't parse default value {}

2020-05-26 Thread GitBox


zeshuai007 opened a new pull request #893:
URL: https://github.com/apache/avro/pull/893


   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Avro 
Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them 
in the PR title. For example, "AVRO-1234: My Avro PR"
 - https://issues.apache.org/jira/browse/AVRO-2844
 - In case you are adding a dependency, check if the license complies with 
the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines. In 
addition, my commits follow the guidelines from "[How to write a good git 
commit message](https://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - All the public functions and the classes in the PR contain Javadoc that 
explain what it does
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] dkulp merged pull request #891: AVRO-2842: PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread GitBox


dkulp merged pull request #891:
URL: https://github.com/apache/avro/pull/891


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [avro] RyanSkraba merged pull request #883: AVRO-2836 Generated java includes logical type conversions

2020-05-26 Thread GitBox


RyanSkraba merged pull request #883:
URL: https://github.com/apache/avro/pull/883


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Commented] (AVRO-2834) Overload avpr schema methods

2020-05-26 Thread Zezeng Wang (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17117239#comment-17117239
 ] 

Zezeng Wang commented on AVRO-2834:
---

Hi [~greedy_roach],
Why not use Override, basically can achieve the effect of Overload.
Maybe you can describe it specifically and let everyone discuss it.

> Overload avpr schema methods
> 
>
> Key: AVRO-2834
> URL: https://issues.apache.org/jira/browse/AVRO-2834
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.9.2
>Reporter: lino arango
>Priority: Major
>
> Is there a way to overload methods in avpr schema?
> Having the same method name but with different type and number of parameters



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2579) Test can fail with a different order of fields reflected

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17117012#comment-17117012
 ] 

Hudson commented on AVRO-2579:
--

FAILURE: Integrated in Jenkins build AvroJava #892 (See 
[https://builds.apache.org/job/AvroJava/892/])
[AVRO-2579]: Fix tests by sorting fields for deterministic order (dan: 
[https://github.com/apache/avro/commit/a6a0346b4aae937f8e19e928d7c45f85cde09ba2])
* (edit) lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java
* (edit) lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java


> Test can fail with a different order of fields reflected
> 
>
> Key: AVRO-2579
> URL: https://issues.apache.org/jira/browse/AVRO-2579
> Project: Apache Avro
>  Issue Type: Bug
>Reporter: contextshuffling
>Priority: Minor
> Fix For: 1.10.0
>
>
> {{org.apache.avro.reflect.TestReflect#testAvroDoc compares the toString() 
> version of the DocTest.class. It uses java.lang.Class.getDeclaredFields() to 
> get the fields. However, this API does not guarantee the order of fields that 
> gets returned. So test may fails due to a different order.}}
> {{https://github.com/contextshuffling/avro/blob/f9399780bfafd46bce1292da314f15b90f869572/lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java#L1319}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2438) SpecificData.deepCopy() cannot be used with URI fields

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17117010#comment-17117010
 ] 

Hudson commented on AVRO-2438:
--

FAILURE: Integrated in Jenkins build AvroJava #892 (See 
[https://builds.apache.org/job/AvroJava/892/])
AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields 
(github: 
[https://github.com/apache/avro/commit/3bf7356376ff176d17960814fad62f13f66c3a4d])
* (edit) lang/java/ipc/src/test/java/org/apache/avro/generic/TestDeepCopy.java
* (edit) lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
* (edit) lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java


> SpecificData.deepCopy() cannot be used with URI fields
> --
>
> Key: AVRO-2438
> URL: https://issues.apache.org/jira/browse/AVRO-2438
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.0, 1.8.2
>Reporter: Sebastian J.
>Assignee: Zezeng Wang
>Priority: Major
> Fix For: 1.10.0
>
>
> Having a schema fragment like this:
> {code:java}
> {
> "name": "ownerId",
> "type": [
>   "null",
>   {
> "type": "string",
> "java-class": "java.net.URI"
>   }
> ],
> "default": null
> }{code}
> can be perfectly deserialized in a generated POJO with
> {code:java}
> @org.apache.avro.specific.AvroGenerated
> public class MyAvroDataObject extends 
> org.apache.avro.specific.SpecificRecordBase implements 
> org.apache.avro.specific.SpecificRecord {
> ...
> @Deprecated public java.net.URI ownerId;{code}
> as 
> {{GenericDatumReader.readString(Object, Schema, Decoder)}} uses via the 
> {{stringClassCache}} with 
> {code:java}
> {"type":"string","java-class":"java.net.URI"}=class java.net.URI{code}
> The {{URI}} class itself to rehydrate the value via {{newInstanceFromString}}.
>  
> On the other hand, {{deepCopy}} only considers the schema-type of the field 
> and turns in {{org.apache.avro.generic.GenericData.deepCopy(Schema, T)}}
> the {{URI}} value into an {{org.apache.avro.util.Utf8}} via the {{String}} 
> case which then causes a {{ClassCastException}}:
> {noformat}
> java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to 
> java.net.URI
>   at com.example.MyAvroDataObject.put(MyAvroDataObject.java:104)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:660)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:677)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1082)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1102)
>   at 
> org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1080){noformat}
>  
> The following dirty hack seems to avoid the issue - but is not in sync with 
> the {{stringClassCache}} which should be consulted, too:
> {code:java}
> case STRING:
>   // Strings are immutable
>   if (value instanceof String) {
> return (T)value;
>   }
>   // Dirty Harry 9 3/4 start
>   // URIs are immutable and are probably modeled as an URI itself 
>   // TODO: Check with stringClassCache & the schema
>   else if ((value instanceof URI)
> && URI.class.getName().equals(schema.getProp("java-class"))
> ) {
> return (T)value;
>   }
>   // Dirt Harry 9 3/4 end
>   // Some CharSequence subclasses are mutable, so we still need to make
>   // a copy
>   else if (value instanceof Utf8) {
> // Utf8 copy constructor is more efficient than converting
> // to string and then back to Utf8
> return (T)new Utf8((Utf8)value);
>   }
>   return (T)new Utf8(value.toString());
> {code}
>  
> Also tried with Avro {{1.10-SNAPSHOT}} of 2019-06-20 / 
> {{2d3b1fe7efd865639663ba785877182e7e038c45}} due to 
> [https://github.com/apache/avro/pull/329] - but the issue remains.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2649) [Java] Argument order enforced in avro-tools cli.

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17117011#comment-17117011
 ] 

Hudson commented on AVRO-2649:
--

FAILURE: Integrated in Jenkins build AvroJava #892 (See 
[https://builds.apache.org/job/AvroJava/892/])
AVRO-2649 Made argument order non-enforceable avro-tools cli (#741) (github: 
[https://github.com/apache/avro/commit/7fd098a56064ece218c66ba1d2ad78bd358f6009])
* (edit) 
lang/java/tools/src/main/java/org/apache/avro/tool/SpecificCompilerTool.java
* (edit) 
lang/java/tools/src/test/java/org/apache/avro/tool/TestSpecificCompilerTool.java


> [Java] Argument order enforced in avro-tools cli.
> -
>
> Key: AVRO-2649
> URL: https://issues.apache.org/jira/browse/AVRO-2649
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.1
>Reporter: Ryan Skraba
>Priority: Minor
> Fix For: 1.10.0
>
>
> The following command line works:
> {code}
> $ avrotool compile -string -bigDecimal schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Input files to compile:
>   ./lang/java/tools/src/test/compiler/input/fieldtest.avsc
> {code}
> Switching the first two flags causes an error:
> {code}
> $ avrotool compile -bigDecimal -string schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Expected "schema" or "protocol".
> {code}
> There's really no need to enforce a command line option order, especially for 
> flags, and it's not user friendly.  Most CLI tools don't.  There's several 
> good command line parsers to help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2493) Unable to register Logical Type for custom Conversion class

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116904#comment-17116904
 ] 

ASF subversion and git services commented on AVRO-2493:
---

Commit ccbbb8353fcc168563c567580cb773d5fe442704 in avro's branch 
refs/heads/master from Pavel Likin
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=ccbbb83 ]

AVRO-2493: Add custom logical types support for avro-maven-plugin. (#535)

* Add custom logical types support for avro-maven-plugin.

* Remove default LogicalTypeFactory.getTypeName implementation according to 
review remarks.

* Return default implementation for LogicalTypeFactory.getTypeName according to 
review.

Co-authored-by: Daniel Kulp 

> Unable to register Logical Type for custom Conversion class
> ---
>
> Key: AVRO-2493
> URL: https://issues.apache.org/jira/browse/AVRO-2493
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.0
>Reporter: Travis Yocum
>Priority: Major
>
> I have created a custom conversion class for Java's (1.8) 
> java.time.OffsetDateTime.
> {code:java}
> public class OffsetDateTimeConversion extends Conversion {
> private static final DateTimeFormatter DATE_TIME_FORMATTER = 
> DateTimeFormatter.ofPattern("-MM-dd'T'HH:mm:ss.nnZ");
> @Override
> public Class getConvertedType() {
> return OffsetDateTime.class;
> }
> @Override
> public String getLogicalTypeName() {
> return "offset-date-time";
> }
> @Override
> public OffsetDateTime fromCharSequence(CharSequence value, Schema schema, 
> LogicalType type) {
> return OffsetDateTime.parse(value, DATE_TIME_FORMATTER);
> }
> @Override
> public CharSequence toCharSequence(OffsetDateTime value, Schema schema, 
> LogicalType type) {
> return value.format(DATE_TIME_FORMATTER);
> }
> }
> {code}
>  And my simple schema to test (including a field that uses the built-in 
> "time-millis" converter in Avro 1.9 for testing purposes):
> TimeTest.avsc
>  
> {code:java}
> {
>"type": "record",
>"name": "TimeTest",
>"namespace": "time.test",
>"fields": [
>   {
>"name": "createTime",
>"type": {
>"type": "int",
>"logicalType": "time-millis"
>}
>   },
>   {
>"name": "createDateTime",
>"type": {
>"type": "string",
>"logicalType": "offset-date-time"
>}
>   }
>]
> }
> {code}
>  
> I've also created a LogicalType for my conversion field that I need to 
> register:
>  
> {code:java}
> public class OffsetDateTimeLogicalType extends LogicalType {
> public static final String LOGICAL_DATE_TIME_NAME = "offset-date-time";
> public OffsetDateTimeLogicalType() {
> super(LOGICAL_DATE_TIME_NAME);
> }
> @Override
> public void validate(Schema schema) {
> super.validate(schema);
> if (schema.getType() != Schema.Type.STRING) {
> throw new IllegalArgumentException("Logical type 
> 'offset-date-time' must be of type string");
> }
> }
> }{code}
>  
> I've been debugging the avro-maven-plugin and have been able to pinpoint 
> where my issue is occurring while parsing the schema:
>  
> {code:java}
> // parse logical type if present
> result.logicalType = LogicalTypes.fromSchemaIgnoreInvalid(result);
> {code}
>  
> The schema's "logicalType" property is being set to null because it's not a 
> registered logical type.
> The code I need to execute is:
>  
> {code:java}
> LogicalTypes.register(getLogicalTypeName(), schema -> new 
> OffsetDateTimeLogicalType());
> {code}
> Without modifying the plugin code, I see no way to execute this register so 
> that the Schema.parse method (which is called before the conversion class is 
> executed) will recognize this LogicalType.
>  
> The plugin has a config property  to allow for 
> registering the Decimal logical types but nothing to enable other logical 
> types.
> Am I missing something or is this a real issue?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (AVRO-2493) Unable to register Logical Type for custom Conversion class

2020-05-26 Thread Daniel Kulp (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2493.
---
Fix Version/s: 1.10.0
   Resolution: Fixed

> Unable to register Logical Type for custom Conversion class
> ---
>
> Key: AVRO-2493
> URL: https://issues.apache.org/jira/browse/AVRO-2493
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.0
>Reporter: Travis Yocum
>Priority: Major
> Fix For: 1.10.0
>
>
> I have created a custom conversion class for Java's (1.8) 
> java.time.OffsetDateTime.
> {code:java}
> public class OffsetDateTimeConversion extends Conversion {
> private static final DateTimeFormatter DATE_TIME_FORMATTER = 
> DateTimeFormatter.ofPattern("-MM-dd'T'HH:mm:ss.nnZ");
> @Override
> public Class getConvertedType() {
> return OffsetDateTime.class;
> }
> @Override
> public String getLogicalTypeName() {
> return "offset-date-time";
> }
> @Override
> public OffsetDateTime fromCharSequence(CharSequence value, Schema schema, 
> LogicalType type) {
> return OffsetDateTime.parse(value, DATE_TIME_FORMATTER);
> }
> @Override
> public CharSequence toCharSequence(OffsetDateTime value, Schema schema, 
> LogicalType type) {
> return value.format(DATE_TIME_FORMATTER);
> }
> }
> {code}
>  And my simple schema to test (including a field that uses the built-in 
> "time-millis" converter in Avro 1.9 for testing purposes):
> TimeTest.avsc
>  
> {code:java}
> {
>"type": "record",
>"name": "TimeTest",
>"namespace": "time.test",
>"fields": [
>   {
>"name": "createTime",
>"type": {
>"type": "int",
>"logicalType": "time-millis"
>}
>   },
>   {
>"name": "createDateTime",
>"type": {
>"type": "string",
>"logicalType": "offset-date-time"
>}
>   }
>]
> }
> {code}
>  
> I've also created a LogicalType for my conversion field that I need to 
> register:
>  
> {code:java}
> public class OffsetDateTimeLogicalType extends LogicalType {
> public static final String LOGICAL_DATE_TIME_NAME = "offset-date-time";
> public OffsetDateTimeLogicalType() {
> super(LOGICAL_DATE_TIME_NAME);
> }
> @Override
> public void validate(Schema schema) {
> super.validate(schema);
> if (schema.getType() != Schema.Type.STRING) {
> throw new IllegalArgumentException("Logical type 
> 'offset-date-time' must be of type string");
> }
> }
> }{code}
>  
> I've been debugging the avro-maven-plugin and have been able to pinpoint 
> where my issue is occurring while parsing the schema:
>  
> {code:java}
> // parse logical type if present
> result.logicalType = LogicalTypes.fromSchemaIgnoreInvalid(result);
> {code}
>  
> The schema's "logicalType" property is being set to null because it's not a 
> registered logical type.
> The code I need to execute is:
>  
> {code:java}
> LogicalTypes.register(getLogicalTypeName(), schema -> new 
> OffsetDateTimeLogicalType());
> {code}
> Without modifying the plugin code, I see no way to execute this register so 
> that the Schema.parse method (which is called before the conversion class is 
> executed) will recognize this LogicalType.
>  
> The plugin has a config property  to allow for 
> registering the Decimal logical types but nothing to enable other logical 
> types.
> Am I missing something or is this a real issue?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2579) Test can fail with a different order of fields reflected

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116901#comment-17116901
 ] 

ASF subversion and git services commented on AVRO-2579:
---

Commit a6a0346b4aae937f8e19e928d7c45f85cde09ba2 in avro's branch 
refs/heads/master from contextshuffling
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=a6a0346 ]

[AVRO-2579]: Fix tests by sorting fields for deterministic order


> Test can fail with a different order of fields reflected
> 
>
> Key: AVRO-2579
> URL: https://issues.apache.org/jira/browse/AVRO-2579
> Project: Apache Avro
>  Issue Type: Bug
>Reporter: contextshuffling
>Priority: Minor
>
> {{org.apache.avro.reflect.TestReflect#testAvroDoc compares the toString() 
> version of the DocTest.class. It uses java.lang.Class.getDeclaredFields() to 
> get the fields. However, this API does not guarantee the order of fields that 
> gets returned. So test may fails due to a different order.}}
> {{https://github.com/contextshuffling/avro/blob/f9399780bfafd46bce1292da314f15b90f869572/lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java#L1319}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (AVRO-2579) Test can fail with a different order of fields reflected

2020-05-26 Thread Daniel Kulp (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2579.
---
Fix Version/s: 1.10.0
   Resolution: Fixed

> Test can fail with a different order of fields reflected
> 
>
> Key: AVRO-2579
> URL: https://issues.apache.org/jira/browse/AVRO-2579
> Project: Apache Avro
>  Issue Type: Bug
>Reporter: contextshuffling
>Priority: Minor
> Fix For: 1.10.0
>
>
> {{org.apache.avro.reflect.TestReflect#testAvroDoc compares the toString() 
> version of the DocTest.class. It uses java.lang.Class.getDeclaredFields() to 
> get the fields. However, this API does not guarantee the order of fields that 
> gets returned. So test may fails due to a different order.}}
> {{https://github.com/contextshuffling/avro/blob/f9399780bfafd46bce1292da314f15b90f869572/lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java#L1319}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2649) [Java] Argument order enforced in avro-tools cli.

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116895#comment-17116895
 ] 

ASF subversion and git services commented on AVRO-2649:
---

Commit 7fd098a56064ece218c66ba1d2ad78bd358f6009 in avro's branch 
refs/heads/master from ravowlga123
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=7fd098a ]

AVRO-2649 Made argument order non-enforceable avro-tools cli (#741)

* AVRO-2649 Made argument order non-enforceable avro-tools cli

* AVRO-2649 Dynamic index value for encoding and templatedir

* AVRO-2649 Add positionindex to save positions of flags

* AVRO-2649 Add test cases

Co-authored-by: Daniel Kulp 

> [Java] Argument order enforced in avro-tools cli.
> -
>
> Key: AVRO-2649
> URL: https://issues.apache.org/jira/browse/AVRO-2649
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.1
>Reporter: Ryan Skraba
>Priority: Minor
>
> The following command line works:
> {code}
> $ avrotool compile -string -bigDecimal schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Input files to compile:
>   ./lang/java/tools/src/test/compiler/input/fieldtest.avsc
> {code}
> Switching the first two flags causes an error:
> {code}
> $ avrotool compile -bigDecimal -string schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Expected "schema" or "protocol".
> {code}
> There's really no need to enforce a command line option order, especially for 
> flags, and it's not user friendly.  Most CLI tools don't.  There's several 
> good command line parsers to help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2649) [Java] Argument order enforced in avro-tools cli.

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116897#comment-17116897
 ] 

ASF subversion and git services commented on AVRO-2649:
---

Commit 7fd098a56064ece218c66ba1d2ad78bd358f6009 in avro's branch 
refs/heads/master from ravowlga123
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=7fd098a ]

AVRO-2649 Made argument order non-enforceable avro-tools cli (#741)

* AVRO-2649 Made argument order non-enforceable avro-tools cli

* AVRO-2649 Dynamic index value for encoding and templatedir

* AVRO-2649 Add positionindex to save positions of flags

* AVRO-2649 Add test cases

Co-authored-by: Daniel Kulp 

> [Java] Argument order enforced in avro-tools cli.
> -
>
> Key: AVRO-2649
> URL: https://issues.apache.org/jira/browse/AVRO-2649
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.1
>Reporter: Ryan Skraba
>Priority: Minor
>
> The following command line works:
> {code}
> $ avrotool compile -string -bigDecimal schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Input files to compile:
>   ./lang/java/tools/src/test/compiler/input/fieldtest.avsc
> {code}
> Switching the first two flags causes an error:
> {code}
> $ avrotool compile -bigDecimal -string schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Expected "schema" or "protocol".
> {code}
> There's really no need to enforce a command line option order, especially for 
> flags, and it's not user friendly.  Most CLI tools don't.  There's several 
> good command line parsers to help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (AVRO-2649) [Java] Argument order enforced in avro-tools cli.

2020-05-26 Thread Daniel Kulp (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2649.
---
Fix Version/s: 1.10.0
   Resolution: Fixed

> [Java] Argument order enforced in avro-tools cli.
> -
>
> Key: AVRO-2649
> URL: https://issues.apache.org/jira/browse/AVRO-2649
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.1
>Reporter: Ryan Skraba
>Priority: Minor
> Fix For: 1.10.0
>
>
> The following command line works:
> {code}
> $ avrotool compile -string -bigDecimal schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Input files to compile:
>   ./lang/java/tools/src/test/compiler/input/fieldtest.avsc
> {code}
> Switching the first two flags causes an error:
> {code}
> $ avrotool compile -bigDecimal -string schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Expected "schema" or "protocol".
> {code}
> There's really no need to enforce a command line option order, especially for 
> flags, and it's not user friendly.  Most CLI tools don't.  There's several 
> good command line parsers to help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2649) [Java] Argument order enforced in avro-tools cli.

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116898#comment-17116898
 ] 

ASF subversion and git services commented on AVRO-2649:
---

Commit 7fd098a56064ece218c66ba1d2ad78bd358f6009 in avro's branch 
refs/heads/master from ravowlga123
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=7fd098a ]

AVRO-2649 Made argument order non-enforceable avro-tools cli (#741)

* AVRO-2649 Made argument order non-enforceable avro-tools cli

* AVRO-2649 Dynamic index value for encoding and templatedir

* AVRO-2649 Add positionindex to save positions of flags

* AVRO-2649 Add test cases

Co-authored-by: Daniel Kulp 

> [Java] Argument order enforced in avro-tools cli.
> -
>
> Key: AVRO-2649
> URL: https://issues.apache.org/jira/browse/AVRO-2649
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.1
>Reporter: Ryan Skraba
>Priority: Minor
>
> The following command line works:
> {code}
> $ avrotool compile -string -bigDecimal schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Input files to compile:
>   ./lang/java/tools/src/test/compiler/input/fieldtest.avsc
> {code}
> Switching the first two flags causes an error:
> {code}
> $ avrotool compile -bigDecimal -string schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Expected "schema" or "protocol".
> {code}
> There's really no need to enforce a command line option order, especially for 
> flags, and it's not user friendly.  Most CLI tools don't.  There's several 
> good command line parsers to help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2649) [Java] Argument order enforced in avro-tools cli.

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116896#comment-17116896
 ] 

ASF subversion and git services commented on AVRO-2649:
---

Commit 7fd098a56064ece218c66ba1d2ad78bd358f6009 in avro's branch 
refs/heads/master from ravowlga123
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=7fd098a ]

AVRO-2649 Made argument order non-enforceable avro-tools cli (#741)

* AVRO-2649 Made argument order non-enforceable avro-tools cli

* AVRO-2649 Dynamic index value for encoding and templatedir

* AVRO-2649 Add positionindex to save positions of flags

* AVRO-2649 Add test cases

Co-authored-by: Daniel Kulp 

> [Java] Argument order enforced in avro-tools cli.
> -
>
> Key: AVRO-2649
> URL: https://issues.apache.org/jira/browse/AVRO-2649
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.1
>Reporter: Ryan Skraba
>Priority: Minor
>
> The following command line works:
> {code}
> $ avrotool compile -string -bigDecimal schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Input files to compile:
>   ./lang/java/tools/src/test/compiler/input/fieldtest.avsc
> {code}
> Switching the first two flags causes an error:
> {code}
> $ avrotool compile -bigDecimal -string schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Expected "schema" or "protocol".
> {code}
> There's really no need to enforce a command line option order, especially for 
> flags, and it's not user friendly.  Most CLI tools don't.  There's several 
> good command line parsers to help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2649) [Java] Argument order enforced in avro-tools cli.

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116894#comment-17116894
 ] 

ASF subversion and git services commented on AVRO-2649:
---

Commit 7fd098a56064ece218c66ba1d2ad78bd358f6009 in avro's branch 
refs/heads/master from ravowlga123
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=7fd098a ]

AVRO-2649 Made argument order non-enforceable avro-tools cli (#741)

* AVRO-2649 Made argument order non-enforceable avro-tools cli

* AVRO-2649 Dynamic index value for encoding and templatedir

* AVRO-2649 Add positionindex to save positions of flags

* AVRO-2649 Add test cases

Co-authored-by: Daniel Kulp 

> [Java] Argument order enforced in avro-tools cli.
> -
>
> Key: AVRO-2649
> URL: https://issues.apache.org/jira/browse/AVRO-2649
> Project: Apache Avro
>  Issue Type: Improvement
>Affects Versions: 1.9.1
>Reporter: Ryan Skraba
>Priority: Minor
>
> The following command line works:
> {code}
> $ avrotool compile -string -bigDecimal schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Input files to compile:
>   ./lang/java/tools/src/test/compiler/input/fieldtest.avsc
> {code}
> Switching the first two flags causes an error:
> {code}
> $ avrotool compile -bigDecimal -string schema 
> ./lang/java/tools/src/test/compiler/input/fieldtest.avsc /tmp/output
> Expected "schema" or "protocol".
> {code}
> There's really no need to enforce a command line option order, especially for 
> flags, and it's not user friendly.  Most CLI tools don't.  There's several 
> good command line parsers to help.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2438) SpecificData.deepCopy() cannot be used with URI fields

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116889#comment-17116889
 ] 

ASF subversion and git services commented on AVRO-2438:
---

Commit 3bf7356376ff176d17960814fad62f13f66c3a4d in avro's branch 
refs/heads/master from Zezeng Wang
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=3bf7356 ]

AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields (#703)

* AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields

* Update spotless check

* Modify comment

* AVRO-2438:Increase the deepcopy support of java-key-class

Co-authored-by: Daniel Kulp 

> SpecificData.deepCopy() cannot be used with URI fields
> --
>
> Key: AVRO-2438
> URL: https://issues.apache.org/jira/browse/AVRO-2438
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.0, 1.8.2
>Reporter: Sebastian J.
>Assignee: Zezeng Wang
>Priority: Major
>
> Having a schema fragment like this:
> {code:java}
> {
> "name": "ownerId",
> "type": [
>   "null",
>   {
> "type": "string",
> "java-class": "java.net.URI"
>   }
> ],
> "default": null
> }{code}
> can be perfectly deserialized in a generated POJO with
> {code:java}
> @org.apache.avro.specific.AvroGenerated
> public class MyAvroDataObject extends 
> org.apache.avro.specific.SpecificRecordBase implements 
> org.apache.avro.specific.SpecificRecord {
> ...
> @Deprecated public java.net.URI ownerId;{code}
> as 
> {{GenericDatumReader.readString(Object, Schema, Decoder)}} uses via the 
> {{stringClassCache}} with 
> {code:java}
> {"type":"string","java-class":"java.net.URI"}=class java.net.URI{code}
> The {{URI}} class itself to rehydrate the value via {{newInstanceFromString}}.
>  
> On the other hand, {{deepCopy}} only considers the schema-type of the field 
> and turns in {{org.apache.avro.generic.GenericData.deepCopy(Schema, T)}}
> the {{URI}} value into an {{org.apache.avro.util.Utf8}} via the {{String}} 
> case which then causes a {{ClassCastException}}:
> {noformat}
> java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to 
> java.net.URI
>   at com.example.MyAvroDataObject.put(MyAvroDataObject.java:104)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:660)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:677)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1082)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1102)
>   at 
> org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1080){noformat}
>  
> The following dirty hack seems to avoid the issue - but is not in sync with 
> the {{stringClassCache}} which should be consulted, too:
> {code:java}
> case STRING:
>   // Strings are immutable
>   if (value instanceof String) {
> return (T)value;
>   }
>   // Dirty Harry 9 3/4 start
>   // URIs are immutable and are probably modeled as an URI itself 
>   // TODO: Check with stringClassCache & the schema
>   else if ((value instanceof URI)
> && URI.class.getName().equals(schema.getProp("java-class"))
> ) {
> return (T)value;
>   }
>   // Dirt Harry 9 3/4 end
>   // Some CharSequence subclasses are mutable, so we still need to make
>   // a copy
>   else if (value instanceof Utf8) {
> // Utf8 copy constructor is more efficient than converting
> // to string and then back to Utf8
> return (T)new Utf8((Utf8)value);
>   }
>   return (T)new Utf8(value.toString());
> {code}
>  
> Also tried with Avro {{1.10-SNAPSHOT}} of 2019-06-20 / 
> {{2d3b1fe7efd865639663ba785877182e7e038c45}} due to 
> [https://github.com/apache/avro/pull/329] - but the issue remains.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2438) SpecificData.deepCopy() cannot be used with URI fields

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116887#comment-17116887
 ] 

ASF subversion and git services commented on AVRO-2438:
---

Commit 3bf7356376ff176d17960814fad62f13f66c3a4d in avro's branch 
refs/heads/master from Zezeng Wang
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=3bf7356 ]

AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields (#703)

* AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields

* Update spotless check

* Modify comment

* AVRO-2438:Increase the deepcopy support of java-key-class

Co-authored-by: Daniel Kulp 

> SpecificData.deepCopy() cannot be used with URI fields
> --
>
> Key: AVRO-2438
> URL: https://issues.apache.org/jira/browse/AVRO-2438
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.0, 1.8.2
>Reporter: Sebastian J.
>Assignee: Zezeng Wang
>Priority: Major
>
> Having a schema fragment like this:
> {code:java}
> {
> "name": "ownerId",
> "type": [
>   "null",
>   {
> "type": "string",
> "java-class": "java.net.URI"
>   }
> ],
> "default": null
> }{code}
> can be perfectly deserialized in a generated POJO with
> {code:java}
> @org.apache.avro.specific.AvroGenerated
> public class MyAvroDataObject extends 
> org.apache.avro.specific.SpecificRecordBase implements 
> org.apache.avro.specific.SpecificRecord {
> ...
> @Deprecated public java.net.URI ownerId;{code}
> as 
> {{GenericDatumReader.readString(Object, Schema, Decoder)}} uses via the 
> {{stringClassCache}} with 
> {code:java}
> {"type":"string","java-class":"java.net.URI"}=class java.net.URI{code}
> The {{URI}} class itself to rehydrate the value via {{newInstanceFromString}}.
>  
> On the other hand, {{deepCopy}} only considers the schema-type of the field 
> and turns in {{org.apache.avro.generic.GenericData.deepCopy(Schema, T)}}
> the {{URI}} value into an {{org.apache.avro.util.Utf8}} via the {{String}} 
> case which then causes a {{ClassCastException}}:
> {noformat}
> java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to 
> java.net.URI
>   at com.example.MyAvroDataObject.put(MyAvroDataObject.java:104)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:660)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:677)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1082)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1102)
>   at 
> org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1080){noformat}
>  
> The following dirty hack seems to avoid the issue - but is not in sync with 
> the {{stringClassCache}} which should be consulted, too:
> {code:java}
> case STRING:
>   // Strings are immutable
>   if (value instanceof String) {
> return (T)value;
>   }
>   // Dirty Harry 9 3/4 start
>   // URIs are immutable and are probably modeled as an URI itself 
>   // TODO: Check with stringClassCache & the schema
>   else if ((value instanceof URI)
> && URI.class.getName().equals(schema.getProp("java-class"))
> ) {
> return (T)value;
>   }
>   // Dirt Harry 9 3/4 end
>   // Some CharSequence subclasses are mutable, so we still need to make
>   // a copy
>   else if (value instanceof Utf8) {
> // Utf8 copy constructor is more efficient than converting
> // to string and then back to Utf8
> return (T)new Utf8((Utf8)value);
>   }
>   return (T)new Utf8(value.toString());
> {code}
>  
> Also tried with Avro {{1.10-SNAPSHOT}} of 2019-06-20 / 
> {{2d3b1fe7efd865639663ba785877182e7e038c45}} due to 
> [https://github.com/apache/avro/pull/329] - but the issue remains.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (AVRO-2438) SpecificData.deepCopy() cannot be used with URI fields

2020-05-26 Thread Daniel Kulp (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2438.
---
Fix Version/s: 1.10.0
   Resolution: Fixed

> SpecificData.deepCopy() cannot be used with URI fields
> --
>
> Key: AVRO-2438
> URL: https://issues.apache.org/jira/browse/AVRO-2438
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.0, 1.8.2
>Reporter: Sebastian J.
>Assignee: Zezeng Wang
>Priority: Major
> Fix For: 1.10.0
>
>
> Having a schema fragment like this:
> {code:java}
> {
> "name": "ownerId",
> "type": [
>   "null",
>   {
> "type": "string",
> "java-class": "java.net.URI"
>   }
> ],
> "default": null
> }{code}
> can be perfectly deserialized in a generated POJO with
> {code:java}
> @org.apache.avro.specific.AvroGenerated
> public class MyAvroDataObject extends 
> org.apache.avro.specific.SpecificRecordBase implements 
> org.apache.avro.specific.SpecificRecord {
> ...
> @Deprecated public java.net.URI ownerId;{code}
> as 
> {{GenericDatumReader.readString(Object, Schema, Decoder)}} uses via the 
> {{stringClassCache}} with 
> {code:java}
> {"type":"string","java-class":"java.net.URI"}=class java.net.URI{code}
> The {{URI}} class itself to rehydrate the value via {{newInstanceFromString}}.
>  
> On the other hand, {{deepCopy}} only considers the schema-type of the field 
> and turns in {{org.apache.avro.generic.GenericData.deepCopy(Schema, T)}}
> the {{URI}} value into an {{org.apache.avro.util.Utf8}} via the {{String}} 
> case which then causes a {{ClassCastException}}:
> {noformat}
> java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to 
> java.net.URI
>   at com.example.MyAvroDataObject.put(MyAvroDataObject.java:104)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:660)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:677)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1082)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1102)
>   at 
> org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1080){noformat}
>  
> The following dirty hack seems to avoid the issue - but is not in sync with 
> the {{stringClassCache}} which should be consulted, too:
> {code:java}
> case STRING:
>   // Strings are immutable
>   if (value instanceof String) {
> return (T)value;
>   }
>   // Dirty Harry 9 3/4 start
>   // URIs are immutable and are probably modeled as an URI itself 
>   // TODO: Check with stringClassCache & the schema
>   else if ((value instanceof URI)
> && URI.class.getName().equals(schema.getProp("java-class"))
> ) {
> return (T)value;
>   }
>   // Dirt Harry 9 3/4 end
>   // Some CharSequence subclasses are mutable, so we still need to make
>   // a copy
>   else if (value instanceof Utf8) {
> // Utf8 copy constructor is more efficient than converting
> // to string and then back to Utf8
> return (T)new Utf8((Utf8)value);
>   }
>   return (T)new Utf8(value.toString());
> {code}
>  
> Also tried with Avro {{1.10-SNAPSHOT}} of 2019-06-20 / 
> {{2d3b1fe7efd865639663ba785877182e7e038c45}} due to 
> [https://github.com/apache/avro/pull/329] - but the issue remains.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2438) SpecificData.deepCopy() cannot be used with URI fields

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116888#comment-17116888
 ] 

ASF subversion and git services commented on AVRO-2438:
---

Commit 3bf7356376ff176d17960814fad62f13f66c3a4d in avro's branch 
refs/heads/master from Zezeng Wang
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=3bf7356 ]

AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields (#703)

* AVRO-2438:SpecificData.deepCopy() cannot be used with java-class fields

* Update spotless check

* Modify comment

* AVRO-2438:Increase the deepcopy support of java-key-class

Co-authored-by: Daniel Kulp 

> SpecificData.deepCopy() cannot be used with URI fields
> --
>
> Key: AVRO-2438
> URL: https://issues.apache.org/jira/browse/AVRO-2438
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.0, 1.8.2
>Reporter: Sebastian J.
>Assignee: Zezeng Wang
>Priority: Major
>
> Having a schema fragment like this:
> {code:java}
> {
> "name": "ownerId",
> "type": [
>   "null",
>   {
> "type": "string",
> "java-class": "java.net.URI"
>   }
> ],
> "default": null
> }{code}
> can be perfectly deserialized in a generated POJO with
> {code:java}
> @org.apache.avro.specific.AvroGenerated
> public class MyAvroDataObject extends 
> org.apache.avro.specific.SpecificRecordBase implements 
> org.apache.avro.specific.SpecificRecord {
> ...
> @Deprecated public java.net.URI ownerId;{code}
> as 
> {{GenericDatumReader.readString(Object, Schema, Decoder)}} uses via the 
> {{stringClassCache}} with 
> {code:java}
> {"type":"string","java-class":"java.net.URI"}=class java.net.URI{code}
> The {{URI}} class itself to rehydrate the value via {{newInstanceFromString}}.
>  
> On the other hand, {{deepCopy}} only considers the schema-type of the field 
> and turns in {{org.apache.avro.generic.GenericData.deepCopy(Schema, T)}}
> the {{URI}} value into an {{org.apache.avro.util.Utf8}} via the {{String}} 
> case which then causes a {{ClassCastException}}:
> {noformat}
> java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to 
> java.net.URI
>   at com.example.MyAvroDataObject.put(MyAvroDataObject.java:104)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:660)
>   at org.apache.avro.generic.GenericData.setField(GenericData.java:677)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1082)
>   at org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1102)
>   at 
> org.apache.avro.generic.GenericData.deepCopy(GenericData.java:1080){noformat}
>  
> The following dirty hack seems to avoid the issue - but is not in sync with 
> the {{stringClassCache}} which should be consulted, too:
> {code:java}
> case STRING:
>   // Strings are immutable
>   if (value instanceof String) {
> return (T)value;
>   }
>   // Dirty Harry 9 3/4 start
>   // URIs are immutable and are probably modeled as an URI itself 
>   // TODO: Check with stringClassCache & the schema
>   else if ((value instanceof URI)
> && URI.class.getName().equals(schema.getProp("java-class"))
> ) {
> return (T)value;
>   }
>   // Dirt Harry 9 3/4 end
>   // Some CharSequence subclasses are mutable, so we still need to make
>   // a copy
>   else if (value instanceof Utf8) {
> // Utf8 copy constructor is more efficient than converting
> // to string and then back to Utf8
> return (T)new Utf8((Utf8)value);
>   }
>   return (T)new Utf8(value.toString());
> {code}
>  
> Also tried with Avro {{1.10-SNAPSHOT}} of 2019-06-20 / 
> {{2d3b1fe7efd865639663ba785877182e7e038c45}} due to 
> [https://github.com/apache/avro/pull/329] - but the issue remains.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Build failed in Jenkins: AvroJava #891

2020-05-26 Thread Apache Jenkins Server
See 

Changes:

[github] Add example schema for date logical type field to spec docs (#834)

[dan] AVRO-2068: Improved static class constructor performance

[dkulp] [AVRO-2806] Upgrade from Netty 3 -> Netty 4 Closes #887


--
[...truncated 61.85 KB...]
[INFO] Running org.apache.avro.io.TestBinaryData
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s 
- in org.apache.avro.io.TestBinaryData
[INFO] Running org.apache.avro.TestReadingWritingDataInEvolvedSchemas
[INFO] Tests run: 50, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s 
- in org.apache.avro.TestReadingWritingDataInEvolvedSchemas
[INFO] Running org.apache.avro.TestDataFileCorruption
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s 
- in org.apache.avro.TestDataFileCorruption
[INFO] Running org.apache.avro.TestDataFileCustomSync
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s 
- in org.apache.avro.TestDataFileCustomSync
[INFO] Running org.apache.avro.reflect.TestReflect
[INFO] Tests run: 73, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.074 s 
- in org.apache.avro.reflect.TestReflect
[INFO] Running org.apache.avro.reflect.TestReflectAllowNulls
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s 
- in org.apache.avro.reflect.TestReflectAllowNulls
[INFO] Running org.apache.avro.TestSchemaCompatibilityEnumDefaults
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s 
- in org.apache.avro.TestSchemaCompatibilityEnumDefaults
[INFO] Running org.apache.avro.io.parsing.TestResolvingGrammarGenerator
[INFO] Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s 
- in org.apache.avro.io.parsing.TestResolvingGrammarGenerator
[INFO] Running org.apache.avro.file.TestCustomCodec
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s 
- in org.apache.avro.file.TestCustomCodec
[INFO] Running org.apache.avro.TestSchemaCompatibilityMissingEnumSymbols
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s 
- in org.apache.avro.TestSchemaCompatibilityMissingEnumSymbols
[INFO] Running org.apache.avro.TestNestedRecords
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 s 
- in org.apache.avro.TestNestedRecords
[INFO] Running org.apache.avro.io.TestBinaryDecoder
[INFO] Tests run: 48, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.073 s 
- in org.apache.avro.io.TestBinaryDecoder
[INFO] Running org.apache.avro.reflect.TestReflectDatumReader
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s 
- in org.apache.avro.reflect.TestReflectDatumReader
[INFO] 
[INFO] Results:
[INFO] 
[WARNING] Tests run: 3201, Failures: 0, Errors: 0, Skipped: 1
[INFO] 
[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (test-with-fast-reader) @ avro 
---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] Running org.apache.avro.TestSchemaValidation
[INFO] Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.124 s 
- in org.apache.avro.TestSchemaValidation
[INFO] Running org.apache.avro.TestCircularReferences
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 s 
- in org.apache.avro.TestCircularReferences
[INFO] Running org.apache.avro.TestSchemaCompatibilityNameMismatch
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s 
- in org.apache.avro.TestSchemaCompatibilityNameMismatch
[INFO] Running org.apache.avro.TestDataFileCorruption
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s 
- in org.apache.avro.TestDataFileCorruption
[INFO] Running org.apache.avro.generic.TestGenericConcreteEnum
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.027 s 
- in org.apache.avro.generic.TestGenericConcreteEnum
[INFO] Running org.apache.avro.io.TestBinaryData
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s 
- in org.apache.avro.io.TestBinaryData
[INFO] Running org.apache.avro.io.parsing.TestResolvingGrammarGenerator2
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s 
- in org.apache.avro.io.parsing.TestResolvingGrammarGenerator2
[INFO] Running org.apache.avro.file.TestAllCodecs
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.545 s 
- in org.apache.avro.file.TestAllCodecs
[INFO] Running org.apache.avro.io.TestEncoders
[INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 s 
- in org.apache.avro.io.TestEncoders
[INFO] Running org.apache.avro.specific.TestSpecificToFromByteArray
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 s 
- in 

[jira] [Commented] (AVRO-2068) Improve EnumSchema constructor performance

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116862#comment-17116862
 ] 

Hudson commented on AVRO-2068:
--

FAILURE: Integrated in Jenkins build AvroJava #891 (See 
[https://builds.apache.org/job/AvroJava/891/])
AVRO-2068: Improved static class constructor performance (dan: 
[https://github.com/apache/avro/commit/1e77a401b951a481b8175e9e5f99afeebd9acf75])
* (edit) lang/java/avro/src/main/java/org/apache/avro/Schema.java


> Improve EnumSchema constructor performance
> --
>
> Key: AVRO-2068
> URL: https://issues.apache.org/jira/browse/AVRO-2068
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Reporter: Zoltan Farkas
>Priority: Trivial
>
> at 
> https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L745
>  :
> {code}
> 
>   private static class EnumSchema extends NamedSchema {
> private final List symbols;
> private final Map ordinals;
> public EnumSchema(Name name, String doc,
> LockableArrayList symbols) {
>   super(Type.ENUM, name, doc);
>   this.symbols = symbols.lock();
>   this.ordinals = new HashMap();
>   int i = 0;
>   for (String symbol : symbols)
> if (ordinals.put(validateName(symbol), i++) != null)
>   throw new SchemaParseException("Duplicate enum symbol: "+symbol);
> }
> 
> {code}
> should be changed to:
> {code}
> 
>   private static class EnumSchema extends NamedSchema {
> private final List symbols;
> private final Map ordinals;
> public EnumSchema(Name name, String doc,
> LockableArrayList symbols) {
>   super(Type.ENUM, name, doc);
>   this.symbols = symbols.lock();
>   this.ordinals = new HashMap(symbols.size());
>   int i = 0;
>   for (String symbol : symbols)
> if (ordinals.put(validateName(symbol), i++) != null)
>   throw new SchemaParseException("Duplicate enum symbol: "+symbol);
> }
> 
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2806) Upgrade Netty to 4.x

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116863#comment-17116863
 ] 

Hudson commented on AVRO-2806:
--

FAILURE: Integrated in Jenkins build AvroJava #891 (See 
[https://builds.apache.org/job/AvroJava/891/])
[AVRO-2806] Upgrade from Netty 3 -> Netty 4 Closes #887 (dkulp: 
[https://github.com/apache/avro/commit/d2d5663076d9c4a5b92b7102a21217a5c8cf6115])
* (edit) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestProtocolNetty.java
* (edit) lang/java/ipc-netty/pom.xml
* (add) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyTransceiverWhenFailsToConnect.java
* (edit) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServer.java
* (edit) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithSSL.java
* (add) 
lang/java/ipc-netty/src/test/resources/org/apache/avro/ipc/netty/servercert.p12
* (edit) lang/java/pom.xml
* (edit) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCallbacks.java
* (delete) 
lang/java/ipc-netty/src/test/resources/org/apache/avro/ipc/servercert.p12
* (delete) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/NettyTransceiverWhenFailsToConnect.java
* (edit) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyTransceiverWhenServerStops.java
* (edit) 
lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransportCodec.java
* (edit) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerConcurrentExecution.java
* (edit) 
lang/java/ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCompression.java
* (edit) 
lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyServer.java
* (edit) lang/java/grpc/pom.xml
* (edit) 
lang/java/ipc-netty/src/main/java/org/apache/avro/ipc/netty/NettyTransceiver.java


> Upgrade Netty to 4.x
> 
>
> Key: AVRO-2806
> URL: https://issues.apache.org/jira/browse/AVRO-2806
> Project: Apache Avro
>  Issue Type: Task
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Gabor Szadovszky
>Assignee: Daniel Kulp
>Priority: Major
> Fix For: 1.10.0
>
>
> ipc-netty still uses the 3.x line which is ended almost 4 years ago. We have 
> a couple of CVEs which won't be fixed in 3.x so it is important to migrate to 
> the 4.x.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (AVRO-2837) Java DecimalConversion handling of scale and precision

2020-05-26 Thread Ryan Skraba (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17111300#comment-17111300
 ] 

Ryan Skraba edited comment on AVRO-2837 at 5/26/20, 4:12 PM:
-

Thanks for looking into this!  For info, we don't use the patches attached to 
JIRA any longer; the github PR is the preferred way to propose code changes.

Just to clarify your proposal, if we have a fixed logical type with *precision 
5 and scale 2*, we'd expect:

|| Datum || P || S || 1.9.2 || Proposed||
| 123.45   | 5 | 2 |  (/) | (/) | OK, perfect match to scale and precision
| 123.450 | 6 | 3 |  (x) | (x) | Value can be represented in the logical type.
| 123.456 | 6 | 3 |  (x) | (x) | Value can be *approximated* in the logical 
type.
| 0123.45 | 6 | 2 |  (/) (!) | (x) | Value can be represented in the logical 
type.
| 9123.45 | 6 | 2 |  (/) (!) | (x) | Value can't fit in the logical type.
| 23.450 | 5 | 3 |  (x) | (?) | Value can be represented in the logical type.
| 23.456 | 5 | 3 |  (x) | (?) | Value can be *approximated* in the logical type.
| 0123.4 | 5 | 1 |  (x) | (/) | Value can be represented in the logical type.
| 9123.4 | 5 | 1 |  (x) | (/) | Value can't fit in the logical type.
| 3.456 | 4 | 3 |  (x) | (x) | Value can be *approximated* in the logical type.
| 23.45 | 4 | 2 |  (/) | (/) | Value can be represented in the logical type.
| 123.4 | 4 | 1 |  (x) | (/) | Value can be represented in the logical type.
| 9123 | 4 | 0 |  (x) | (/) | Value can't fit in the logical type.

If I remember correctly, Oracle drops and pads decimal places happily to fit 
the specified column scale, but fails for numbers too large to fit into the 
specified column precision.

**EDIT** I confirmed the behaviour for Avro 1.9.2 column, and there's 
definitely something wrong when the precision is too large, but the rules you 
suggest (OK to have precision or scale less than expected) don't seem to be 
quite right either. 

It looks like our choices should be:

#  Only accept BigDecimal that are set correctly for the logical type (because 
neither 0123.40 or 123.4 equal 123.40)
# Also accept BigDecimal with other precision/scale if they can "fit" by 
ignoring or adding zero padding (because both 0123.400 and 123.4 kind of equal 
123.40)
# In addition to the above, also accept BigDecimals that would lose part of 
their fraction when forced into the logical type (because if you shoehorn 
123.456 into a scale of 2, you obviously don't care if you lose a couple 
thousandths)

What do you think?


was (Author: ryanskraba):
Thanks for looking into this!  For info, we don't use the patches attached to 
JIRA any longer; the github PR is the preferred way to propose code changes.

Just to clarify your proposal, if we have a fixed logical type with *precision 
5 and scale 2*, we'd expect:

|| Datum || P || X || Current ||Proposed||
| 123.45   | 5 | 2 |  (/) | (/) | OK, perfect match to scale and precision
| 1123.45 | 6 | 2 |  (?) | (x) | Precision too big
| 23.456   | 5 | 3 |  (x) | (x) | Scale bigger than expected, could be 
serialized with data loss
| 123.456 | 6 | 3 |  (x) | (x) | Precision bigger than expected, could be 
serialized with data loss
| 1234.5   | 5 | 1 |  (x) | (x) | Scale smaller than expected, *might* be 
serialized without data loss depending on leading zeros
| 23.45 | 4 | 2 |  (?) | (/) | Precision smaller than expected, can be 
stored without data loss.
| 123.4   | 4 | 1 |  (x) | (/)  | Store as 123.40, pad zeros to the scale, 
*can* always be serialized without data loss
| 0123.4   | 5 | 1 |  (x) | (/)  | Store as 123.40, pad zeros to the scale, 
*might* be serialized without data loss depending on leading zeros

I don't have this table entirely clear for the Java SDK, I just want to check 
that I understand the proposal!

If I remember correctly, Oracle drops and pads decimal places happily to fit 
the column type, but fails for numbers too large to fit into the specified 
precision.

> Java DecimalConversion handling of scale and precision
> --
>
> Key: AVRO-2837
> URL: https://issues.apache.org/jira/browse/AVRO-2837
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.8.2, 1.9.2
>Reporter: Matthew McMahon
>Priority: Major
> Attachments: AVRO-2837.patch, AVRO-2837.patch
>
>
> Came across an interesting issue in Avro 1.8.2
> Configured a decimal logical type (Fixed type of size 12 with scale of 15 and 
> precision of 28).
> Due to an upstream bug, a value of 1070464558597365250.000 
> (1.07046455859736525E+18 that is then rescaled to 15) appears, and the 
> DecimalConversion attempts to turn it into a Fixed type.
> This should have failed, as it has a precision of 34 and won't fit into the 
> 12 bytes (needs 14). 

[jira] [Resolved] (AVRO-2806) Upgrade Netty to 4.x

2020-05-26 Thread Daniel Kulp (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2806.
---
Fix Version/s: 1.10.0
 Assignee: Daniel Kulp
   Resolution: Fixed

> Upgrade Netty to 4.x
> 
>
> Key: AVRO-2806
> URL: https://issues.apache.org/jira/browse/AVRO-2806
> Project: Apache Avro
>  Issue Type: Task
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Gabor Szadovszky
>Assignee: Daniel Kulp
>Priority: Major
> Fix For: 1.10.0
>
>
> ipc-netty still uses the 3.x line which is ended almost 4 years ago. We have 
> a couple of CVEs which won't be fixed in 3.x so it is important to migrate to 
> the 4.x.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2806) Upgrade Netty to 4.x

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116827#comment-17116827
 ] 

ASF subversion and git services commented on AVRO-2806:
---

Commit d2d5663076d9c4a5b92b7102a21217a5c8cf6115 in avro's branch 
refs/heads/master from Daniel Kulp
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=d2d5663 ]

[AVRO-2806] Upgrade from Netty 3 -> Netty 4
Closes #887


> Upgrade Netty to 4.x
> 
>
> Key: AVRO-2806
> URL: https://issues.apache.org/jira/browse/AVRO-2806
> Project: Apache Avro
>  Issue Type: Task
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Gabor Szadovszky
>Priority: Major
>
> ipc-netty still uses the 3.x line which is ended almost 4 years ago. We have 
> a couple of CVEs which won't be fixed in 3.x so it is important to migrate to 
> the 4.x.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2068) Improve EnumSchema constructor performance

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116808#comment-17116808
 ] 

ASF subversion and git services commented on AVRO-2068:
---

Commit 1e77a401b951a481b8175e9e5f99afeebd9acf75 in avro's branch 
refs/heads/master from David Mollitor
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=1e77a40 ]

AVRO-2068: Improved static class constructor performance


> Improve EnumSchema constructor performance
> --
>
> Key: AVRO-2068
> URL: https://issues.apache.org/jira/browse/AVRO-2068
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Reporter: Zoltan Farkas
>Priority: Trivial
>
> at 
> https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L745
>  :
> {code}
> 
>   private static class EnumSchema extends NamedSchema {
> private final List symbols;
> private final Map ordinals;
> public EnumSchema(Name name, String doc,
> LockableArrayList symbols) {
>   super(Type.ENUM, name, doc);
>   this.symbols = symbols.lock();
>   this.ordinals = new HashMap();
>   int i = 0;
>   for (String symbol : symbols)
> if (ordinals.put(validateName(symbol), i++) != null)
>   throw new SchemaParseException("Duplicate enum symbol: "+symbol);
> }
> 
> {code}
> should be changed to:
> {code}
> 
>   private static class EnumSchema extends NamedSchema {
> private final List symbols;
> private final Map ordinals;
> public EnumSchema(Name name, String doc,
> LockableArrayList symbols) {
>   super(Type.ENUM, name, doc);
>   this.symbols = symbols.lock();
>   this.ordinals = new HashMap(symbols.size());
>   int i = 0;
>   for (String symbol : symbols)
> if (ordinals.put(validateName(symbol), i++) != null)
>   throw new SchemaParseException("Duplicate enum symbol: "+symbol);
> }
> 
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116794#comment-17116794
 ] 

Hudson commented on AVRO-2836:
--

FAILURE: Integrated in Jenkins build AvroJava #890 (See 
[https://builds.apache.org/job/AvroJava/890/])
AVRO-2836 Generated java includes logical type conversions (#883) (github: 
[https://github.com/apache/avro/commit/ab83dcd6fee848cb0a82a9da328e114cc9e3568b])
* (add) 
lang/java/integration-test/codegen-test/src/test/resources/avro/nested_logical_types_union_fixed.avsc
* (edit) 
lang/java/integration-test/test-custom-conversions/src/main/java/org/apache/avro/codegentest/CustomDecimal.java
* (edit) 
lang/java/integration-test/codegen-test/src/test/java/org/apache/avro/codegentest/TestNestedLogicalTypes.java
* (edit) 
lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java
* (edit) 
lang/java/integration-test/test-custom-conversions/src/main/java/org/apache/avro/codegentest/CustomDecimalConversion.java


> SpecificCompiler does not add DecimalConversion when logical type is a Fixed 
> type
> -
>
> Key: AVRO-2836
> URL: https://issues.apache.org/jira/browse/AVRO-2836
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2
>Reporter: Matthew McMahon
>Assignee: Matthew McMahon
>Priority: Major
> Fix For: 1.10.0
>
> Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the 
> specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
> {
>   "name": "unionOfFixedDecimal",
>   "type": ["null", {
> "namespace": "org.apache.avro.codegentest.testdata",
> "name": "FixedInUnion",
> "type": "fixed",
> "size": 12,
> "logicalType": "decimal",
> "precision": 28,
> "scale": 15
>   }]
> }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the 
> DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before 
> using.
> However the fix seems to be in 
> SpecificCompiler#getClassNamesOfPrimitiveFields which is used by 
> #getUsedConversionClasses



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Build failed in Jenkins: AvroJava #890

2020-05-26 Thread Apache Jenkins Server
See 

Changes:

[github] AVRO-2836 Generated java includes logical type conversions (#883)

[dan] Always read even if skipped (readNull missing)


--
Started by an SCM change
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building remotely on H40 (ubuntu) in workspace 

No credentials specified
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/apache/avro # timeout=10
Fetching upstream changes from https://github.com/apache/avro
 > git --version # timeout=10
 > git fetch --tags --progress -- https://github.com/apache/avro 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision d3a2b149aa92608956fb0b163eb1bea06ef2c05a 
(refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f d3a2b149aa92608956fb0b163eb1bea06ef2c05a
Commit message: "Always read even if skipped (readNull missing)"
 > git rev-list --no-walk 664c2fc7fba19709c1f974055f9cf4c8a799e108 # timeout=10
[AvroJava] $ /home/jenkins/tools/maven/apache-maven-3.5.4/bin/mvn clean 
source:jar-no-fork deploy
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache Avro Toplevel   [pom]
[INFO] Apache Avro Java   [pom]
[INFO] Apache Avro [bundle]
[INFO] Apache Avro Compiler[bundle]
[INFO] Apache Avro Maven Plugin  [maven-plugin]
[INFO] Apache Avro IPC [bundle]
[INFO] Apache Avro IPC Jetty   [bundle]
[INFO] Apache Avro IPC Netty   [bundle]
[INFO] Trevni Java[pom]
[INFO] Trevni Java Core   [jar]
[INFO] Apache Avro Mapred API  [bundle]
[INFO] Trevni Java Avro   [jar]
[INFO] Trevni Specification   [pom]
[INFO] Apache Avro Tools  [jar]
[INFO] Apache Avro Protobuf Compatibility  [bundle]
[INFO] Apache Avro Thrift Compatibility[bundle]
[INFO] Apache Avro Maven Archetypes   [pom]
[INFO] Apache Avro Maven Service Archetype[maven-archetype]
[INFO] Apache Avro gRPC[bundle]
[INFO] Avro Integration Tests [pom]
[INFO] Apache Avro Codegen Test dependencies  [jar]
[INFO] Apache Avro Codegen Test   [jar]
[INFO] Apache Avro Performance Test Suite [jar]
[INFO] 
[INFO] ---< org.apache.avro:avro-toplevel >
[INFO] Building Apache Avro Toplevel 1.10.0-SNAPSHOT [1/23]
[INFO] [ pom ]-
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ avro-toplevel ---
[INFO] Deleting 
[INFO] 
[INFO] --- maven-source-plugin:3.2.1:jar-no-fork (default-cli) @ avro-toplevel 
---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven-version) @ 
avro-toplevel ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ avro-toplevel ---
[INFO] Adding ignore: module-info
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-banned-dependencies) 
@ avro-toplevel ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(process-resource-bundles) @ avro-toplevel ---
[INFO] Preparing remote bundle org.apache:apache-jar-resource-bundle:1.4
[INFO] Copying 3 resources from 1 bundle.
[INFO] 
[INFO] --- apache-rat-plugin:0.13:check (default) @ avro-toplevel ---
[INFO] Added 1 additional default licenses.
[INFO] Enabled default license matchers.
[INFO] Will parse SCM ignores for exclusions...
[INFO] Parsing exclusions from 

[INFO] Finished adding exclusions from SCM ignore files.
[INFO] 86 implicit excludes (use -debug for more details).
[INFO] 110 explicit excludes (use -debug for more details).
[INFO] 1394 resources included (use -debug for more 

[jira] [Commented] (AVRO-2474) Support a "unit" property of schema fields

2020-05-26 Thread Erik Erlandson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116783#comment-17116783
 ] 

Erik Erlandson commented on AVRO-2474:
--

[~rskraba]  [~iemejia]   I agree that this feature ought to be voted on, or 
otherwise formally discussed by the community. It involves a few hundred lines 
of new code (per language).  I submitted pr #841 so that the community could 
see how this feature would work, and what the implementation entails, etc, so 
people have something "real" to make a decision with, instead of voting on an 
abstract AEP doc.

It involves more than just code - as you can see in the PR I need to define a 
JSON (sub)schema for expressing units, and while I'm happy with the shape of 
the current proposal, there are multiple design choices that might be made here.

Lastly, adopting this implies committing to multiple language implementations, 
not just python. The good news is that it can easily enough be implemented on a 
per-language basis, but eventually implementations would be needed for at least 
some popular subset of the avro language bindings (I'm guessing at least 
python, java and c++).

I do not know what the timeline for 1.10 branch-cut is.  In theory I could 
massage #841 into a merge-able state fairly quickly, but it is a high-impact 
feature and I don't really want to rush it.

> Support a "unit" property of schema fields
> --
>
> Key: AVRO-2474
> URL: https://issues.apache.org/jira/browse/AVRO-2474
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: spec
>Affects Versions: 1.9.0
>Reporter: Erik Erlandson
>Priority: Major
>  Labels: aep
>
> Recently I have been experimenting with avro schema that are extended with a 
> "unit" field. By "unit" I mean expressions like "second", or "megabyte" - 
> that is "units of measure".
>  
> I received some community interest in making this concept "first class" for 
> avro; I'm filing this JIRA to track the idea. 
>  
> I delivered a short talk on my experiments at Berlin Buzzwords, which can be 
> viewed here:
> [https://www.youtube.com/watch?v=qrQmB2KFKE8]
>  
> I also wrote a short blog post that may be faster to ingest:
> [http://erikerlandson.github.io/blog/2019/05/23/unit-types-for-avro-schema-integrating-avro-with-coulomb/]
>  
> The project itself is here:
> [https://github.com/erikerlandson/coulomb]
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (AVRO-2499) C# reflect does not cache classes referenced in a union

2020-05-26 Thread Jira


 [ 
https://issues.apache.org/jira/browse/AVRO-2499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ismaël Mejía resolved AVRO-2499.

Resolution: Fixed

Seems like this was merged but not marked as fixed. Please don't hesitate to 
reopen it if something is missing.
CC: [~blachniet]

> C# reflect does not cache classes referenced in a union
> ---
>
> Key: AVRO-2499
> URL: https://issues.apache.org/jira/browse/AVRO-2499
> Project: Apache Avro
>  Issue Type: Bug
>  Components: csharp
>Reporter: Patrick Farry
>Assignee: Patrick Farry
>Priority: Major
> Fix For: 1.10.0
>
>
> In the example below an attempt to serialize an object of type A fails.
> { "name" : "A", 
>    "type" " : "record",
>    "fields" : [
>         { "name" : "OptionalProperty",
>            "type" : [ "null",
>                           { "name" : "B",
>                              "type" : "record",
>                              "fields" : [ "name" : "C", "type" : "string" ]
>                            }
>                       ]
>         }
> } 
>  
>  
>  
> C# classes
> public class A {
>     public B OptionalProperty \{ get; set;}
> }
> public class B {
>     public string C \{ get; set;}
> }
>  
>  
> Problem is in Reflect/ClassCache.cs line 259.
> Need to add the following case
> case UnionSchema us:
>     foreach (var o in us.Schemas)
>     {
>         if (o.Tag!=Avro.Schema.Type.Null)
>         {
>             LoadClassCache(objType, o);
>         }
>     }
>  
> Will do a PR 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (AVRO-2499) C# reflect does not cache classes referenced in a union

2020-05-26 Thread Jira


 [ 
https://issues.apache.org/jira/browse/AVRO-2499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ismaël Mejía reassigned AVRO-2499:
--

Assignee: Patrick Farry

> C# reflect does not cache classes referenced in a union
> ---
>
> Key: AVRO-2499
> URL: https://issues.apache.org/jira/browse/AVRO-2499
> Project: Apache Avro
>  Issue Type: Bug
>  Components: csharp
>Reporter: Patrick Farry
>Assignee: Patrick Farry
>Priority: Major
> Fix For: 1.10.0
>
>
> In the example below an attempt to serialize an object of type A fails.
> { "name" : "A", 
>    "type" " : "record",
>    "fields" : [
>         { "name" : "OptionalProperty",
>            "type" : [ "null",
>                           { "name" : "B",
>                              "type" : "record",
>                              "fields" : [ "name" : "C", "type" : "string" ]
>                            }
>                       ]
>         }
> } 
>  
>  
>  
> C# classes
> public class A {
>     public B OptionalProperty \{ get; set;}
> }
> public class B {
>     public string C \{ get; set;}
> }
>  
>  
> Problem is in Reflect/ClassCache.cs line 259.
> Need to add the following case
> case UnionSchema us:
>     foreach (var o in us.Schemas)
>     {
>         if (o.Tag!=Avro.Schema.Type.Null)
>         {
>             LoadClassCache(objType, o);
>         }
>     }
>  
> Will do a PR 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2836:
--
Resolution: Fixed
Status: Resolved  (was: Patch Available)

> SpecificCompiler does not add DecimalConversion when logical type is a Fixed 
> type
> -
>
> Key: AVRO-2836
> URL: https://issues.apache.org/jira/browse/AVRO-2836
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2
>Reporter: Matthew McMahon
>Assignee: Matthew McMahon
>Priority: Major
> Fix For: 1.10.0
>
> Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the 
> specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
> {
>   "name": "unionOfFixedDecimal",
>   "type": ["null", {
> "namespace": "org.apache.avro.codegentest.testdata",
> "name": "FixedInUnion",
> "type": "fixed",
> "size": 12,
> "logicalType": "decimal",
> "precision": 28,
> "scale": 15
>   }]
> }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the 
> DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before 
> using.
> However the fix seems to be in 
> SpecificCompiler#getClassNamesOfPrimitiveFields which is used by 
> #getUsedConversionClasses



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2836:
--
Fix Version/s: 1.10.0

> SpecificCompiler does not add DecimalConversion when logical type is a Fixed 
> type
> -
>
> Key: AVRO-2836
> URL: https://issues.apache.org/jira/browse/AVRO-2836
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2
>Reporter: Matthew McMahon
>Assignee: Matthew McMahon
>Priority: Major
> Fix For: 1.10.0
>
> Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the 
> specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
> {
>   "name": "unionOfFixedDecimal",
>   "type": ["null", {
> "namespace": "org.apache.avro.codegentest.testdata",
> "name": "FixedInUnion",
> "type": "fixed",
> "size": 12,
> "logicalType": "decimal",
> "precision": 28,
> "scale": 15
>   }]
> }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the 
> DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before 
> using.
> However the fix seems to be in 
> SpecificCompiler#getClassNamesOfPrimitiveFields which is used by 
> #getUsedConversionClasses



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116764#comment-17116764
 ] 

ASF subversion and git services commented on AVRO-2836:
---

Commit ab83dcd6fee848cb0a82a9da328e114cc9e3568b in avro's branch 
refs/heads/master from Matthew McMahon
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=ab83dcd ]

AVRO-2836 Generated java includes logical type conversions (#883)

* AVRO-2836 Generated java includes logical type conversions

If the logical type is used for a Fixed type (potentially also Enum)
then it should check if there are any conversions used, and
include in the generated java source

* AVRO-2836 Generated java includes logical type conversions

Move enum and fixed to use the javatype method, as if there is a
logical type conversion it will be picked up and remove a
code path

> SpecificCompiler does not add DecimalConversion when logical type is a Fixed 
> type
> -
>
> Key: AVRO-2836
> URL: https://issues.apache.org/jira/browse/AVRO-2836
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2
>Reporter: Matthew McMahon
>Assignee: Matthew McMahon
>Priority: Major
> Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the 
> specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
> {
>   "name": "unionOfFixedDecimal",
>   "type": ["null", {
> "namespace": "org.apache.avro.codegentest.testdata",
> "name": "FixedInUnion",
> "type": "fixed",
> "size": 12,
> "logicalType": "decimal",
> "precision": 28,
> "scale": 15
>   }]
> }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the 
> DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before 
> using.
> However the fix seems to be in 
> SpecificCompiler#getClassNamesOfPrimitiveFields which is used by 
> #getUsedConversionClasses



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116763#comment-17116763
 ] 

ASF subversion and git services commented on AVRO-2836:
---

Commit ab83dcd6fee848cb0a82a9da328e114cc9e3568b in avro's branch 
refs/heads/master from Matthew McMahon
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=ab83dcd ]

AVRO-2836 Generated java includes logical type conversions (#883)

* AVRO-2836 Generated java includes logical type conversions

If the logical type is used for a Fixed type (potentially also Enum)
then it should check if there are any conversions used, and
include in the generated java source

* AVRO-2836 Generated java includes logical type conversions

Move enum and fixed to use the javatype method, as if there is a
logical type conversion it will be picked up and remove a
code path

> SpecificCompiler does not add DecimalConversion when logical type is a Fixed 
> type
> -
>
> Key: AVRO-2836
> URL: https://issues.apache.org/jira/browse/AVRO-2836
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2
>Reporter: Matthew McMahon
>Assignee: Matthew McMahon
>Priority: Major
> Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the 
> specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
> {
>   "name": "unionOfFixedDecimal",
>   "type": ["null", {
> "namespace": "org.apache.avro.codegentest.testdata",
> "name": "FixedInUnion",
> "type": "fixed",
> "size": 12,
> "logicalType": "decimal",
> "precision": 28,
> "scale": 15
>   }]
> }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the 
> DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before 
> using.
> However the fix seems to be in 
> SpecificCompiler#getClassNamesOfPrimitiveFields which is used by 
> #getUsedConversionClasses



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116762#comment-17116762
 ] 

ASF subversion and git services commented on AVRO-2836:
---

Commit ab83dcd6fee848cb0a82a9da328e114cc9e3568b in avro's branch 
refs/heads/master from Matthew McMahon
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=ab83dcd ]

AVRO-2836 Generated java includes logical type conversions (#883)

* AVRO-2836 Generated java includes logical type conversions

If the logical type is used for a Fixed type (potentially also Enum)
then it should check if there are any conversions used, and
include in the generated java source

* AVRO-2836 Generated java includes logical type conversions

Move enum and fixed to use the javatype method, as if there is a
logical type conversion it will be picked up and remove a
code path

> SpecificCompiler does not add DecimalConversion when logical type is a Fixed 
> type
> -
>
> Key: AVRO-2836
> URL: https://issues.apache.org/jira/browse/AVRO-2836
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2
>Reporter: Matthew McMahon
>Assignee: Matthew McMahon
>Priority: Major
> Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the 
> specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
> {
>   "name": "unionOfFixedDecimal",
>   "type": ["null", {
> "namespace": "org.apache.avro.codegentest.testdata",
> "name": "FixedInUnion",
> "type": "fixed",
> "size": 12,
> "logicalType": "decimal",
> "precision": 28,
> "scale": 15
>   }]
> }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the 
> DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before 
> using.
> However the fix seems to be in 
> SpecificCompiler#getClassNamesOfPrimitiveFields which is used by 
> #getUsedConversionClasses



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (AVRO-2836) SpecificCompiler does not add DecimalConversion when logical type is a Fixed type

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba reassigned AVRO-2836:
-

Assignee: Matthew McMahon

> SpecificCompiler does not add DecimalConversion when logical type is a Fixed 
> type
> -
>
> Key: AVRO-2836
> URL: https://issues.apache.org/jira/browse/AVRO-2836
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2
>Reporter: Matthew McMahon
>Assignee: Matthew McMahon
>Priority: Major
> Attachments: AVRO-2836.patch
>
>
> I have updated to Avro 1.9.2 using the avro-maven-plugin to generate the 
> specific types.
> This is working nicely, except noticed the case of:
> {code:java}
> "fields": [
> {
>   "name": "unionOfFixedDecimal",
>   "type": ["null", {
> "namespace": "org.apache.avro.codegentest.testdata",
> "name": "FixedInUnion",
> "type": "fixed",
> "size": 12,
> "logicalType": "decimal",
> "precision": 28,
> "scale": 15
>   }]
> }] {code}
> This is a fixed type that has a logical type of decimal.
> When the source is generated, the type is BigDecimal. However the 
> DecimalConversion is missing and then it breaks when used.
> It seems easy to workaround by manually adding the logical conversion before 
> using.
> However the fix seems to be in 
> SpecificCompiler#getClassNamesOfPrimitiveFields which is used by 
> #getUsedConversionClasses



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2844) Avro-js can't parse default value {}

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116705#comment-17116705
 ] 

Hudson commented on AVRO-2844:
--

FAILURE: Integrated in Jenkins build AvroJava #889 (See 
[https://builds.apache.org/job/AvroJava/889/])
AVRO-2844:Avro-js can't parse default value {} (dan: 
[https://github.com/apache/avro/commit/ad63705b30504ba385cde76c530a524843adf0fc])
* (edit) lang/js/lib/schemas.js


> Avro-js can't parse default value {}
> 
>
> Key: AVRO-2844
> URL: https://issues.apache.org/jira/browse/AVRO-2844
> Project: Apache Avro
>  Issue Type: Bug
>Affects Versions: 1.8.2, 1.9.2
>Reporter: Alexey Trenikhin
>Assignee: Zezeng Wang
>Priority: Major
>
> Avro-js can't parse {code:javascript} default: {} {code}, see full example 
> below:
> {code:javascript}
> const type = avro.parse({
> name: 'Zoo',
> type: 'record',
> fields: [{
> name: 'pet',
> type: {
> name: 'Pet',
> type: 'record',
> fields: [
> {name: 'name', type: 'string', default: ''},
> {name: 'weight', type: 'long', default: 0}
> ]
> },
> default: {}
> }]
> });
> {code}
> Same schema is parsed fine by Java



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2703) Use KMP Algorithm For Sync Marker Search

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116706#comment-17116706
 ] 

Hudson commented on AVRO-2703:
--

FAILURE: Integrated in Jenkins build AvroJava #889 (See 
[https://builds.apache.org/job/AvroJava/889/])
AVRO-2703: Use KMP Algorithm For Sync Marker Search (#782) (github: 
[https://github.com/apache/avro/commit/6f431fa1717b4557768cb274524874d064485dfc])
* (edit) lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java


> Use KMP Algorithm For Sync Marker Search
> 
>
> Key: AVRO-2703
> URL: https://issues.apache.org/jira/browse/AVRO-2703
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: David Mollitor
>Assignee: David Mollitor
>Priority: Major
> Fix For: 1.10.0
>
>
> Use the [Knuth-Morris-Pratt 
> algorithm|https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm]
>  to search an Avro file for the sequence boundary instead of the current 
> naive approach based on a circular buffer.
> bq. The KMP algorithm has a better worst-case performance than the 
> straightforward algorithm



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread Hudson (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116707#comment-17116707
 ] 

Hudson commented on AVRO-2842:
--

FAILURE: Integrated in Jenkins build AvroJava #889 (See 
[https://builds.apache.org/job/AvroJava/889/])
AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891) (github: 
[https://github.com/apache/avro/commit/f30a7caee322f8679d90595f3f3d00549cdb6d29])
* (add) lang/php/lib/Datum/AvroIOBinaryDecoder.php
* (edit) lang/php/test/StringIOTest.php
* (edit) composer.json
* (add) lang/php/lib/AvroIO.php
* (add) lang/php/lib/Schema/AvroMapSchema.php
* (edit) lang/php/test/LongEncodingTest.php
* (add) lang/php/lib/DataFile/AvroDataIO.php
* (add) lang/php/lib/Schema/AvroName.php
* (edit) lang/php/test/IODatumReaderTest.php
* (add) lang/php/lib/Schema/AvroFixedSchema.php
* (add) lang/php/lib/Schema/AvroPrimitiveSchema.php
* (add) lang/php/lib/AvroGMP.php
* (edit) lang/php/test/ProtocolFileTest.php
* (add) lang/php/lib/IO/AvroStringIO.php
* (add) lang/php/lib/Schema/AvroArraySchema.php
* (add) lang/php/lib/Datum/AvroIODatumWriter.php
* (add) lang/php/README.md
* (delete) lang/php/lib/avro/debug.php
* (add) lang/php/lib/Schema/AvroNamedSchemata.php
* (delete) lang/php/lib/avro/io.php
* (edit) lang/php/test/DatumIOTest.php
* (add) lang/php/lib/AvroException.php
* (edit) lang/php/test/test_helper.php
* (add) lang/php/lib/Schema/AvroSchemaParseException.php
* (edit) lang/php/monorepo.json
* (edit) lang/php/test/NameTest.php
* (add) lang/php/lib/Protocol/AvroProtocol.php
* (add) lang/php/lib/Schema/AvroEnumSchema.php
* (delete) lang/php/lib/avro/gmp.php
* (edit) lang/php/test/DataFileTest.php
* (add) lang/php/lib/IO/AvroIOException.php
* (add) lang/php/lib/autoload.php
* (delete) lang/php/lib/avro/schema.php
* (add) lang/php/lib/Datum/AvroIOBinaryEncoder.php
* (add) lang/php/lib/IO/AvroFile.php
* (delete) lang/php/README.txt
* (add) lang/php/lib/Datum/AvroIOTypeException.php
* (add) lang/php/lib/Avro.php
* (add) lang/php/lib/DataFile/AvroDataIOReader.php
* (add) lang/php/lib/Datum/AvroIODatumReader.php
* (delete) lang/php/lib/avro/datum.php
* (add) lang/php/lib/AvroUtil.php
* (add) lang/php/lib/AvroDebug.php
* (add) lang/php/lib/AvroNotImplementedException.php
* (edit) lang/php/build.sh
* (add) lang/php/lib/Schema/AvroSchema.php
* (edit) lang/php/examples/write_read.php
* (add) lang/php/lib/Protocol/AvroProtocolParseException.php
* (add) lang/php/lib/Schema/AvroNamedSchema.php
* (add) lang/php/lib/Datum/AvroIOSchemaMatchException.php
* (edit) lang/php/test/InterOpTest.php
* (edit) .gitignore
* (delete) lang/php/lib/avro.php
* (add) lang/php/lib/Schema/AvroUnionSchema.php
* (delete) lang/php/lib/avro/util.php
* (add) lang/php/lib/DataFile/AvroDataIOException.php
* (add) lang/php/lib/DataFile/AvroDataIOWriter.php
* (add) lang/php/lib/Schema/AvroField.php
* (delete) lang/php/lib/avro/protocol.php
* (delete) lang/php/lib/avro/data_file.php
* (edit) lang/php/test/generate_interop_data.php
* (add) lang/php/lib/Schema/AvroRecordSchema.php
* (edit) lang/php/test/SchemaTest.php
* (add) lang/php/lib/Protocol/AvroProtocolMessage.php
* (edit) lang/php/test/FloatIntEncodingTest.php


> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
> Fix For: 1.10.0
>
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Build failed in Jenkins: AvroJava #889

2020-05-26 Thread Apache Jenkins Server
See 

Changes:

[dan] AVRO-2844:Avro-js can't parse default value {}

[github] AVRO-2703: Use KMP Algorithm For Sync Marker Search (#782)

[github] AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891)

[dkulp] cmake: Use GNUInstallDirs instead of hard-coded paths


--
Started by an SCM change
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building remotely on H37 (ubuntu) in workspace 

No credentials specified
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/apache/avro # timeout=10
Fetching upstream changes from https://github.com/apache/avro
 > git --version # timeout=10
 > git fetch --tags --progress -- https://github.com/apache/avro 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 664c2fc7fba19709c1f974055f9cf4c8a799e108 
(refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 664c2fc7fba19709c1f974055f9cf4c8a799e108
Commit message: "cmake: Use GNUInstallDirs instead of hard-coded paths"
 > git rev-list --no-walk 9d6a4cf2d814d1efda5caf855b3a89d8a997c6e0 # timeout=10
[AvroJava] $ /home/jenkins/tools/maven/apache-maven-3.5.4/bin/mvn clean 
source:jar-no-fork deploy
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache Avro Toplevel   [pom]
[INFO] Apache Avro Java   [pom]
[INFO] Apache Avro [bundle]
[INFO] Apache Avro Compiler[bundle]
[INFO] Apache Avro Maven Plugin  [maven-plugin]
[INFO] Apache Avro IPC [bundle]
[INFO] Apache Avro IPC Jetty   [bundle]
[INFO] Apache Avro IPC Netty   [bundle]
[INFO] Trevni Java[pom]
[INFO] Trevni Java Core   [jar]
[INFO] Apache Avro Mapred API  [bundle]
[INFO] Trevni Java Avro   [jar]
[INFO] Trevni Specification   [pom]
[INFO] Apache Avro Tools  [jar]
[INFO] Apache Avro Protobuf Compatibility  [bundle]
[INFO] Apache Avro Thrift Compatibility[bundle]
[INFO] Apache Avro Maven Archetypes   [pom]
[INFO] Apache Avro Maven Service Archetype[maven-archetype]
[INFO] Apache Avro gRPC[bundle]
[INFO] Avro Integration Tests [pom]
[INFO] Apache Avro Codegen Test dependencies  [jar]
[INFO] Apache Avro Codegen Test   [jar]
[INFO] Apache Avro Performance Test Suite [jar]
[INFO] 
[INFO] ---< org.apache.avro:avro-toplevel >
[INFO] Building Apache Avro Toplevel 1.10.0-SNAPSHOT [1/23]
[INFO] [ pom ]-
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ avro-toplevel ---
[INFO] Deleting 
[INFO] 
[INFO] --- maven-source-plugin:3.2.1:jar-no-fork (default-cli) @ avro-toplevel 
---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven-version) @ 
avro-toplevel ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ avro-toplevel ---
[INFO] Adding ignore: module-info
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-banned-dependencies) 
@ avro-toplevel ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.7.0:process 
(process-resource-bundles) @ avro-toplevel ---
[INFO] Preparing remote bundle org.apache:apache-jar-resource-bundle:1.4
[INFO] Copying 3 resources from 1 bundle.
[INFO] 
[INFO] --- apache-rat-plugin:0.13:check (default) @ avro-toplevel ---
[INFO] Added 1 additional default licenses.
[INFO] Enabled default license matchers.
[INFO] Will parse SCM ignores for exclusions...
[INFO] Parsing exclusions from 

[INFO] Finished adding exclusions from SCM ignore files.
[INFO] 86 implicit excludes 

[jira] [Updated] (AVRO-2766) [C++] Compilation failure size_t

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2766:
--
Resolution: Fixed
Status: Resolved  (was: Patch Available)

> [C++] Compilation failure size_t
> 
>
> Key: AVRO-2766
> URL: https://issues.apache.org/jira/browse/AVRO-2766
> Project: Apache Avro
>  Issue Type: Bug
>  Components: build, c++
>Affects Versions: 1.9.2
>Reporter: Laurent Stacul
>Assignee: Laurent Stacul
>Priority: Major
> Fix For: 1.10.0
>
>
> With the following system:
> {code:java}
> $ uname -a
> Linux edf2927682ca 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 
> 2020 x86_64 x86_64 x86_64 GNU/Linux
> $ gcc --version
> gcc (GCC) 10.0.1 20200220 (experimental){code}
>  
> I received the compilation error:
> {code:java}
> g++  -DAVRO_SOURCE 
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/build
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/DEPS/osp/Boost/latest/osp/include
>   -DNDEBUG -O3 -std=gnu++2a -fno-working-directory -ggdb3 -flto 
> -ffat-lto-objects -fuse-linker-plugin -Wall -O3 -DNDEBUG   -std=c++11 -fPIC 
> -o CMakeFiles/avrocpp_s.dir/impl/Zigzag.cc.o -c 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc
> In file included from 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc:20:
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:37:11:
>  error: 'size_t' does not name a type
>  37 | AVRO_DECL size_t encodeInt32(int32_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:26:1:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?
>  25 | #include "Config.hh"
>  +++ |+#include 
>  26 | /// \file
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  error: 'size_t' does not name a type
>  38 | AVRO_DECL size_t encodeInt64(int64_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?{code}
> Regards,
> Laurent
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (AVRO-2766) [C++] Compilation failure size_t

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba reassigned AVRO-2766:
-

Assignee: Laurent Stacul

> [C++] Compilation failure size_t
> 
>
> Key: AVRO-2766
> URL: https://issues.apache.org/jira/browse/AVRO-2766
> Project: Apache Avro
>  Issue Type: Bug
>  Components: build, c++
>Affects Versions: 1.9.2
>Reporter: Laurent Stacul
>Assignee: Laurent Stacul
>Priority: Major
> Fix For: 1.10.0
>
>
> With the following system:
> {code:java}
> $ uname -a
> Linux edf2927682ca 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 
> 2020 x86_64 x86_64 x86_64 GNU/Linux
> $ gcc --version
> gcc (GCC) 10.0.1 20200220 (experimental){code}
>  
> I received the compilation error:
> {code:java}
> g++  -DAVRO_SOURCE 
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/build
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/DEPS/osp/Boost/latest/osp/include
>   -DNDEBUG -O3 -std=gnu++2a -fno-working-directory -ggdb3 -flto 
> -ffat-lto-objects -fuse-linker-plugin -Wall -O3 -DNDEBUG   -std=c++11 -fPIC 
> -o CMakeFiles/avrocpp_s.dir/impl/Zigzag.cc.o -c 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc
> In file included from 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc:20:
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:37:11:
>  error: 'size_t' does not name a type
>  37 | AVRO_DECL size_t encodeInt32(int32_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:26:1:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?
>  25 | #include "Config.hh"
>  +++ |+#include 
>  26 | /// \file
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  error: 'size_t' does not name a type
>  38 | AVRO_DECL size_t encodeInt64(int64_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?{code}
> Regards,
> Laurent
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2766) [C++] Compilation failure size_t

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2766:
--
Status: Patch Available  (was: Open)

> [C++] Compilation failure size_t
> 
>
> Key: AVRO-2766
> URL: https://issues.apache.org/jira/browse/AVRO-2766
> Project: Apache Avro
>  Issue Type: Bug
>  Components: build, c++
>Affects Versions: 1.9.2
>Reporter: Laurent Stacul
>Assignee: Laurent Stacul
>Priority: Major
> Fix For: 1.10.0
>
>
> With the following system:
> {code:java}
> $ uname -a
> Linux edf2927682ca 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 
> 2020 x86_64 x86_64 x86_64 GNU/Linux
> $ gcc --version
> gcc (GCC) 10.0.1 20200220 (experimental){code}
>  
> I received the compilation error:
> {code:java}
> g++  -DAVRO_SOURCE 
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/build
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/DEPS/osp/Boost/latest/osp/include
>   -DNDEBUG -O3 -std=gnu++2a -fno-working-directory -ggdb3 -flto 
> -ffat-lto-objects -fuse-linker-plugin -Wall -O3 -DNDEBUG   -std=c++11 -fPIC 
> -o CMakeFiles/avrocpp_s.dir/impl/Zigzag.cc.o -c 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc
> In file included from 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc:20:
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:37:11:
>  error: 'size_t' does not name a type
>  37 | AVRO_DECL size_t encodeInt32(int32_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:26:1:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?
>  25 | #include "Config.hh"
>  +++ |+#include 
>  26 | /// \file
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  error: 'size_t' does not name a type
>  38 | AVRO_DECL size_t encodeInt64(int64_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?{code}
> Regards,
> Laurent
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread Daniel Kulp (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2842.
---
Fix Version/s: 1.10.0
   Resolution: Fixed

> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
> Fix For: 1.10.0
>
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116691#comment-17116691
 ] 

ASF subversion and git services commented on AVRO-2842:
---

Commit f30a7caee322f8679d90595f3f3d00549cdb6d29 in avro's branch 
refs/heads/master from Siad Ardroumli
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=f30a7ca ]

AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891)

* AVRO-2842: Add phpcs.

* AVRO-2842: Add PSR4 and code formatting.

* AVRO-2842: Fixed not found callbacks.

* AVRO-2842: Fixed PSR12 violations using phpcbf.

* AVRO-2842: Fixed PSR12 violations.

* Fixed left overs.

* Fixed example

* Added autoloader for non composer usage, updated readme and test bootstrap

* Added license

* Fixed psr issues

> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116689#comment-17116689
 ] 

ASF subversion and git services commented on AVRO-2842:
---

Commit f30a7caee322f8679d90595f3f3d00549cdb6d29 in avro's branch 
refs/heads/master from Siad Ardroumli
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=f30a7ca ]

AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891)

* AVRO-2842: Add phpcs.

* AVRO-2842: Add PSR4 and code formatting.

* AVRO-2842: Fixed not found callbacks.

* AVRO-2842: Fixed PSR12 violations using phpcbf.

* AVRO-2842: Fixed PSR12 violations.

* Fixed left overs.

* Fixed example

* Added autoloader for non composer usage, updated readme and test bootstrap

* Added license

* Fixed psr issues

> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116687#comment-17116687
 ] 

ASF subversion and git services commented on AVRO-2842:
---

Commit f30a7caee322f8679d90595f3f3d00549cdb6d29 in avro's branch 
refs/heads/master from Siad Ardroumli
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=f30a7ca ]

AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891)

* AVRO-2842: Add phpcs.

* AVRO-2842: Add PSR4 and code formatting.

* AVRO-2842: Fixed not found callbacks.

* AVRO-2842: Fixed PSR12 violations using phpcbf.

* AVRO-2842: Fixed PSR12 violations.

* Fixed left overs.

* Fixed example

* Added autoloader for non composer usage, updated readme and test bootstrap

* Added license

* Fixed psr issues

> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116692#comment-17116692
 ] 

ASF subversion and git services commented on AVRO-2842:
---

Commit f30a7caee322f8679d90595f3f3d00549cdb6d29 in avro's branch 
refs/heads/master from Siad Ardroumli
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=f30a7ca ]

AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891)

* AVRO-2842: Add phpcs.

* AVRO-2842: Add PSR4 and code formatting.

* AVRO-2842: Fixed not found callbacks.

* AVRO-2842: Fixed PSR12 violations using phpcbf.

* AVRO-2842: Fixed PSR12 violations.

* Fixed left overs.

* Fixed example

* Added autoloader for non composer usage, updated readme and test bootstrap

* Added license

* Fixed psr issues

> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116690#comment-17116690
 ] 

ASF subversion and git services commented on AVRO-2842:
---

Commit f30a7caee322f8679d90595f3f3d00549cdb6d29 in avro's branch 
refs/heads/master from Siad Ardroumli
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=f30a7ca ]

AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891)

* AVRO-2842: Add phpcs.

* AVRO-2842: Add PSR4 and code formatting.

* AVRO-2842: Fixed not found callbacks.

* AVRO-2842: Fixed PSR12 violations using phpcbf.

* AVRO-2842: Fixed PSR12 violations.

* Fixed left overs.

* Fixed example

* Added autoloader for non composer usage, updated readme and test bootstrap

* Added license

* Fixed psr issues

> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2842) PHP Add phpcs and fix all violations against PSR12

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116688#comment-17116688
 ] 

ASF subversion and git services commented on AVRO-2842:
---

Commit f30a7caee322f8679d90595f3f3d00549cdb6d29 in avro's branch 
refs/heads/master from Siad Ardroumli
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=f30a7ca ]

AVRO-2842: PHP Add phpcs and fix all violations against PSR12 (#891)

* AVRO-2842: Add phpcs.

* AVRO-2842: Add PSR4 and code formatting.

* AVRO-2842: Fixed not found callbacks.

* AVRO-2842: Fixed PSR12 violations using phpcbf.

* AVRO-2842: Fixed PSR12 violations.

* Fixed left overs.

* Fixed example

* Added autoloader for non composer usage, updated readme and test bootstrap

* Added license

* Fixed psr issues

> PHP Add phpcs and fix all violations against PSR12
> --
>
> Key: AVRO-2842
> URL: https://issues.apache.org/jira/browse/AVRO-2842
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: php
>Reporter: Siad Ardroumli
>Priority: Major
>
> To improve maintability and readability, Avro should follow the PSR12 
> standard of phpfig.
>  * Add static code analyzer (phpcs)
>  * Fix all violations using PSR12 sniff



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2766) [C++] Compilation failure size_t

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2766:
--
Fix Version/s: 1.10.0

> [C++] Compilation failure size_t
> 
>
> Key: AVRO-2766
> URL: https://issues.apache.org/jira/browse/AVRO-2766
> Project: Apache Avro
>  Issue Type: Bug
>  Components: build, c++
>Affects Versions: 1.9.2
>Reporter: Laurent Stacul
>Priority: Major
> Fix For: 1.10.0
>
>
> With the following system:
> {code:java}
> $ uname -a
> Linux edf2927682ca 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 
> 2020 x86_64 x86_64 x86_64 GNU/Linux
> $ gcc --version
> gcc (GCC) 10.0.1 20200220 (experimental){code}
>  
> I received the compilation error:
> {code:java}
> g++  -DAVRO_SOURCE 
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/build
>  
> -I/home/docker/development/opensource-pack-builder/components/avro/DEPS/osp/Boost/latest/osp/include
>   -DNDEBUG -O3 -std=gnu++2a -fno-working-directory -ggdb3 -flto 
> -ffat-lto-objects -fuse-linker-plugin -Wall -O3 -DNDEBUG   -std=c++11 -fPIC 
> -o CMakeFiles/avrocpp_s.dir/impl/Zigzag.cc.o -c 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc
> In file included from 
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/impl/Zigzag.cc:20:
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:37:11:
>  error: 'size_t' does not name a type
>  37 | AVRO_DECL size_t encodeInt32(int32_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:26:1:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?
>  25 | #include "Config.hh"
>  +++ |+#include 
>  26 | /// \file
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  error: 'size_t' does not name a type
>  38 | AVRO_DECL size_t encodeInt64(int64_t input, std::array 
> );
>  | ^~
> /home/docker/development/opensource-pack-builder/components/avro/BUILD/avro-src-1.9.2/lang/c++/api/Zigzag.hh:38:11:
>  note: 'size_t' is defined in header ''; did you forget to '#include 
> '?{code}
> Regards,
> Laurent
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2668) Build failure without a C++ compiler

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2668:
--
Fix Version/s: 1.10.0

> Build failure without a C++ compiler
> 
>
> Key: AVRO-2668
> URL: https://issues.apache.org/jira/browse/AVRO-2668
> Project: Apache Avro
>  Issue Type: Bug
>  Components: c
>Reporter: Fabrice Fontaine
>Priority: Minor
> Fix For: 1.10.0
>
>
> Build of AvroC fails without a C++ compiler:
> CMake Error at CMakeLists.txt:20 (project):
>  The CMAKE_CXX_COMPILER:
> /home/naourr/work/instance-2/output-1/host/bin/microblazeel-buildroot-linux-uclibc-g++
> is not a full path to an existing compiler tool.
> Tell CMake where to find the compiler by setting either the environment
>  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
>  to the compiler, or to the compiler name if it is in the PATH.
> More information on build failure can be found here:
>  - 
> http://autobuild.buildroot.org/results/135e246aa70f28c6b9aea5fd6b0eb9c7b45ebfe7



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2703) Use KMP Algorithm For Sync Marker Search

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116678#comment-17116678
 ] 

ASF subversion and git services commented on AVRO-2703:
---

Commit 6f431fa1717b4557768cb274524874d064485dfc in avro's branch 
refs/heads/master from belugabehr
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=6f431fa ]

AVRO-2703: Use KMP Algorithm For Sync Marker Search (#782)

* AVRO-2703: Use KMP Algorithm For Sync Marker Search

* Use different implementation to compute partial match table

Co-authored-by: David Mollitor 

> Use KMP Algorithm For Sync Marker Search
> 
>
> Key: AVRO-2703
> URL: https://issues.apache.org/jira/browse/AVRO-2703
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: David Mollitor
>Assignee: David Mollitor
>Priority: Major
>
> Use the [Knuth-Morris-Pratt 
> algorithm|https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm]
>  to search an Avro file for the sequence boundary instead of the current 
> naive approach based on a circular buffer.
> bq. The KMP algorithm has a better worst-case performance than the 
> straightforward algorithm



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (AVRO-2703) Use KMP Algorithm For Sync Marker Search

2020-05-26 Thread Daniel Kulp (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2703.
---
Fix Version/s: 1.10.0
   Resolution: Fixed

> Use KMP Algorithm For Sync Marker Search
> 
>
> Key: AVRO-2703
> URL: https://issues.apache.org/jira/browse/AVRO-2703
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: David Mollitor
>Assignee: David Mollitor
>Priority: Major
> Fix For: 1.10.0
>
>
> Use the [Knuth-Morris-Pratt 
> algorithm|https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm]
>  to search an Avro file for the sequence boundary instead of the current 
> naive approach based on a circular buffer.
> bq. The KMP algorithm has a better worst-case performance than the 
> straightforward algorithm



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2703) Use KMP Algorithm For Sync Marker Search

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116677#comment-17116677
 ] 

ASF subversion and git services commented on AVRO-2703:
---

Commit 6f431fa1717b4557768cb274524874d064485dfc in avro's branch 
refs/heads/master from belugabehr
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=6f431fa ]

AVRO-2703: Use KMP Algorithm For Sync Marker Search (#782)

* AVRO-2703: Use KMP Algorithm For Sync Marker Search

* Use different implementation to compute partial match table

Co-authored-by: David Mollitor 

> Use KMP Algorithm For Sync Marker Search
> 
>
> Key: AVRO-2703
> URL: https://issues.apache.org/jira/browse/AVRO-2703
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: David Mollitor
>Assignee: David Mollitor
>Priority: Major
>
> Use the [Knuth-Morris-Pratt 
> algorithm|https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm]
>  to search an Avro file for the sequence boundary instead of the current 
> naive approach based on a circular buffer.
> bq. The KMP algorithm has a better worst-case performance than the 
> straightforward algorithm



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2844) Avro-js can't parse default value {}

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116675#comment-17116675
 ] 

ASF subversion and git services commented on AVRO-2844:
---

Commit ad63705b30504ba385cde76c530a524843adf0fc in avro's branch 
refs/heads/master from zeshuai007
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=ad63705 ]

AVRO-2844:Avro-js can't parse default value {}


> Avro-js can't parse default value {}
> 
>
> Key: AVRO-2844
> URL: https://issues.apache.org/jira/browse/AVRO-2844
> Project: Apache Avro
>  Issue Type: Bug
>Affects Versions: 1.8.2, 1.9.2
>Reporter: Alexey Trenikhin
>Assignee: Zezeng Wang
>Priority: Major
>
> Avro-js can't parse {code:javascript} default: {} {code}, see full example 
> below:
> {code:javascript}
> const type = avro.parse({
> name: 'Zoo',
> type: 'record',
> fields: [{
> name: 'pet',
> type: {
> name: 'Pet',
> type: 'record',
> fields: [
> {name: 'name', type: 'string', default: ''},
> {name: 'weight', type: 'long', default: 0}
> ]
> },
> default: {}
> }]
> });
> {code}
> Same schema is parsed fine by Java



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (AVRO-2846) Avro C++ cmake message "Could NOT find Boost" despite finding suitable version "1.73.0"

2020-05-26 Thread Benedict Dietrich (Jira)
Benedict Dietrich created AVRO-2846:
---

 Summary: Avro C++ cmake message "Could NOT find Boost" despite 
finding suitable version "1.73.0"
 Key: AVRO-2846
 URL: https://issues.apache.org/jira/browse/AVRO-2846
 Project: Apache Avro
  Issue Type: Bug
  Components: c++
Affects Versions: 1.9.2
 Environment: * Windows Version 10.0.18362.836
 * Avro 1.9.2
 * Boost 1.73.0
 * CMake 3.17.2
Reporter: Benedict Dietrich
 Attachments: CMakeConsoleOutput.txt, CMakeOutput.log

I am trying to build Avro C++ on Windows 10. 

I get stuck on step 5 of [On native 
Windows|[https://avro.apache.org/docs/1.9.2/api/cpp/html/index.html]].

I choose the generator Visual Studio 10 2010 and Win32 as the platform.

Using Cmake GUI i get the following output in the console: 
[^CMakeConsoleOutput.txt] and the generated log is here: [^CMakeOutput.log] .

When i try to use another generator (Visual Studio 16 2019) i get the same 
Output.

What confuses me is this Output in the CMake GUI:
{code:java}
CMake Error at C:/Program 
Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 
(message):
  Could NOT find Boost (missing: filesystem iostreams program_options regex
  system) (found suitable version "1.73.0", minimum required is "1.38")
{code}
I tried the same with boost version 1.72.0 but i get the same Output in the 
CMake GUI.

Can someone help be get it to build with CMake?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2806) Upgrade Netty to 4.x

2020-05-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116659#comment-17116659
 ] 

ASF subversion and git services commented on AVRO-2806:
---

Commit cec7bfe8d02094d0171d08043dcf4109da6368a6 in avro's branch 
refs/heads/AVRO-2806 from Daniel Kulp
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=cec7bfe ]

[AVRO-2806] Minor updates after review from zeshuai007


> Upgrade Netty to 4.x
> 
>
> Key: AVRO-2806
> URL: https://issues.apache.org/jira/browse/AVRO-2806
> Project: Apache Avro
>  Issue Type: Task
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Gabor Szadovszky
>Priority: Major
>
> ipc-netty still uses the 3.x line which is ended almost 4 years ago. We have 
> a couple of CVEs which won't be fixed in 3.x so it is important to migrate to 
> the 4.x.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2733) [Ruby] mistakenly requiring rubygems

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2733:
--
Status: Patch Available  (was: Open)

> [Ruby] mistakenly requiring rubygems
> 
>
> Key: AVRO-2733
> URL: https://issues.apache.org/jira/browse/AVRO-2733
> Project: Apache Avro
>  Issue Type: Task
>Reporter: Ryan Skraba
>Assignee: Ryan Skraba
>Priority: Major
> Fix For: 1.10.0
>
>
> It looks like we are seeing two issues with running interop tests since the 
> openjdk bump that updates ruby from
> *{{ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]}}*
> to
> *{{ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]}}*
>  # The command line for interop tests includes {{-rubygems}} when it probably 
> means {{-rrubygems}}
>  # Rubygems should be automatically required since Ruby 1.9 (released 2007)
> We should fix this option in the 
> [test_rpc_interop.sh|https://github.com/apache/avro/blob/master/share/test/interop/bin/test_rpc_interop.sh]
>  file.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-1435) Convert avro-tools jar to be a bundle.

2020-05-26 Thread Ryan Skraba (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116594#comment-17116594
 ] 

Ryan Skraba commented on AVRO-1435:
---

Is this done?  I see that 
{{./lang/java/tools/target/avro-tools-1.10.0-SNAPSHOT-nodeps.jar}} exists in 
the local build and 
https://repo1.maven.org/maven2/org/apache/avro/avro-tools/1.9.2/ has 
{{avro-tools-1.9.2-nodeps.jar}} on maven central.

> Convert avro-tools jar to be a bundle.
> --
>
> Key: AVRO-1435
> URL: https://issues.apache.org/jira/browse/AVRO-1435
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Reporter: Doug Cutting
>Assignee: Doug Cutting
>Priority: Major
> Fix For: 1.10.0
>
> Attachments: AVRO-1435.patch
>
>
> All of the Avro jars except avro-tools were converted to bundles in AVRO-987. 
>  We should probably convert avro-tools-nodeps to be a bundle, since some 
> folks might wish to consume it that way.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-1726) Add support for appending a variable number of blocks to DataFileWriter

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-1726:
--
Fix Version/s: (was: 1.10.0)

> Add support for appending a variable number of blocks to DataFileWriter
> ---
>
> Key: AVRO-1726
> URL: https://issues.apache.org/jira/browse/AVRO-1726
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.7.7
>Reporter: Bryan Bende
>Priority: Minor
>  Labels: starter
> Attachments: AVRO-1726-2.patch, AVRO-1726.patch
>
>
> It would be helpful to have the ability to append a variable number of raw 
> blocks from a DataFileReader to a DataFileWriter, similar to appendAllFrom() 
> but specifying how many blocks to append.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-1461) Distribute Perl API on CPAN

2020-05-26 Thread Ryan Skraba (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116579#comment-17116579
 ] 

Ryan Skraba commented on AVRO-1461:
---

It looks like everything necessary for CPAN is done for 1.10, and we'll close 
this when the release actually happens and it can be verified.  Thanks 
[~sekikn] for taking care of this!

> Distribute Perl API on CPAN
> ---
>
> Key: AVRO-1461
> URL: https://issues.apache.org/jira/browse/AVRO-1461
> Project: Apache Avro
>  Issue Type: Wish
>  Components: perl
>Reporter: John Karp
>Assignee: Kengo Seki
>Priority: Minor
> Fix For: 1.10.0
>
>
> Having a package for the Perl Avro API distributed on CPAN would increase the 
> visibility and convenience of the Avro project to the Perl world 
> significantly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2393) C#: Add examples for new users

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2393:
--
Labels: documentation  (was: )

> C#: Add examples for new users
> --
>
> Key: AVRO-2393
> URL: https://issues.apache.org/jira/browse/AVRO-2393
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: csharp
>Reporter: Brian Lachniet
>Assignee: Brian Lachniet
>Priority: Minor
>  Labels: documentation
> Fix For: 1.10.0
>
>
> Add examples of usage for the C# API. The goal of this documentation and/or 
> code examples is to make it easier for those new to the C# API to hit the 
> ground running.
> Ideas for example locations:
>  * In the README.md
>  ** (y) Highly and immediately visible
>  ** (n) Not automatically tested
>  ** (n) Not automatically built
>  * In specially designated "example" projects (for example, like 
> [confluent-kafka-dotnet|https://github.com/confluentinc/confluent-kafka-dotnet/tree/master/examples]
>  ** (n) Not immediately visible, harder to find. Would need to mention  in 
> README.md
>  ** (n) Not automatically tested
>  ** (y) Automatically built
>  * In unit tests designed especially for readability
>  ** (n) Not immediately visible, harder to find. Would need to mention in 
> README.md
>  ** (y) Automatically tested
>  ** (y) Automatically built



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2474) Support a "unit" property of schema fields

2020-05-26 Thread Jira


 [ 
https://issues.apache.org/jira/browse/AVRO-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ismaël Mejía updated AVRO-2474:
---
Labels: aep  (was: )

> Support a "unit" property of schema fields
> --
>
> Key: AVRO-2474
> URL: https://issues.apache.org/jira/browse/AVRO-2474
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: spec
>Affects Versions: 1.9.0
>Reporter: Erik Erlandson
>Priority: Major
>  Labels: aep
>
> Recently I have been experimenting with avro schema that are extended with a 
> "unit" field. By "unit" I mean expressions like "second", or "megabyte" - 
> that is "units of measure".
>  
> I received some community interest in making this concept "first class" for 
> avro; I'm filing this JIRA to track the idea. 
>  
> I delivered a short talk on my experiments at Berlin Buzzwords, which can be 
> viewed here:
> [https://www.youtube.com/watch?v=qrQmB2KFKE8]
>  
> I also wrote a short blog post that may be faster to ingest:
> [http://erikerlandson.github.io/blog/2019/05/23/unit-types-for-avro-schema-integrating-avro-with-coulomb/]
>  
> The project itself is here:
> [https://github.com/erikerlandson/coulomb]
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2474) Support a "unit" property of schema fields

2020-05-26 Thread Jira


[ 
https://issues.apache.org/jira/browse/AVRO-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116572#comment-17116572
 ] 

Ismaël Mejía commented on AVRO-2474:


I think since this is an Avro Enhacement Proposal (aep label) we require too of 
consensus on the feature so also worth to discuss (and vote) that in the 
mailing list.

> Support a "unit" property of schema fields
> --
>
> Key: AVRO-2474
> URL: https://issues.apache.org/jira/browse/AVRO-2474
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: spec
>Affects Versions: 1.9.0
>Reporter: Erik Erlandson
>Priority: Major
>  Labels: aep
>
> Recently I have been experimenting with avro schema that are extended with a 
> "unit" field. By "unit" I mean expressions like "second", or "megabyte" - 
> that is "units of measure".
>  
> I received some community interest in making this concept "first class" for 
> avro; I'm filing this JIRA to track the idea. 
>  
> I delivered a short talk on my experiments at Berlin Buzzwords, which can be 
> viewed here:
> [https://www.youtube.com/watch?v=qrQmB2KFKE8]
>  
> I also wrote a short blog post that may be faster to ingest:
> [http://erikerlandson.github.io/blog/2019/05/23/unit-types-for-avro-schema-integrating-avro-with-coulomb/]
>  
> The project itself is here:
> [https://github.com/erikerlandson/coulomb]
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2474) Support a "unit" property of schema fields

2020-05-26 Thread Ryan Skraba (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116571#comment-17116571
 ] 

Ryan Skraba commented on AVRO-2474:
---

Hello!  I've removed the 1.10.0 fix target for this new feature.  Is that OK?  
This is a pretty major (and neat) feature to add and it doesn't look like it's 
going to be ready for when we cut the branch...

I think we'd all love to see new and interesting features move forward.  Maybe 
it would be a good idea to create some actionable subtasks that can be 
completed progressively?

> Support a "unit" property of schema fields
> --
>
> Key: AVRO-2474
> URL: https://issues.apache.org/jira/browse/AVRO-2474
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: spec
>Affects Versions: 1.9.0
>Reporter: Erik Erlandson
>Priority: Major
>
> Recently I have been experimenting with avro schema that are extended with a 
> "unit" field. By "unit" I mean expressions like "second", or "megabyte" - 
> that is "units of measure".
>  
> I received some community interest in making this concept "first class" for 
> avro; I'm filing this JIRA to track the idea. 
>  
> I delivered a short talk on my experiments at Berlin Buzzwords, which can be 
> viewed here:
> [https://www.youtube.com/watch?v=qrQmB2KFKE8]
>  
> I also wrote a short blog post that may be faster to ingest:
> [http://erikerlandson.github.io/blog/2019/05/23/unit-types-for-avro-schema-integrating-avro-with-coulomb/]
>  
> The project itself is here:
> [https://github.com/erikerlandson/coulomb]
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2474) Support a "unit" property of schema fields

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2474:
--
Fix Version/s: (was: 1.10.0)

> Support a "unit" property of schema fields
> --
>
> Key: AVRO-2474
> URL: https://issues.apache.org/jira/browse/AVRO-2474
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: spec
>Affects Versions: 1.9.0
>Reporter: Erik Erlandson
>Priority: Major
>
> Recently I have been experimenting with avro schema that are extended with a 
> "unit" field. By "unit" I mean expressions like "second", or "megabyte" - 
> that is "units of measure".
>  
> I received some community interest in making this concept "first class" for 
> avro; I'm filing this JIRA to track the idea. 
>  
> I delivered a short talk on my experiments at Berlin Buzzwords, which can be 
> viewed here:
> [https://www.youtube.com/watch?v=qrQmB2KFKE8]
>  
> I also wrote a short blog post that may be faster to ingest:
> [http://erikerlandson.github.io/blog/2019/05/23/unit-types-for-avro-schema-integrating-avro-with-coulomb/]
>  
> The project itself is here:
> [https://github.com/erikerlandson/coulomb]
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2492) Remove Schema createRecord from list method

2020-05-26 Thread Jira


[ 
https://issues.apache.org/jira/browse/AVRO-2492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116566#comment-17116566
 ] 

Ismaël Mejía commented on AVRO-2492:


I am still hesitant if this makes sense now I understand more clearly the goal. 
TBD

> Remove Schema createRecord from list method
> ---
>
> Key: AVRO-2492
> URL: https://issues.apache.org/jira/browse/AVRO-2492
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Reporter: Ismaël Mejía
>Assignee: Ismaël Mejía
>Priority: Minor
>
> This is a follow up of AVRO-2491 who deprecated such method, and should 
> probably be targeted for the 1.10.0 release



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2492) Remove Schema createRecord from list method

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2492:
--
Fix Version/s: (was: 1.10.0)

> Remove Schema createRecord from list method
> ---
>
> Key: AVRO-2492
> URL: https://issues.apache.org/jira/browse/AVRO-2492
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Reporter: Ismaël Mejía
>Assignee: Ismaël Mejía
>Priority: Minor
>
> This is a follow up of AVRO-2491 who deprecated such method, and should 
> probably be targeted for the 1.10.0 release



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2660) Travis build should verify glibc and musl compilation.

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2660:
--
Fix Version/s: (was: 1.11.0)

> Travis build should verify glibc and musl compilation.
> --
>
> Key: AVRO-2660
> URL: https://issues.apache.org/jira/browse/AVRO-2660
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: c
>Reporter: Ryan Skraba
>Priority: Major
>
> The C language can be compiled with glibc and 
> [musl|https://github.com/apache/avro/pull/740].  We should add a check to the 
> build to ensure that this is true.
> (To verify: uclibc-ng?)
> A minimum environment to test musl using alpine docker:
> docker run --rm -it -v $PWD:$HOME/avro -w $HOME/avro alpine:3.7 sh -c "apk 
> add g++ cmake bash jansson-dev make && cd lang/c && ./build.sh test"
> For glibc (like the build process uses), we can do the equivalent:
> docker run --rm -it -v $PWD:$HOME/avro -w $HOME/avro gcc:9.2 bash -c "apt-get 
> update -y && apt-get -y install cmake libjansson-dev && cd lang/c && 
> ./build.sh test"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (AVRO-2660) Travis build should verify glibc and musl compilation.

2020-05-26 Thread Ryan Skraba (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Skraba updated AVRO-2660:
--
Fix Version/s: (was: 1.10.0)
   1.11.0

> Travis build should verify glibc and musl compilation.
> --
>
> Key: AVRO-2660
> URL: https://issues.apache.org/jira/browse/AVRO-2660
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: c
>Reporter: Ryan Skraba
>Priority: Major
> Fix For: 1.11.0
>
>
> The C language can be compiled with glibc and 
> [musl|https://github.com/apache/avro/pull/740].  We should add a check to the 
> build to ensure that this is true.
> (To verify: uclibc-ng?)
> A minimum environment to test musl using alpine docker:
> docker run --rm -it -v $PWD:$HOME/avro -w $HOME/avro alpine:3.7 sh -c "apk 
> add g++ cmake bash jansson-dev make && cd lang/c && ./build.sh test"
> For glibc (like the build process uses), we can do the equivalent:
> docker run --rm -it -v $PWD:$HOME/avro -w $HOME/avro gcc:9.2 bash -c "apt-get 
> update -y && apt-get -y install cmake libjansson-dev && cd lang/c && 
> ./build.sh test"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2844) Avro-js can't parse default value {}

2020-05-26 Thread Zezeng Wang (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116539#comment-17116539
 ] 

Zezeng Wang commented on AVRO-2844:
---

In this example, I think the schema is incomplete. If the name and weight in 
the fields have default values, 
then default: {}, It is duplicate and can be deleted. If it is not deleted, it 
can be modified to:
default: {name: '', weight: 0}

> Avro-js can't parse default value {}
> 
>
> Key: AVRO-2844
> URL: https://issues.apache.org/jira/browse/AVRO-2844
> Project: Apache Avro
>  Issue Type: Bug
>Affects Versions: 1.8.2, 1.9.2
>Reporter: Alexey Trenikhin
>Assignee: Zezeng Wang
>Priority: Major
>
> Avro-js can't parse {code:javascript} default: {} {code}, see full example 
> below:
> {code:javascript}
> const type = avro.parse({
> name: 'Zoo',
> type: 'record',
> fields: [{
> name: 'pet',
> type: {
> name: 'Pet',
> type: 'record',
> fields: [
> {name: 'name', type: 'string', default: ''},
> {name: 'weight', type: 'long', default: 0}
> ]
> },
> default: {}
> }]
> });
> {code}
> Same schema is parsed fine by Java



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2844) Avro-js can't parse default value {}

2020-05-26 Thread Zezeng Wang (Jira)


[ 
https://issues.apache.org/jira/browse/AVRO-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116538#comment-17116538
 ] 

Zezeng Wang commented on AVRO-2844:
---

I verified the above example and it failed.
I have modified it locally and will submit a PR for this ticket later.

> Avro-js can't parse default value {}
> 
>
> Key: AVRO-2844
> URL: https://issues.apache.org/jira/browse/AVRO-2844
> Project: Apache Avro
>  Issue Type: Bug
>Affects Versions: 1.8.2, 1.9.2
>Reporter: Alexey Trenikhin
>Priority: Major
>
> Avro-js can't parse {code:javascript} default: {} {code}, see full example 
> below:
> {code:javascript}
> const type = avro.parse({
> name: 'Zoo',
> type: 'record',
> fields: [{
> name: 'pet',
> type: {
> name: 'Pet',
> type: 'record',
> fields: [
> {name: 'name', type: 'string', default: ''},
> {name: 'weight', type: 'long', default: 0}
> ]
> },
> default: {}
> }]
> });
> {code}
> Same schema is parsed fine by Java



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (AVRO-2844) Avro-js can't parse default value {}

2020-05-26 Thread Zezeng Wang (Jira)


 [ 
https://issues.apache.org/jira/browse/AVRO-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zezeng Wang reassigned AVRO-2844:
-

Assignee: Zezeng Wang

> Avro-js can't parse default value {}
> 
>
> Key: AVRO-2844
> URL: https://issues.apache.org/jira/browse/AVRO-2844
> Project: Apache Avro
>  Issue Type: Bug
>Affects Versions: 1.8.2, 1.9.2
>Reporter: Alexey Trenikhin
>Assignee: Zezeng Wang
>Priority: Major
>
> Avro-js can't parse {code:javascript} default: {} {code}, see full example 
> below:
> {code:javascript}
> const type = avro.parse({
> name: 'Zoo',
> type: 'record',
> fields: [{
> name: 'pet',
> type: {
> name: 'Pet',
> type: 'record',
> fields: [
> {name: 'name', type: 'string', default: ''},
> {name: 'weight', type: 'long', default: 0}
> ]
> },
> default: {}
> }]
> });
> {code}
> Same schema is parsed fine by Java



--
This message was sent by Atlassian Jira
(v8.3.4#803005)