Comments (4)
Looks like the AvroSchema that you pass to SchemaGenerator.generate() has no AvroFields.
Can you share the code you use to initialize it?
from avro-schema-generator.
Here it is, I have tried the first two code blocks you shared in the documentation but they were giving the same error :
import com.at.avro.AvroSchema;
import com.at.avro.DbSchemaExtractor;
import com.at.avro.SchemaGenerator;
import com.at.avro.config.AvroConfig;
public class GenerateAvroSchema {
public static void main(String []args) {
// Initialize db crawler that will create avro model objects
DbSchemaExtractor schemaExtractor = new DbSchemaExtractor("jdbc:oracle:thin:@xxxxx:1521:SID", "user", "pass");
AvroConfig avroConfig = new AvroConfig("com.db.raw");
// Get avro models for a table
AvroSchema schema = schemaExtractor.getForTable(avroConfig, "mydb_schema_name", "mytable_name");
System.out.println(schema.toString());
String schemaJson = SchemaGenerator.generate(schema);
System.out.println(schemaJson);
}
}
I'm using ojdbc7 and have added us.fatehi:schemacrawler-oracle:14.14.02 to my maven dependencies.
from avro-schema-generator.
The code you use looks good. So we need to collect more information about what happens.
I would check the following:
- does it work with other tables? Maybe try doing getAll() instead of getForTable() and debug/print to see if any AvroSchema has fields in it.
- check if logs contain any suspicious warnings before the exception
- to really see what happens you should debug and set a breakpoint around line 23 in AvroSchema. You should check what table.getColumns() returns and what happens with them later.
Without debugging or having more information it's hard to say what's wrong. Hopefully, after finding the issue we'll be able to improve the library.
from avro-schema-generator.
Closing for now. Let me know if you get more info on this.
from avro-schema-generator.
Related Issues (13)
- Fix codecov.io integration. HOT 1
- Support for IDL generation? HOT 2
- Add Avro doc field ? HOT 5
- Better SQL Server column data type support HOT 1
- Value out of range for datatype java.lang.Integer for column `cardinality`. HOT 7
- Slow performance with schema containing large number of tables HOT 5
- Need support for bigint/int unsigned type HOT 4
- Support for DB names with `-` in name. HOT 4
- Update SchemaCrawler HOT 1
- Support for SQL array HOT 5
- Upgrade to the latest version of SchemaCrawler HOT 1
- [proposal] Migrate build to Gradle HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avro-schema-generator.