AlbertoSH opened a new pull request #952:
URL: https://github.com/apache/avro/pull/952
Current has an error in the map example. Using the following schema
```
{
"type": "record",
"name": "Demo",
"namespace": "demo",
"fields": [
{
"name": "someMap",
"type": {
"type": "map",
"items": "long"
}
}
]
}
```
and trying to generate Java files results in an error:
```
$ java -jar avro-tools-1.10.0.jar compile schema demo.avsc output
Input files to compile:
demo.avsc
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.
Exception in thread "main" org.apache.avro.SchemaParseException: Map has no
values type: {"type":"map","items":"long"}
at org.apache.avro.Schema.parse(Schema.java:1711)
at org.apache.avro.Schema.parse(Schema.java:1668)
at org.apache.avro.Schema$Parser.parse(Schema.java:1425)
at org.apache.avro.Schema$Parser.parse(Schema.java:1388)
at
org.apache.avro.tool.SpecificCompilerTool.run(SpecificCompilerTool.java:120)
at org.apache.avro.tool.Main.run(Main.java:67)
at org.apache.avro.tool.Main.main(Main.java:56)
```
Updating the schema to
```
{
"type": "record",
"name": "Demo",
"namespace": "demo",
"fields": [
{
"name": "someMap",
"type": {
"type": "map",
"values": "long"
}
}
]
}
```
and trying to generate Java files results in an error:
```
$ java -jar avro-tools-1.10.0.jar compile schema demo.avsc output
Input files to compile:
demo.avsc
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.
```
works like a charm
Since it's an small fix in the documentation I'd say a JIRA ticket is not
needed :)
Make sure you have checked _all_ steps below.
### Jira
- [ ] My PR addresses the following [Avro
Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them
in the PR title. For example, "AVRO-1234: My Avro PR"
- https://issues.apache.org/jira/browse/AVRO-XXX
- In case you are adding a dependency, check if the license complies with
the [ASF 3rd Party License
Policy](https://www.apache.org/legal/resolved.html#category-x).
### Tests
- [ ] My PR adds the following unit tests __OR__ does not need testing for
this extremely good reason:
### Commits
- [ ] My commits all reference Jira issues in their subject lines. In
addition, my commits follow the guidelines from "[How to write a good git
commit message](https://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
### Documentation
- [ ] In case of new functionality, my PR adds documentation that describes
how to use it.
- All the public functions and the classes in the PR contain Javadoc that
explain what it does
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]