[jira] [Commented] (AVRO-2192) Remove paranamer dependency from Avro

2018-12-04 Thread ASF subversion and git services (JIRA)


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

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

Commit b64081ee174e5b5aefcd93c3bc6c5aefe6acbf49 in avro's branch 
refs/heads/master from [~iemejia]
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=b64081e ]

AVRO-2192: Remove paranamer dependency from Avro (#400)



> Remove paranamer dependency from Avro
> -
>
> Key: AVRO-2192
> URL: https://issues.apache.org/jira/browse/AVRO-2192
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.2
>Reporter: RAJKUMAR NATARAJAN
>Assignee: Ismaël Mejía
>Priority: Minor
> Fix For: 1.9.0
>
>
> Hi,
>  
> Avro seems to be depend upon the com.thoughtworks.paranamer. Avro 1.7.7 
> depends upon 2.7 and 1.8. depends on 2.8 paranamer versions.
>  
> Please remove this dependency in the future versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (AVRO-2192) Remove paranamer dependency from Avro

2018-12-04 Thread Fokko Driesprong (JIRA)


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

Fokko Driesprong resolved AVRO-2192.

Resolution: Fixed

> Remove paranamer dependency from Avro
> -
>
> Key: AVRO-2192
> URL: https://issues.apache.org/jira/browse/AVRO-2192
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.2
>Reporter: RAJKUMAR NATARAJAN
>Assignee: Ismaël Mejía
>Priority: Minor
> Fix For: 1.9.0
>
>
> Hi,
>  
> Avro seems to be depend upon the com.thoughtworks.paranamer. Avro 1.7.7 
> depends upon 2.7 and 1.8. depends on 2.8 paranamer versions.
>  
> Please remove this dependency in the future versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-2192) Remove paranamer dependency from Avro

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-2192:
--

Fokko closed pull request #400: AVRO-2192: Remove paranamer dependency from Avro
URL: https://github.com/apache/avro/pull/400
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/java/avro/pom.xml b/lang/java/avro/pom.xml
index 0eb36857a..d04c05513 100644
--- a/lang/java/avro/pom.xml
+++ b/lang/java/avro/pom.xml
@@ -38,7 +38,6 @@
 
   !org.apache.avro*,
   com.fasterxml.jackson*,
-  com.thoughtworks.paranamer;resolution:=optional,
   org.xerial.snappy;resolution:=optional,
   sun.misc;resolution:=optional,
   *
@@ -56,24 +55,6 @@
   
 
 
-  
-com.thoughtworks.paranamer
-paranamer-maven-plugin
-${paranamer.version}
-
-  
-paranamer-test
-
-  
${project.build.testSourceDirectory}
-  
${project.build.testOutputDirectory}
-
-process-test-classes
-
-  generate
-
-  
-
-  
   
 org.apache.maven.plugins
 maven-jar-plugin
@@ -146,11 +127,6 @@
   com.fasterxml.jackson.core
   jackson-databind
 
-
-  com.thoughtworks.paranamer
-  paranamer
-  true
-
 
   org.apache.commons
   commons-compress
diff --git 
a/lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java 
b/lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java
index 3e9e0796f..6e9b7792e 100644
--- a/lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java
+++ b/lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java
@@ -24,6 +24,7 @@
 import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.lang.reflect.Parameter;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.nio.ByteBuffer;
@@ -38,7 +39,6 @@
 import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Function;
 
 import org.apache.avro.AvroRemoteException;
 import org.apache.avro.AvroRuntimeException;
@@ -763,11 +763,11 @@ protected Schema createFieldSchema(Field field, 
Map names) {
 return schema;
   }
 
-  /** Return the protocol for a Java interface.
-   * Note that this requires that http://paranamer.codehaus.org/;>Paranamer is run over compiled
-   * interface declarations, since Java 6 reflection does not provide access to
-   * method parameter names.  See Avro's build.xml for an example. */
+  /**
+   * Return the protocol for a Java interface.
+   * The correct name of the method parameters needs the 
-parameters
+   * java compiler argument. More info at https://openjdk.java.net/jeps/118
+   */
   @Override
   public Protocol getProtocol(Class iface) {
 Protocol protocol =
@@ -792,32 +792,15 @@ public Protocol getProtocol(Class iface) {
 return protocol;
   }
 
-  private Function paranamer;
-  private synchronized Function getParanamer() {
-if (paranamer == null) {
-  try {
-final com.thoughtworks.paranamer.CachingParanamer p = new 
com.thoughtworks.paranamer.CachingParanamer();
-paranamer = new Function() {
-  public String[] apply(Method t) {
-return p.lookupParameterNames(t);
-  }
-};
-  } catch (Throwable t) {
-paranamer = new Function() {
-  public String[] apply(Method t) {
-return new String[0];
-  }
-};
-  }
-}
-return paranamer;
-  }
-
   private String[] getParameterNames(Method m) {
-return getParanamer().apply(m);
+Parameter[] parameters = m.getParameters();
+String[] paramNames = new String[parameters.length];
+for (int i = 0; i < parameters.length; i++) {
+  paramNames[i] = parameters[i].getName();
+}
+return paramNames;
   }
 
-
   private Message getMessage(Method method, Protocol protocol,
  Map names) {
 List fields = new ArrayList<>();
diff --git a/lang/java/pom.xml b/lang/java/pom.xml
index 773d71c5e..9d64b6efb 100644
--- a/lang/java/pom.xml
+++ b/lang/java/pom.xml
@@ -44,7 +44,6 @@
 5.0.4
 4.12
 3.10.6.Final
-2.8
 2.6.1
 0.9.3
 1.7.25
@@ -110,6 +109,9 @@
   
 1.8
 1.8
+
+  -parameters
+
   
 
 
@@ -351,19 +353,6 @@
 
   
 
-

[jira] [Commented] (AVRO-2192) Remove paranamer dependency from Avro

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-2192:
--

Fokko commented on issue #400: AVRO-2192: Remove paranamer dependency from Avro
URL: https://github.com/apache/avro/pull/400#issuecomment-444264737
 
 
   Good one @iemejia 
   
   Can you rebase onto master, the failing CI looks unrelated. I've also 
restarted the CI.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove paranamer dependency from Avro
> -
>
> Key: AVRO-2192
> URL: https://issues.apache.org/jira/browse/AVRO-2192
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.2
>Reporter: RAJKUMAR NATARAJAN
>Assignee: Ismaël Mejía
>Priority: Minor
> Fix For: 1.9.0
>
>
> Hi,
>  
> Avro seems to be depend upon the com.thoughtworks.paranamer. Avro 1.7.7 
> depends upon 2.7 and 1.8. depends on 2.8 paranamer versions.
>  
> Please remove this dependency in the future versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: Tagging PRs in github

2018-12-04 Thread Driesprong, Fokko
Definitely, thanks a lot Ismaël!

Op za 1 dec. 2018 om 00:21 schreef Michael A. Smith :

> Thanks for doing that. It was very needed.
>
> Can we automate doing this somehow.
>
> On Thu, Nov 29, 2018 at 17:52 Ismaël Mejía  wrote:
>
> > Hello,
> >
> > I tagged all open PRs in github using the Label feature and the
> > respective languages as part of the effort to get more reviews done.
> > Hopefully people and committers can filter quickly their favorite
> > language and this encourages them to help review.
> >
> > Sorry for taking this initiative without contacting dev@ first and for
> > the additional email spam that some of you guys involved in the
> > reviews probably received.
> >
> > I hope other committers agree with this idea so we can keep this
> > tagging in the future (of course as well as the equivalent
> > "Components"  tag in Jira too.
> >
> > Regards,
> > Ismaël
> >
>


[jira] [Commented] (AVRO-2112) c# (.net) port to .NET Standard 2.0 and nuget (package) dependencies

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-2112:
--

Fokko commented on issue #307: AVRO-2112: Target .NET Standard/Core in C#
URL: https://github.com/apache/avro/pull/307#issuecomment-444258716
 
 
   @blachniet Do you think to either add an exception in `pom.xml` or add the 
license. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> c# (.net) port to .NET Standard 2.0 and nuget (package) dependencies
> 
>
> Key: AVRO-2112
> URL: https://issues.apache.org/jira/browse/AVRO-2112
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: csharp
> Environment: - Visual Studio For Mac
> - Visual Studio 2017
> - mono 5.4.1.7 MacOSX
> - dotnet 2.0 (MacOSX and Windows 10)
>Reporter: Miljenko Cvjetko
>Assignee: Miljenko Cvjetko
>Priority: Minor
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> Suugestion is to add .NET Standard/Core support.
> In order to support modern/new .NET (both standard netfx and dotnet core) it 
> is necessary to convert projects to support .NET Standard Libraries. 
> - conversion to .NET Standard [DONE]
> - added dotnet core sample (Avro.perf) [DONE]
> - added netfx (standrd .NET) sample Avro.perf.netfx [DONE]
> - unit testing updated to use NUnit 3
> Url for the github forked repo with branch will be added.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-2277) clean up Ruby warnings

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-2277:
--

Fokko commented on issue #392: AVRO-2277: Clean up Ruby warnings
URL: https://github.com/apache/avro/pull/392#issuecomment-444257865
 
 
   Thanks @tjwp 
   
   Sorry for the late response, I'm moving, so I'm a bit short on time :'(


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> clean up Ruby warnings
> --
>
> Key: AVRO-2277
> URL: https://issues.apache.org/jira/browse/AVRO-2277
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: ruby
>Reporter: Tim Perkins
>Assignee: Tim Perkins
>Priority: Minor
> Fix For: 1.9.0
>
>
> Running tests for the Ruby implementation generates a lot of warnings and 
> makes it unclear that the Ruby tests are passing.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-2192) Remove paranamer dependency from Avro

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-2192:
--

iemejia opened a new pull request #400: AVRO-2192: Remove paranamer dependency 
from Avro
URL: https://github.com/apache/avro/pull/400
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove paranamer dependency from Avro
> -
>
> Key: AVRO-2192
> URL: https://issues.apache.org/jira/browse/AVRO-2192
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.2
>Reporter: RAJKUMAR NATARAJAN
>Assignee: Ismaël Mejía
>Priority: Minor
> Fix For: 1.9.0
>
>
> Hi,
>  
> Avro seems to be depend upon the com.thoughtworks.paranamer. Avro 1.7.7 
> depends upon 2.7 and 1.8. depends on 2.8 paranamer versions.
>  
> Please remove this dependency in the future versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (AVRO-2192) remove paranamer dependency from Avro

2018-12-04 Thread JIRA


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

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

Assignee: Ismaël Mejía

> remove paranamer dependency from Avro
> -
>
> Key: AVRO-2192
> URL: https://issues.apache.org/jira/browse/AVRO-2192
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.2
>Reporter: RAJKUMAR NATARAJAN
>Assignee: Ismaël Mejía
>Priority: Minor
> Fix For: 1.9.0
>
>
> Hi,
>  
> Avro seems to be depend upon the com.thoughtworks.paranamer. Avro 1.7.7 
> depends upon 2.7 and 1.8. depends on 2.8 paranamer versions.
>  
> Please remove this dependency in the future versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-2192) Remove paranamer dependency from Avro

2018-12-04 Thread JIRA


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

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


After move to Java 8 (AVRO-2043) We can achieve this just by relying in the 
java compiler `-parameters` argument and normal reflection.

> Remove paranamer dependency from Avro
> -
>
> Key: AVRO-2192
> URL: https://issues.apache.org/jira/browse/AVRO-2192
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.2
>Reporter: RAJKUMAR NATARAJAN
>Assignee: Ismaël Mejía
>Priority: Minor
> Fix For: 1.9.0
>
>
> Hi,
>  
> Avro seems to be depend upon the com.thoughtworks.paranamer. Avro 1.7.7 
> depends upon 2.7 and 1.8. depends on 2.8 paranamer versions.
>  
> Please remove this dependency in the future versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (AVRO-2192) Remove paranamer dependency from Avro

2018-12-04 Thread JIRA


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

Ismaël Mejía updated AVRO-2192:
---
Summary: Remove paranamer dependency from Avro  (was: remove paranamer 
dependency from Avro)

> Remove paranamer dependency from Avro
> -
>
> Key: AVRO-2192
> URL: https://issues.apache.org/jira/browse/AVRO-2192
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.8.2
>Reporter: RAJKUMAR NATARAJAN
>Assignee: Ismaël Mejía
>Priority: Minor
> Fix For: 1.9.0
>
>
> Hi,
>  
> Avro seems to be depend upon the com.thoughtworks.paranamer. Avro 1.7.7 
> depends upon 2.7 and 1.8. depends on 2.8 paranamer versions.
>  
> Please remove this dependency in the future versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: Radical idea for 1.9.0

2018-12-04 Thread Sean Busbey
In the future please use "[DISCUSS]" at the start of your subject line
for these kinds of proposals. that'll get more folks to see the
discussion, e.g. when they filter this list.

as a point of clarification, 1.9.0 is a major version change for the
Avro project. the "1" is a file format version. that's why API
incompatibilities are allowed in a new 1.y version. As Doug mentioned,
"would not be able to read binary files" means you're talking about a
file format incompatibility, which I don't think we should do.

Are you interested in removing this feature to improve code
maintenance or to improve performance? both?

Can you quantify the amount of complexity you're referring to?
On Fri, Nov 30, 2018 at 12:22 PM Raymie Stata  wrote:
>
> I understand we've been willing to introduce backward-incompatible API
> changes (not file-format changes) into minor release versions.  If so,
> here's an idea for consideration:
>
> Let's eliminate recursive records from Avro 1.9.x.  Recursion
> introduces a _lot_ of complexity into many parts of the Avro code
> base.  We could vastly simplify the code base, and probably speed
> things up, by getting rid of this feature.
>
> The specific proposal would be that Avro 1.9.x would refuse to accept
> recursive records, and thus would not be able to read binary files
> written by older versions of Avro.  I haven't heard of anyone actually
> using them, so I don't think this would be a problem.



-- 
busbey


[jira] [Commented] (AVRO-2273) Release 1.8.3

2018-12-04 Thread Sean Busbey (JIRA)


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

Sean Busbey commented on AVRO-2273:
---

Reminder that in Avro the second number is a major version. So asking folks to 
upgrade to 1.9.0 is a lot to ask. The project can certainly require that; any 
folks who want to still have the earlier versions can come help drive those 
releases. Just something to be aware of, probably worth a DISCUSS thread on 
dev@avro?

> Release 1.8.3
> -
>
> Key: AVRO-2273
> URL: https://issues.apache.org/jira/browse/AVRO-2273
> Project: Apache Avro
>  Issue Type: Task
>Reporter: Thiruvalluvan M. G.
>Priority: Major
> Fix For: 1.8.3
>
>
> This ticket is for releasing Avro 1.8.3 and discussing any topics related to 
> it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: C++ version for 1.9

2018-12-04 Thread Sean Busbey
1.9 is a major version change, so long as we release note the
incompatible change this should be fine. Especially if the folks doing
hte day-to-day maintenance of the C++ code want a newer standard.
On Tue, Dec 4, 2018 at 11:04 AM Daniel Kulp  wrote:
>
>
> I’ve updated and merged the PR for moving to unique_ptr.   That wasn’t too 
> hard.
>
> std::any is a C++17 thing, correct?   Thus, we cannot move to that unless we 
> go all the way up? Or is that something we would parameterize to use 
> std::any if available or boot:any if not?
>
> Dan
>
>
>
>
> > On Dec 4, 2018, at 9:15 AM, Thiruvalluvan MG  
> > wrote:
> >
> > Hi Daniel,
> > I can take care of these issues. Give me a week or so.
> > Thanks
> > Thiru
> >On Tuesday, 4 December, 2018, 7:26:53 PM IST, Daniel Kulp 
> >  wrote:
> >
> >
> >
> >> On Dec 3, 2018, at 8:50 PM, Thiruvalluvan MG  
> >> wrote:
> >> I am for moving to C++11.
> >> In addition to replacing auto_ptr with unique_ptr, we can get a few more 
> >> things moved. E.g. boost::any to std::any, which has small buffer 
> >> optimization. We can also replace ref counted boost pointers with those in 
> >> std::.
> >> However, there is one hitch. The C++ API directly exposes auto_ptr (and 
> >> possibly boost::any) instead of typedef'ing them in avro namespace. So 
> >> almost all C++ users of Avro 1.8.x and before will have to modify their 
> >> sources in order to compile with 1.9.0. This problem is not going to go 
> >> away, so we should swallow it some time. Let it be 1.9.0. It will be 
> >> worthwhile to publish a migration guide.
> >
> > I can look at the std::auto_ptr and std::any changes.  For the post part, 
> > those are search/replace.  I don’t know anything about the ref counted 
> > stuff.  Is there anyone around that could look at that?  Is that also just 
> > a search/replace?
> >
> > C++ is not my strong point, I’m mostly a Java person.  C++ is just used to 
> > control Christmas lights and we generally don’t push the language too hard 
> > for that.  :)
> >
> >
> > --
> > Daniel Kulp
> > dk...@apache.org  - http://dankulp.com/blog 
> > 
> > Talend Community Coder - http://talend.com 
>
> --
> Daniel Kulp
> dk...@apache.org  - http://dankulp.com/blog 
> 
> Talend Community Coder - http://talend.com 



-- 
busbey


Re: C++ version for 1.9

2018-12-04 Thread Daniel Kulp

I’ve updated and merged the PR for moving to unique_ptr.   That wasn’t too hard.

std::any is a C++17 thing, correct?   Thus, we cannot move to that unless we go 
all the way up? Or is that something we would parameterize to use std::any 
if available or boot:any if not?

Dan




> On Dec 4, 2018, at 9:15 AM, Thiruvalluvan MG  
> wrote:
> 
> Hi Daniel,
> I can take care of these issues. Give me a week or so.
> Thanks
> Thiru
>On Tuesday, 4 December, 2018, 7:26:53 PM IST, Daniel Kulp 
>  wrote:  
> 
> 
> 
>> On Dec 3, 2018, at 8:50 PM, Thiruvalluvan MG  
>> wrote:
>> I am for moving to C++11.
>> In addition to replacing auto_ptr with unique_ptr, we can get a few more 
>> things moved. E.g. boost::any to std::any, which has small buffer 
>> optimization. We can also replace ref counted boost pointers with those in 
>> std::.
>> However, there is one hitch. The C++ API directly exposes auto_ptr (and 
>> possibly boost::any) instead of typedef'ing them in avro namespace. So 
>> almost all C++ users of Avro 1.8.x and before will have to modify their 
>> sources in order to compile with 1.9.0. This problem is not going to go 
>> away, so we should swallow it some time. Let it be 1.9.0. It will be 
>> worthwhile to publish a migration guide.
> 
> I can look at the std::auto_ptr and std::any changes.  For the post part, 
> those are search/replace.  I don’t know anything about the ref counted stuff. 
>  Is there anyone around that could look at that?  Is that also just a 
> search/replace?
> 
> C++ is not my strong point, I’m mostly a Java person.  C++ is just used to 
> control Christmas lights and we generally don’t push the language too hard 
> for that.  :)
> 
> 
> -- 
> Daniel Kulp
> dk...@apache.org  - http://dankulp.com/blog 
> 
> Talend Community Coder - http://talend.com   

-- 
Daniel Kulp
dk...@apache.org  - http://dankulp.com/blog 

Talend Community Coder - http://talend.com 


[jira] [Commented] (AVRO-1542) std::auto_ptr

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1542:
--

dkulp commented on issue #203: AVRO-1542: Replace deprecated std::auto_ptr
URL: https://github.com/apache/avro/pull/203#issuecomment-444175491
 
 
   Avro has decided to require c++ 11 for 1.9. Thus, I've merge #157 (with 
updates) that use the std::unique_ptr.   This will require migration for users.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> std::auto_ptr
> -
>
> Key: AVRO-1542
> URL: https://issues.apache.org/jira/browse/AVRO-1542
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: c++
>Affects Versions: 1.7.6
>Reporter: Sean Middleditch
>Priority: Trivial
> Fix For: 1.9.0
>
>
> std::auto_ptr is deprecated, meaning that it may be removed from a future 
> version of the C++ standard (though vendors would not likely remove it... 
> probably).
> Avro should at its next API-breaking opportunity replace its use of auto_ptr 
> with std::unique_ptr or shared_ptr or a custom smart pointer.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-1542) std::auto_ptr

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1542:
--

dkulp closed pull request #203: AVRO-1542: Replace deprecated std::auto_ptr
URL: https://github.com/apache/avro/pull/203
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/c++/api/DataFile.hh b/lang/c++/api/DataFile.hh
index bff309770..e3b602583 100644
--- a/lang/c++/api/DataFile.hh
+++ b/lang/c++/api/DataFile.hh
@@ -65,8 +65,8 @@ class AVRO_DECL DataFileWriterBase : boost::noncopyable {
 const size_t syncInterval_;
 Codec codec_;
 
-std::auto_ptr stream_;
-std::auto_ptr buffer_;
+boost::movelib::unique_ptr stream_;
+boost::movelib::unique_ptr buffer_;
 const DataFileSync sync_;
 int64_t objectCount_;
 
@@ -74,7 +74,7 @@ class AVRO_DECL DataFileWriterBase : boost::noncopyable {
 
 Metadata metadata_;
 
-static std::auto_ptr makeStream(const char* filename);
+static boost::movelib::unique_ptr makeStream(const char* 
filename);
 static DataFileSync makeSync();
 
 void writeHeader();
@@ -132,7 +132,7 @@ public:
  */
 template 
 class DataFileWriter : boost::noncopyable {
-std::auto_ptr base_;
+boost::movelib::unique_ptr base_;
 public:
 /**
  * Constructs a new data file.
@@ -172,7 +172,7 @@ public:
  */
 class AVRO_DECL DataFileReaderBase : boost::noncopyable {
 const std::string filename_;
-const std::auto_ptr stream_;
+const boost::movelib::unique_ptr stream_;
 const DecoderPtr decoder_;
 int64_t objectCount_;
 bool eof_;
@@ -181,7 +181,7 @@ class AVRO_DECL DataFileReaderBase : boost::noncopyable {
 ValidSchema readerSchema_;
 ValidSchema dataSchema_;
 DecoderPtr dataDecoder_;
-std::auto_ptr dataStream_;
+boost::movelib::unique_ptr dataStream_;
 typedef std::map > Metadata;
 
 Metadata metadata_;
@@ -254,7 +254,7 @@ public:
  */
 template 
 class DataFileReader : boost::noncopyable {
-std::auto_ptr base_;
+boost::movelib::unique_ptr base_;
 public:
 /**
  * Constructs the reader for the given file and the reader is
@@ -284,7 +284,8 @@ public:
  * The schema present in the data file will be used for reading
  * from this reader.
  */
-DataFileReader(std::auto_ptr base) : base_(base) {
+DataFileReader(boost::movelib::unique_ptr base) :
+base_(boost::move(base)) {
 base_->init();
 }
 
@@ -297,8 +298,8 @@ public:
  * The argument readerSchema will be used for reading
  * from this reader.
  */
-DataFileReader(std::auto_ptr base,
-const ValidSchema& readerSchema) : base_(base) {
+DataFileReader(boost::movelib::unique_ptr base,
+const ValidSchema& readerSchema) : base_(boost::move(base)) {
 base_->init(readerSchema);
 }
 
diff --git a/lang/c++/api/Stream.hh b/lang/c++/api/Stream.hh
index 92b2334d2..e2f14c741 100644
--- a/lang/c++/api/Stream.hh
+++ b/lang/c++/api/Stream.hh
@@ -19,10 +19,10 @@
 #ifndef avro_Stream_hh__
 #define avro_Stream_hh__
 
-#include 
 #include 
 #include 
 
+#include 
 #include "boost/utility.hpp"
 
 #include "Config.hh"
@@ -122,14 +122,14 @@ public:
 /**
  * Returns a new OutputStream, which grows in memory chunks of specified size.
  */
-AVRO_DECL std::auto_ptr memoryOutputStream(size_t chunkSize = 4 
* 1024);
+AVRO_DECL boost::movelib::unique_ptr memoryOutputStream(size_t 
chunkSize = 4 * 1024);
 
 /**
  * Returns a new InputStream, with the data from the given byte array.
  * It does not copy the data, the byte array should remain valid
  * until the InputStream is used.
  */
-AVRO_DECL std::auto_ptr memoryInputStream(const uint8_t* data, 
size_t len);
+AVRO_DECL boost::movelib::unique_ptr memoryInputStream(const 
uint8_t* data, size_t len);
 
 /**
  * Returns a new InputStream with the contents written into an
@@ -138,7 +138,7 @@ AVRO_DECL std::auto_ptr 
memoryInputStream(const uint8_t* data, size
  * input stream are the snapshot of the outputstream. One can construct
  * any number of memory input stream from a single memory output stream.
  */
-AVRO_DECL std::auto_ptr memoryInputStream(const OutputStream& 
source);
+AVRO_DECL boost::movelib::unique_ptr memoryInputStream(const 
OutputStream& source);
 
 /**
  * Returns the contents written so far into the output stream, which should
@@ -154,14 +154,14 @@ AVRO_DECL boost::shared_ptr > 
snapshot(const OutputStream&
  * If there is a file with the given name, it is truncated and overwritten.
  * If there is no file with the given name, it is created.
  */
-AVRO_DECL std::auto_ptr fileOutputStream(const char* filename,
+AVRO_DECL 

[jira] [Resolved] (AVRO-1542) std::auto_ptr

2018-12-04 Thread Daniel Kulp (JIRA)


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

Daniel Kulp resolved AVRO-1542.
---
Resolution: Fixed
  Assignee: Daniel Kulp

> std::auto_ptr
> -
>
> Key: AVRO-1542
> URL: https://issues.apache.org/jira/browse/AVRO-1542
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: c++
>Affects Versions: 1.7.6
>Reporter: Sean Middleditch
>Assignee: Daniel Kulp
>Priority: Trivial
> Fix For: 1.9.0
>
>
> std::auto_ptr is deprecated, meaning that it may be removed from a future 
> version of the C++ standard (though vendors would not likely remove it... 
> probably).
> Avro should at its next API-breaking opportunity replace its use of auto_ptr 
> with std::unique_ptr or shared_ptr or a custom smart pointer.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-1542) std::auto_ptr

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1542:
--

dkulp closed pull request #157: AVRO-1542 replacing auto_ptr by unique_ptr & 
std::move
URL: https://github.com/apache/avro/pull/157
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index e8efe86dd..70dc7c719 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -37,6 +37,8 @@ set (AVRO_VERSION_MINOR "0")
 
 project (Avro-cpp)
 
+add_definitions(-std=c++11 -fPIC)
+
 if (WIN32 AND NOT CYGWIN AND NOT MSYS)
 add_definitions (/EHa)
 add_definitions (
diff --git a/lang/c++/api/DataFile.hh b/lang/c++/api/DataFile.hh
index 98779b6b1..7047cc87b 100644
--- a/lang/c++/api/DataFile.hh
+++ b/lang/c++/api/DataFile.hh
@@ -60,8 +60,8 @@ class AVRO_DECL DataFileWriterBase : boost::noncopyable {
 const size_t syncInterval_;
 Codec codec_;
 
-std::auto_ptr stream_;
-std::auto_ptr buffer_;
+std::unique_ptr stream_;
+std::unique_ptr buffer_;
 const DataFileSync sync_;
 int64_t objectCount_;
 
@@ -69,7 +69,7 @@ class AVRO_DECL DataFileWriterBase : boost::noncopyable {
 
 Metadata metadata_;
 
-static std::auto_ptr makeStream(const char* filename);
+static std::unique_ptr makeStream(const char* filename);
 static DataFileSync makeSync();
 
 void writeHeader();
@@ -127,7 +127,7 @@ public:
  */
 template 
 class DataFileWriter : boost::noncopyable {
-std::auto_ptr base_;
+std::unique_ptr base_;
 public:
 /**
  * Constructs a new data file.
@@ -167,7 +167,7 @@ public:
  */
 class AVRO_DECL DataFileReaderBase : boost::noncopyable {
 const std::string filename_;
-const std::auto_ptr stream_;
+const std::unique_ptr stream_;
 const DecoderPtr decoder_;
 int64_t objectCount_;
 bool eof_;
@@ -176,7 +176,7 @@ class AVRO_DECL DataFileReaderBase : boost::noncopyable {
 ValidSchema readerSchema_;
 ValidSchema dataSchema_;
 DecoderPtr dataDecoder_;
-std::auto_ptr dataStream_;
+std::unique_ptr dataStream_;
 typedef std::map > Metadata;
 
 Metadata metadata_;
@@ -249,7 +249,7 @@ public:
  */
 template 
 class DataFileReader : boost::noncopyable {
-std::auto_ptr base_;
+std::unique_ptr base_;
 public:
 /**
  * Constructs the reader for the given file and the reader is
@@ -279,7 +279,7 @@ public:
  * The schema present in the data file will be used for reading
  * from this reader.
  */
-DataFileReader(std::auto_ptr base) : base_(base) {
+DataFileReader(std::unique_ptr base) : 
base_(std::move(base)) {
 base_->init();
 }
 
@@ -292,8 +292,8 @@ public:
  * The argument readerSchema will be used for reading
  * from this reader.
  */
-DataFileReader(std::auto_ptr base,
-const ValidSchema& readerSchema) : base_(base) {
+DataFileReader(std::unique_ptr base,
+const ValidSchema& readerSchema) : base_(std::move(base)) {
 base_->init(readerSchema);
 }
 
diff --git a/lang/c++/api/Stream.hh b/lang/c++/api/Stream.hh
index 92b2334d2..2ca84c078 100644
--- a/lang/c++/api/Stream.hh
+++ b/lang/c++/api/Stream.hh
@@ -122,14 +122,14 @@ public:
 /**
  * Returns a new OutputStream, which grows in memory chunks of specified size.
  */
-AVRO_DECL std::auto_ptr memoryOutputStream(size_t chunkSize = 4 
* 1024);
+AVRO_DECL std::unique_ptr memoryOutputStream(size_t chunkSize = 
4 * 1024);
 
 /**
  * Returns a new InputStream, with the data from the given byte array.
  * It does not copy the data, the byte array should remain valid
  * until the InputStream is used.
  */
-AVRO_DECL std::auto_ptr memoryInputStream(const uint8_t* data, 
size_t len);
+AVRO_DECL std::unique_ptr memoryInputStream(const uint8_t* data, 
size_t len);
 
 /**
  * Returns a new InputStream with the contents written into an
@@ -138,7 +138,7 @@ AVRO_DECL std::auto_ptr 
memoryInputStream(const uint8_t* data, size
  * input stream are the snapshot of the outputstream. One can construct
  * any number of memory input stream from a single memory output stream.
  */
-AVRO_DECL std::auto_ptr memoryInputStream(const OutputStream& 
source);
+AVRO_DECL std::unique_ptr memoryInputStream(const OutputStream& 
source);
 
 /**
  * Returns the contents written so far into the output stream, which should
@@ -154,14 +154,14 @@ AVRO_DECL boost::shared_ptr > 
snapshot(const OutputStream&
  * If there is a file with the given name, it is truncated and overwritten.
  * If there is no file with the given name, it is created.
  */
-AVRO_DECL std::auto_ptr fileOutputStream(const 

[jira] [Commented] (AVRO-1891) Generated Java code fails with union containing logical type

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1891:
--

lazyval commented on issue #329: Improved conversions handling + pluggable 
conversions support [AVRO-1891, AVRO-2065]
URL: https://github.com/apache/avro/pull/329#issuecomment-444124761
 
 
   @scatrin seems like you would need to make a rebase to get this going


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Generated Java code fails with union containing logical type
> 
>
> Key: AVRO-1891
> URL: https://issues.apache.org/jira/browse/AVRO-1891
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.8.1
>Reporter: Ross Black
>Priority: Blocker
> Fix For: 1.8.3
>
> Attachments: AVRO-1891.patch, AVRO-1891.yshi.1.patch, 
> AVRO-1891.yshi.2.patch, AVRO-1891.yshi.3.patch, AVRO-1891.yshi.4.patch
>
>
> Example schema:
> {code}
> {
>   "type": "record",
>   "name": "RecordV1",
>   "namespace": "org.brasslock.event",
>   "fields": [
> { "name": "first", "type": ["null", {"type": "long", 
> "logicalType":"timestamp-millis"}]}
>   ]
> }
> {code}
> The avro compiler generates a field using the relevant joda class:
> {code}
> public org.joda.time.DateTime first
> {code}
> Running the following code to perform encoding:
> {code}
> final RecordV1 record = new 
> RecordV1(DateTime.parse("2016-07-29T10:15:30.00Z"));
> final DatumWriter datumWriter = new 
> SpecificDatumWriter<>(record.getSchema());
> final ByteArrayOutputStream stream = new ByteArrayOutputStream(8192);
> final BinaryEncoder encoder = 
> EncoderFactory.get().directBinaryEncoder(stream, null);
> datumWriter.write(record, encoder);
> encoder.flush();
> final byte[] bytes = stream.toByteArray();
> {code}
> fails with the exception stacktrace:
> {code}
>  org.apache.avro.AvroRuntimeException: Unknown datum type 
> org.joda.time.DateTime: 2016-07-29T10:15:30.000Z
> at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:741)
> at 
> org.apache.avro.specific.SpecificData.getSchemaName(SpecificData.java:293)
> at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:706)
> at 
> org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:192)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:110)
> at 
> org.apache.avro.specific.SpecificDatumWriter.writeField(SpecificDatumWriter.java:87)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:143)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:105)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:73)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:60)
> at 
> org.brasslock.avro.compiler.GeneratedRecordTest.shouldEncodeLogicalTypeInUnion(GeneratedRecordTest.java:82)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at 

[jira] [Commented] (AVRO-1891) Generated Java code fails with union containing logical type

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1891:
--

lazyval edited a comment on issue #118: AVRO-1891: Fix specific nested logical 
types
URL: https://github.com/apache/avro/pull/118#issuecomment-444119371
 
 
   @scatrin can you follow up on that? it seems like the problem is still 
ongoing despite the effort from Avro community
   
   I wonder if it's possible to do in user space, without building the custom 
version of avro library


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Generated Java code fails with union containing logical type
> 
>
> Key: AVRO-1891
> URL: https://issues.apache.org/jira/browse/AVRO-1891
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.8.1
>Reporter: Ross Black
>Priority: Blocker
> Fix For: 1.8.3
>
> Attachments: AVRO-1891.patch, AVRO-1891.yshi.1.patch, 
> AVRO-1891.yshi.2.patch, AVRO-1891.yshi.3.patch, AVRO-1891.yshi.4.patch
>
>
> Example schema:
> {code}
> {
>   "type": "record",
>   "name": "RecordV1",
>   "namespace": "org.brasslock.event",
>   "fields": [
> { "name": "first", "type": ["null", {"type": "long", 
> "logicalType":"timestamp-millis"}]}
>   ]
> }
> {code}
> The avro compiler generates a field using the relevant joda class:
> {code}
> public org.joda.time.DateTime first
> {code}
> Running the following code to perform encoding:
> {code}
> final RecordV1 record = new 
> RecordV1(DateTime.parse("2016-07-29T10:15:30.00Z"));
> final DatumWriter datumWriter = new 
> SpecificDatumWriter<>(record.getSchema());
> final ByteArrayOutputStream stream = new ByteArrayOutputStream(8192);
> final BinaryEncoder encoder = 
> EncoderFactory.get().directBinaryEncoder(stream, null);
> datumWriter.write(record, encoder);
> encoder.flush();
> final byte[] bytes = stream.toByteArray();
> {code}
> fails with the exception stacktrace:
> {code}
>  org.apache.avro.AvroRuntimeException: Unknown datum type 
> org.joda.time.DateTime: 2016-07-29T10:15:30.000Z
> at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:741)
> at 
> org.apache.avro.specific.SpecificData.getSchemaName(SpecificData.java:293)
> at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:706)
> at 
> org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:192)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:110)
> at 
> org.apache.avro.specific.SpecificDatumWriter.writeField(SpecificDatumWriter.java:87)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:143)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:105)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:73)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:60)
> at 
> org.brasslock.avro.compiler.GeneratedRecordTest.shouldEncodeLogicalTypeInUnion(GeneratedRecordTest.java:82)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at 

[jira] [Commented] (AVRO-1891) Generated Java code fails with union containing logical type

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1891:
--

lazyval commented on issue #118: AVRO-1891: Fix specific nested logical types
URL: https://github.com/apache/avro/pull/118#issuecomment-444119371
 
 
   @scatrin can you follow up on that? it seems like the problem is still 
ongoing


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Generated Java code fails with union containing logical type
> 
>
> Key: AVRO-1891
> URL: https://issues.apache.org/jira/browse/AVRO-1891
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.8.1
>Reporter: Ross Black
>Priority: Blocker
> Fix For: 1.8.3
>
> Attachments: AVRO-1891.patch, AVRO-1891.yshi.1.patch, 
> AVRO-1891.yshi.2.patch, AVRO-1891.yshi.3.patch, AVRO-1891.yshi.4.patch
>
>
> Example schema:
> {code}
> {
>   "type": "record",
>   "name": "RecordV1",
>   "namespace": "org.brasslock.event",
>   "fields": [
> { "name": "first", "type": ["null", {"type": "long", 
> "logicalType":"timestamp-millis"}]}
>   ]
> }
> {code}
> The avro compiler generates a field using the relevant joda class:
> {code}
> public org.joda.time.DateTime first
> {code}
> Running the following code to perform encoding:
> {code}
> final RecordV1 record = new 
> RecordV1(DateTime.parse("2016-07-29T10:15:30.00Z"));
> final DatumWriter datumWriter = new 
> SpecificDatumWriter<>(record.getSchema());
> final ByteArrayOutputStream stream = new ByteArrayOutputStream(8192);
> final BinaryEncoder encoder = 
> EncoderFactory.get().directBinaryEncoder(stream, null);
> datumWriter.write(record, encoder);
> encoder.flush();
> final byte[] bytes = stream.toByteArray();
> {code}
> fails with the exception stacktrace:
> {code}
>  org.apache.avro.AvroRuntimeException: Unknown datum type 
> org.joda.time.DateTime: 2016-07-29T10:15:30.000Z
> at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:741)
> at 
> org.apache.avro.specific.SpecificData.getSchemaName(SpecificData.java:293)
> at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:706)
> at 
> org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:192)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:110)
> at 
> org.apache.avro.specific.SpecificDatumWriter.writeField(SpecificDatumWriter.java:87)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:143)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:105)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:73)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:60)
> at 
> org.brasslock.avro.compiler.GeneratedRecordTest.shouldEncodeLogicalTypeInUnion(GeneratedRecordTest.java:82)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at 

[jira] [Commented] (AVRO-1891) Generated Java code fails with union containing logical type

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1891:
--

lazyval edited a comment on issue #118: AVRO-1891: Fix specific nested logical 
types
URL: https://github.com/apache/avro/pull/118#issuecomment-444119371
 
 
   @scatrin can you follow up on that? it seems like the problem is still 
ongoing despite the effort from Avro community


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Generated Java code fails with union containing logical type
> 
>
> Key: AVRO-1891
> URL: https://issues.apache.org/jira/browse/AVRO-1891
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.8.1
>Reporter: Ross Black
>Priority: Blocker
> Fix For: 1.8.3
>
> Attachments: AVRO-1891.patch, AVRO-1891.yshi.1.patch, 
> AVRO-1891.yshi.2.patch, AVRO-1891.yshi.3.patch, AVRO-1891.yshi.4.patch
>
>
> Example schema:
> {code}
> {
>   "type": "record",
>   "name": "RecordV1",
>   "namespace": "org.brasslock.event",
>   "fields": [
> { "name": "first", "type": ["null", {"type": "long", 
> "logicalType":"timestamp-millis"}]}
>   ]
> }
> {code}
> The avro compiler generates a field using the relevant joda class:
> {code}
> public org.joda.time.DateTime first
> {code}
> Running the following code to perform encoding:
> {code}
> final RecordV1 record = new 
> RecordV1(DateTime.parse("2016-07-29T10:15:30.00Z"));
> final DatumWriter datumWriter = new 
> SpecificDatumWriter<>(record.getSchema());
> final ByteArrayOutputStream stream = new ByteArrayOutputStream(8192);
> final BinaryEncoder encoder = 
> EncoderFactory.get().directBinaryEncoder(stream, null);
> datumWriter.write(record, encoder);
> encoder.flush();
> final byte[] bytes = stream.toByteArray();
> {code}
> fails with the exception stacktrace:
> {code}
>  org.apache.avro.AvroRuntimeException: Unknown datum type 
> org.joda.time.DateTime: 2016-07-29T10:15:30.000Z
> at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:741)
> at 
> org.apache.avro.specific.SpecificData.getSchemaName(SpecificData.java:293)
> at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:706)
> at 
> org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:192)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:110)
> at 
> org.apache.avro.specific.SpecificDatumWriter.writeField(SpecificDatumWriter.java:87)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:143)
> at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:105)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:73)
> at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:60)
> at 
> org.brasslock.avro.compiler.GeneratedRecordTest.shouldEncodeLogicalTypeInUnion(GeneratedRecordTest.java:82)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at 

[jira] [Commented] (AVRO-1939) Add command line tool for generating canonical form of schema

2018-12-04 Thread ASF subversion and git services (JIRA)


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

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

Commit c5aa1d6962ee16812d8d8c19b167b1b256e8002f in avro's branch 
refs/heads/master from [~iemejia]
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=c5aa1d6 ]

AVRO-1939: Add missing Apache license header (#399)

Add missing Apache license header and fix failing test case for schema 
normalization tool

> Add command line tool for generating canonical form of schema
> -
>
> Key: AVRO-1939
> URL: https://issues.apache.org/jira/browse/AVRO-1939
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: Erik Forsberg
>Assignee: Daniel Kulp
>Priority: Major
> Fix For: 1.9.0
>
>
> Being able to generate canonical form of schemas from avro-tools would be 
> useful, especially when writing canonical schema support in other languages 
> (i.e AVRO-1938).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-1939) Add command line tool for generating canonical form of schema

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1939:
--

nandorKollar closed pull request #399: AVRO-1939: Add missing Apache license 
header
URL: https://github.com/apache/avro/pull/399
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java 
b/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java
index 642b56371..2574b11a2 100644
--- a/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java
+++ b/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java
@@ -210,7 +210,7 @@ public String getName() {
 
   @Override
   public String getShortDescription() {
-return "extracts samples from files";
+return "Extracts samples from files";
   }
 
 }
diff --git 
a/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
 
b/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
index 1cd63c710..28fb74b89 100644
--- 
a/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
+++ 
b/lang/java/tools/src/main/java/org/apache/avro/tool/SchemaNormalizationTool.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.avro.tool;
 
 import java.io.BufferedInputStream;
@@ -12,9 +29,12 @@
 import org.apache.avro.Schema;
 import org.apache.avro.SchemaNormalization;
 
+/**
+ * Utility to convert an Avro @{Schema} to its canonical form.
+ */
 public class SchemaNormalizationTool implements Tool {
   @Override
-  public String getName() { return "schemacanonical"; }
+  public String getName() { return "canonical"; }
 
   @Override
   public String getShortDescription() { return "Converts an Avro Schema to its 
canonical form"; }
diff --git a/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java 
b/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java
index 5a2acc008..f4ee46d96 100644
--- a/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java
+++ b/lang/java/tools/src/test/java/org/apache/avro/tool/TestMain.java
@@ -22,8 +22,8 @@
 import org.junit.Test;
 
 public class TestMain {
-  @Test
   /** Make sure that tool descriptions fit in 80 characters. */
+  @Test
   public void testToolDescriptionLength() {
 Main m = new Main();
 for (Tool t : m.tools.values()) {
@@ -32,4 +32,22 @@ public void testToolDescriptionLength() {
   }
 }
   }
+
+  /**
+   * Make sure that the tool name is not too long, otherwise space for
+   * description is too short because they are rebalanced in the CLI.
+   */
+  @Test
+  public void testToolNameLength() {
+// 13 chosen for backwards compatibility
+final int MAX_NAME_LENGTH = 13;
+
+Main m = new Main();
+for (Tool t : m.tools.values()) {
+  if (t.getName().length() > MAX_NAME_LENGTH) {
+fail("Tool name too long (" + t.getName().length() + "): " +
+  t.getName() + ". Max length is: " + MAX_NAME_LENGTH);
+  }
+}
+  }
 }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add command line tool for generating canonical form of schema
> -
>
> Key: AVRO-1939
> URL: https://issues.apache.org/jira/browse/AVRO-1939
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: Erik Forsberg
>Assignee: Daniel Kulp
>Priority: Major
> Fix For: 1.9.0
>
>
> Being able to generate canonical form of schemas from avro-tools would be 
> 

[jira] [Commented] (AVRO-1939) Add command line tool for generating canonical form of schema

2018-12-04 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on AVRO-1939:
--

iemejia opened a new pull request #399: AVRO-1939: Add missing Apache license 
header
URL: https://github.com/apache/avro/pull/399
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add command line tool for generating canonical form of schema
> -
>
> Key: AVRO-1939
> URL: https://issues.apache.org/jira/browse/AVRO-1939
> Project: Apache Avro
>  Issue Type: Improvement
>Reporter: Erik Forsberg
>Assignee: Daniel Kulp
>Priority: Major
> Fix For: 1.9.0
>
>
> Being able to generate canonical form of schemas from avro-tools would be 
> useful, especially when writing canonical schema support in other languages 
> (i.e AVRO-1938).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)