Abacn commented on issue #24870:
URL: https://github.com/apache/beam/issues/24870#issuecomment-1372818859
The logical type causing problem is indeed `beam:logical_type:date:v1`.
#24888 in the error message is more clear:
```
java.lang.RuntimeException: java.lang.IllegalArgumentException: Unable to
encode element 'GenericData{classInfo=[f], {dt=2022-12-21}}' with coder
'SchemaCoder<Schema: Fields:
Field{name=dt, description=, type=LOGICAL_TYPE<beam:logical_type:date:v1>,
options={{}}}
Encoding positions:
{dt=0}
```
What confuses me is here:
https://github.com/apache/beam/blob/37c7bee5602e7942fcae8d9b2bafbc8fa86ed7b7/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/SchemaCoderHelpers.java#L85-L89
value is a java.time.LocalDate, then Date.toBaseType(value) should return a
Long to baseType. However `baseType` feed to baseTypeCoder(VarLongCoder).encode
gets a java.time.LocalDate. Not sure how this happened. The
`SchemaCoderHelpers` class does not change in recent months.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]