How do I load a avro schema in IntelliJ?
Asked Answered
E

3

7

I cloned a project from github and now have it open as a project in IntelliJ. The project is written in Scala.

The project depends on some objects defined in an avro schema that is in another project on github. The avro schema is a single *.avdl file.

How do I load the avro *.advl schema / file in my project in IntelliJ?

So that the object types defined in the avro schema are known in the rest of the project.

Does IntelliJ recognize avro *.advl files? Do I need to generate Scala/Java classes somehow from the avro advl file? And then load these classes?

Erleena answered 10/12, 2015 at 18:35 Comment(0)
D
4

I recently started an Avro project and was annoyed at having to use avro-tools.jar, so I made an IntelliJ plugin - https://plugins.jetbrains.com/plugin/12281-avro-and-parquet-viewer/. Drag-and-drop Avro and Parquet files to view them in plain text, JSON and tabular views, alongside their schemas.

For Visual Studio Code users, my colleagues use https://marketplace.visualstudio.com/items?itemName=dvirtz.parquet-viewer.

Denham answered 22/4, 2019 at 18:48 Comment(0)
E
1

What I ended up doing is:

Download avro tools: https://github.com/miguno/avro-cli-examples/blob/master/README.md

Use the following tools from the jar

idl2schemata  Extract JSON schemata of the types from an Avro IDL file
compile  Generates Java code for the given schema

The resulting set of java classes I put under the correct package in my code.

This at least made the type checker happy in IntelliJ. Did not run the code yet.

Erleena answered 14/12, 2015 at 10:50 Comment(0)
H
0

Have you tried the Avro support plugin? https://plugins.jetbrains.com/plugin/7971?pr=idea

Heterogamy answered 14/12, 2015 at 7:19 Comment(2)
Yes but I am not sure what the plugin does. I did not find out how it could load the advl file.Erleena
Not compatible with the version of your running IDE (IntelliJ IDEA 2022.2 RC)Characterize

© 2022 - 2024 — McMap. All rights reserved.