Re: [PR] AVRO-3933: Unify ARM64 workflows [avro]

2024-02-02 Thread via GitHub


zcsizmadia commented on PR #2722:
URL: https://github.com/apache/avro/pull/2722#issuecomment-1924328095

   Using the github hosted `macos-14` runner is an option, however that is a  
MacOS image with ARM64 M1 processor. Not Ubuntu like the other runners we use, 
so most likely a good amount work would be needed to make everything build on 
MacOS. But, that would remove the external build server dependency.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@avro.apache.org

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



Re: [PR] AVRO-3933: Unify ARM64 workflows [avro]

2024-02-02 Thread via GitHub


zcsizmadia commented on PR #2722:
URL: https://github.com/apache/avro/pull/2722#issuecomment-1924318702

   Roger. So based on your PR you just wanted simply make it visible that ARM 
failed, so we can ignore it (since it is an issue of the self hosted runner)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@avro.apache.org

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



[jira] [Commented] (AVRO-3918) Allow UUID to serialize to Fixed[16]

2024-02-02 Thread ASF subversion and git services (Jira)


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

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

Commit b0e44bdf6195714465c651e57b11747d68ad405c in avro's branch 
refs/heads/main from Christophe Le Saec
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=b0e44bdf6 ]

AVRO-3918: Add UUID with `fixed[16]` (#2652)

* AVRO-3918: add uuid with bytes and fixed

* AVRO-3918: add licence

* AVRO-3918: change spec

* AVRO-3918: force big endian mode for long value

* AVRO-3918: remove inefficient uuid bytes storage

* AVRO-3918: enforce network byte order

As stated in RFC 4122 section 4.1.2, UUIDs are in network byte order.

Also added a test for string based UUID conversion.

* Use buffer instead

-

Co-authored-by: Oscar Westra van Holthe - Kind 
Co-authored-by: Fokko Driesprong 

> Allow UUID to serialize to Fixed[16]
> 
>
> Key: AVRO-3918
> URL: https://issues.apache.org/jira/browse/AVRO-3918
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: spec
>Affects Versions: 1.11.3
>Reporter: Fokko Driesprong
>Assignee: Fokko Driesprong
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.12.0
>
>  Time Spent: 7.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (AVRO-3934) Generated Java code still fails with union containing logical type

2024-02-02 Thread Joan Soto Targa (Jira)


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

Joan Soto Targa updated AVRO-3934:
--
Description: 
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 (or 11) and in both cases we have observed that bug AVRO-1981 is still 
active and deserialization fails for nullable fields that have a logical type: 
happens at least for both "uuid" (in version 1.11.3, previous one just ignores 
this type) and "timestamp-millis" (in both versions).


The fields are defined as follows:

{code:json}
//(...)
{
  "name": "requestId",
  "type": [
"null",
{
  "type": "string",
  "logicalType": "uuid"
}
  ],
  "default": null
}
//(...)
{
  "name": "upperTimeLimit",
  //"doc" field
  "type": [
"null",
{
  "type": "long",
  "logicalType": "timestamp-millis"
}
  ],
  "default": null
}
{code}
 

The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the generated class file we should be getting:
{code:java}
private static final org.apache.avro.Conversion[] conversions;
//(...)
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

Both the definition and the initialization of the conversions field are missing.

  was:
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 (or 11) and in both cases we have observed that bug AVRO-1981 is still 
active and deserialization fails for nullable fields that have a logical type: 
happens at least for both "uuid" (in version 1.11.3, previous one just ignores 
this type) and "timestamp-millis" (in both versions).

 
The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the generated class file we should be getting:
{code:java}
private static final org.apache.avro.Conversion[] conversions;
//(...)
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

Both the definition and the initialization of the conversions field are missing.


> Generated Java code still fails with union containing logical type
> --
>
> Key: AVRO-3934
> URL: https://issues.apache.org/jira/browse/AVRO-3934
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2, 1.11.3
> Environment: apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 
> (tried with both), code being generated either in Java 8 or 11.
> Faulty java generation happens in both maven running locally on intellij idea 
> and on jenkins pipelines.
> Issue happens in both windows and linux.
>Reporter: Joan Soto 

[jira] [Updated] (AVRO-3934) Generated Java code still fails with union containing logical type

2024-02-02 Thread Joan Soto Targa (Jira)


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

Joan Soto Targa updated AVRO-3934:
--
Description: 
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 (or 11) and in both cases we have observed that bug AVRO-1981 is still 
active and deserialization fails for nullable fields that have a logical type: 
happens at least for both "uuid" (in version 1.11.3, previous one just ignores 
this type) and "timestamp-millis" (in both versions).

 
The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the generated class file we should be getting:
{code:java}
private static final org.apache.avro.Conversion[] conversions;
//(...)
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

Both the definition and the initialization of the conversions field are missing.

  was:
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 and in both cases we have observed that bug AVRO-1981 is still active 
and deserialization fails for nullable fields that have a logical type: happens 
at least for both "uuid" (in version 1.11.3, previous one just ignores this 
type) and "timestamp-millis" (in both versions).

 
The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the generated class file we should be getting:
{code:java}
private static final org.apache.avro.Conversion[] conversions;
//(...)
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

Both the definition and the initialization of the conversions field are missing.


> Generated Java code still fails with union containing logical type
> --
>
> Key: AVRO-3934
> URL: https://issues.apache.org/jira/browse/AVRO-3934
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2, 1.11.3
> Environment: apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 
> (tried with both), code being generated either in Java 8 or 11.
> Faulty java generation happens in both maven running locally on intellij idea 
> and on jenkins pipelines.
> Issue happens in both windows and linux.
>Reporter: Joan Soto Targa
>Priority: Major
>
> In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling 
> to Java 8 (or 11) and in both cases we have observed that bug AVRO-1981 is 
> still active and deserialization fails for nullable fields that have a 
> logical type: happens at least for both "uuid" (in version 1.11.3, previous 
> one just ignores this type) and 

[jira] [Updated] (AVRO-3934) Generated Java code still fails with union containing logical type

2024-02-02 Thread Joan Soto Targa (Jira)


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

Joan Soto Targa updated AVRO-3934:
--
Environment: 
apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 (tried with both), code 
being generated either in Java 8 or 11.

Faulty java generation happens in both maven running locally on intellij idea 
and on jenkins pipelines.

Issue happens in both windows and linux.

  was:
apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 (tried with both), code 
being generated in Java 8.

Faulty java generation happens in both maven running locally on intellij idea 
and on jenkins pipelines.

Issue happens in both windows and linux.


> Generated Java code still fails with union containing logical type
> --
>
> Key: AVRO-3934
> URL: https://issues.apache.org/jira/browse/AVRO-3934
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2, 1.11.3
> Environment: apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 
> (tried with both), code being generated either in Java 8 or 11.
> Faulty java generation happens in both maven running locally on intellij idea 
> and on jenkins pipelines.
> Issue happens in both windows and linux.
>Reporter: Joan Soto Targa
>Priority: Major
>
> In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling 
> to Java 8 and in both cases we have observed that bug AVRO-1981 is still 
> active and deserialization fails for nullable fields that have a logical 
> type: happens at least for both "uuid" (in version 1.11.3, previous one just 
> ignores this type) and "timestamp-millis" (in both versions).
>  
> The error we get for the uuid case when attempting to deserialize is:
> {noformat}
> java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast 
> to class java.util.UUID
> {noformat}
> In the generated class file we should be getting:
> {code:java}
> private static final org.apache.avro.Conversion[] conversions;
> //(...)
> static {
> MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
> MODEL$.addLogicalTypeConversion(new 
> TimeConversions.TimestampMillisConversion());
> ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
> DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
> conversions = new org.apache.avro.Conversion[] {
> null,
> null,
> new org.apache.avro.Conversions.UUIDConversion(),
> null,
> new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
> null
> };
> WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
> READER$ = MODEL$.createDatumReader(SCHEMA$);
> }
> {code}
> but we get:
> {code:java}
> static {
> MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
> MODEL$.addLogicalTypeConversion(new 
> TimeConversions.TimestampMillisConversion());
> ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
> DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
> WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
> READER$ = MODEL$.createDatumReader(SCHEMA$);
> }
> {code}
> Both the definition and the initialization of the conversions field are 
> missing.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (AVRO-3934) Generated Java code still fails with union containing logical type

2024-02-02 Thread Joan Soto Targa (Jira)


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

Joan Soto Targa updated AVRO-3934:
--
Description: 
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 and in both cases we have observed that bug AVRO-1981 is still active 
and deserialization fails for nullable fields that have a logical type: happens 
at least for both "uuid" (in version 1.11.3, previous one just ignores this 
type) and "timestamp-millis" (in both versions).

 
The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the generated class file we should be getting:
{code:java}
private static final org.apache.avro.Conversion[] conversions;
//(...)
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

Both the definition and the initialization of the conversions field are missing.

  was:
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 and in both cases we have observed that bug AVRO-1981 is still active 
and deserialization fails for nullable fields that have a logical type: happens 
at least for both "uuid" (in version 1.11.3, previous one just ignores this 
type) and "timestamp-millis" (in both versions).

 
The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the generated class file we should be getting:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}



> Generated Java code still fails with union containing logical type
> --
>
> Key: AVRO-3934
> URL: https://issues.apache.org/jira/browse/AVRO-3934
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2, 1.11.3
> Environment: apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 
> (tried with both), code being generated in Java 8.
> Faulty java generation happens in both maven running locally on intellij idea 
> and on jenkins pipelines.
> Issue happens in both windows and linux.
>Reporter: Joan Soto Targa
>Priority: Major
>
> In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling 
> to Java 8 and in both cases we have observed that bug AVRO-1981 is still 
> active and deserialization fails for nullable fields that have a logical 
> type: happens at least for both "uuid" (in version 1.11.3, previous one just 
> ignores this type) and "timestamp-millis" (in both versions).
>  
> The error we get for the uuid case when attempting to deserialize is:
> {noformat}
> java.lang.ClassCastException: class 

Re: [PR] Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 4.0.0 in /lang/java [avro]

2024-02-02 Thread via GitHub


nielsbasjes commented on PR #2619:
URL: https://github.com/apache/avro/pull/2619#issuecomment-1923359373

   Actually, it seems this dependency is ONLY there because the used maven-core 
version has an even older one ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@avro.apache.org

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



[jira] [Updated] (AVRO-3934) Generated Java code still fails with union containing logical type

2024-02-02 Thread Joan Soto Targa (Jira)


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

Joan Soto Targa updated AVRO-3934:
--
Description: 
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 and in both cases we have observed that bug AVRO-1981 is still active 
and deserialization fails for nullable fields that have a logical type: happens 
at least for both "uuid" (in version 1.11.3, previous one just ignores this 
type) and "timestamp-millis" (in both versions).

 
The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the generated class file we should be getting:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}


  was:
In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling to 
Java 8 and in both cases we have observed that bug AVRO-1981 is still active 
and deserialization fails for nullable fields that have a logical type: happens 
at least for both "uuid" (in version 1.11.3, previous one just ignores this 
type) and "timestamp-millis" (in both versions).

 
The error we get for the uuid case when attempting to deserialize is:
{noformat}
java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast to 
class java.util.UUID
{noformat}

In the class code, we should be getting:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
conversions = new org.apache.avro.Conversion[] {
null,
null,
new org.apache.avro.Conversions.UUIDConversion(),
null,
new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
null
};
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}

but we get:
{code:java}
static {
MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
MODEL$.addLogicalTypeConversion(new 
TimeConversions.TimestampMillisConversion());
ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
READER$ = MODEL$.createDatumReader(SCHEMA$);
}
{code}



> Generated Java code still fails with union containing logical type
> --
>
> Key: AVRO-3934
> URL: https://issues.apache.org/jira/browse/AVRO-3934
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2, 1.11.3
> Environment: apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 
> (tried with both), code being generated in Java 8.
> Faulty java generation happens in both maven running locally on intellij idea 
> and on jenkins pipelines.
> Issue happens in both windows and linux.
>Reporter: Joan Soto Targa
>Priority: Major
>
> In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling 
> to Java 8 and in both cases we have observed that bug AVRO-1981 is still 
> active and deserialization fails for nullable fields that have a logical 
> type: happens at least for both "uuid" (in version 1.11.3, previous one just 
> ignores this type) and "timestamp-millis" (in both versions).
>  
> The error we get for the uuid case when attempting to deserialize is:
> {noformat}
> java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast 
> to class java.util.UUID
> {noformat}
> In the generated class file we should be getting:
> {code:java}
> static {
> 

Re: [PR] Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 4.0.0 in /lang/java [avro]

2024-02-02 Thread via GitHub


nielsbasjes commented on PR #2619:
URL: https://github.com/apache/avro/pull/2619#issuecomment-1923354309

   I checked and this cannot be updated automatically.
   
   The testing of the maven-plugin depends on 
org.apache.maven.plugin-testing:maven-plugin-testing-tools for which the latest 
version (from 2014 ... yes really) cannot work with this newer plexus utils 
version.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@avro.apache.org

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



[jira] [Updated] (AVRO-3934) Generated Java code still fails with union containing logical type

2024-02-02 Thread Joan Soto Targa (Jira)


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

Joan Soto Targa updated AVRO-3934:
--
Environment: 
apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 (tried with both), code 
being generated in Java 8.

Faulty java generation happens in both maven running locally on intellij idea 
and on jenkins pipelines.

Issue happens in both windows and linux.

  was:
apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 (tried with both), code 
being generated in Java 8.

Faulty java generation happens in both maven running on intellij idea and on 
jenkins pipelines.

Issue happens in both windows and linux.


> Generated Java code still fails with union containing logical type
> --
>
> Key: AVRO-3934
> URL: https://issues.apache.org/jira/browse/AVRO-3934
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.2, 1.11.3
> Environment: apache maven, avro maven plugin, avro v1.11.3 or 1.9.2 
> (tried with both), code being generated in Java 8.
> Faulty java generation happens in both maven running locally on intellij idea 
> and on jenkins pipelines.
> Issue happens in both windows and linux.
>Reporter: Joan Soto Targa
>Priority: Major
>
> In our company we're using both 1.9.2 and 1.11.3 versions of avro compiling 
> to Java 8 and in both cases we have observed that bug AVRO-1981 is still 
> active and deserialization fails for nullable fields that have a logical 
> type: happens at least for both "uuid" (in version 1.11.3, previous one just 
> ignores this type) and "timestamp-millis" (in both versions).
>  
> The error we get for the uuid case when attempting to deserialize is:
> {noformat}
> java.lang.ClassCastException: class org.apache.avro.util.Utf8 cannot be cast 
> to class java.util.UUID
> {noformat}
> In the class code, we should be getting:
> {code:java}
> static {
> MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
> MODEL$.addLogicalTypeConversion(new 
> TimeConversions.TimestampMillisConversion());
> ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
> DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
> conversions = new org.apache.avro.Conversion[] {
> null,
> null,
> new org.apache.avro.Conversions.UUIDConversion(),
> null,
> new org.apache.avro.data.TimeConversions.TimestampMillisConversion(),
> null
> };
> WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
> READER$ = MODEL$.createDatumReader(SCHEMA$);
> }
> {code}
> but we get:
> {code:java}
> static {
> MODEL$.addLogicalTypeConversion(new Conversions.UUIDConversion());
> MODEL$.addLogicalTypeConversion(new 
> TimeConversions.TimestampMillisConversion());
> ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
> DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
> WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
> READER$ = MODEL$.createDatumReader(SCHEMA$);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)