Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Not A Problem
-
1.9.0
-
None
-
None
Description
Parsing the following schema fails:
new Schema.Parser().parse("{ \"name\": \"test\", \"type\": { \"type\": \"long\", \"logicalType\": \"MY_TIMESTAMP\" }}")
with the following exception:
No type: {"name":"test","type":{"type":"long","logicalType":"MY_TIMESTAMP"}} org.apache.avro.SchemaParseException: No type: {"name":"test","type":{"type":"long","logicalType":"MY_TIMESTAMP"}} at org.apache.avro.Schema.getRequiredText(Schema.java:1725) at org.apache.avro.Schema.parse(Schema.java:1576) at org.apache.avro.Schema$Parser.parse(Schema.java:1366) at org.apache.avro.Schema$Parser.parse(Schema.java:1354)
The complex type cannot be properly parsed because it is not a simple string but a JSON object. Hence when calling `jsonNode.textValue()` the result is null. Check `getOptionalText(...)` for more information.
When supplying logical types it should be possible to parse a simple schema.