Comments (33)
I just successfully created a schema for redshift.
Instructions in https://gist.github.com/drorm/14ca3ac50d90cada44fa1d8f0e121bd1
from schemaspy.
Hi @thebogusman . I've created PR with support for redshift db.
Please verify if everything works.
edit: Remember to download jtds driver and point it in parameters.
Port should be also configured separately (not with host)
from schemaspy.
@thebogusman PR created by @wkasa was already merged. So you can clone the main repository for your test and verification.
from schemaspy.
@wkasa thanks a lot! I really appreciate your effort.
I did some testing on a moderately large database. The first time it crashed with some NPE while loading/generating info for columns. So I deleted the output folder and run it once again with console output redirected to a file, but this time it finished successfully.
The end result is pretty much usable, but it has some issues:
- Reported row count for some tables is -1 (affects about 10% of all tables, seems to be random)
- I was generating docs for schema public, but there was also schema public_bkp present in the database at the time, with almost identical set of tables. This caused all the relations in the docs to be doubled, with one pointing to public.table and the other one to public_bkp.table. Tables from "public_bkp" schema are also present on the diagrams, but not on the table list.
Descriptions for columns are mixed up between different columns inside a table. This seems to be connected with the previous issue, as only the tables with lots of relations seems to be affected.(edit: problem on my db)
I'm attaching the command output, as there were some warnings/exceptions showing up along the way. I obfuscated the names of the tables, but hopefully they're not that important.
from schemaspy.
@thebogusman any chance that you can prepare some test db? Or maybe script to create such database to reproduce this issue? I am not and redshift expert and I've only created simple test db to fix exception with connecting to this db.
from schemaspy.
@wkasa sure, I will come up with something next week.
from schemaspy.
@wkasa actually, I've already got it. Here's the ddl for both schemas:
schemaspy_test_ddl.zip
from schemaspy.
@thebogusman thanks! I'll look on it next week.
from schemaspy.
@thebogusman
I checked your script and it looks like the problem is deeper. Below is printscreen from SQL Workbench, I used the same jdbc driver like in schemaspy. As you can see even there those tables are somehow related.
from schemaspy.
@thebogusman based on @wkasa explanation I suppose that's something incorrect in your database.
Could you verify and let us know ?
from schemaspy.
@rafalkasa it looks ok on the database - there is no relation between this tables. It looks like some bug in jdbc drivers or something like this.
from schemaspy.
@wkasa thanks for your detailed explanation so if this is something in jdbc driver it will be not simple to fix... Do you have any suggestions ?
from schemaspy.
@wkasa you're probably right. I can observe the same in DBeaver. I'll post an issue on Amazon's forum regarding that problem.
Amazon provides this view for retreiving foreign keys:
https://github.com/awslabs/amazon-redshift-utils/blob/master/src/AdminViews/v_constraint_dependency.sql
It works ok on the schemas I sent you.
from schemaspy.
Ok then, let's wait until @thebogusman will receive some feedback from Amazon.
from schemaspy.
@thebogusman any update?
from schemaspy.
@thebogusman - can you please post the URL of this issue on the Amazon forum? There is great interest to have SchemaSpy work with Redshift and I'd like to add to the conversation.
from schemaspy.
+1 for interest in this.
can help with testing/investigation
from schemaspy.
There is a dbtype for redshift that you can test a provide feedback for.
from schemaspy.
@npetzall getting a failed to load driver error trying to run with the latest docker snapshot:
Failed to load driver 'com.amazon.redshift.jdbc42.Driver'
This entry doesn't point to a valid file/directory: [/Users/seanmuth/Documents/Redshift/RedshiftJDBC42-1.2.1.1001.jar]
chmod 777 to the jar file to make sure it's not a file permissions thing, no luck
Here's the command I'm running:
docker run schemaspy/schemaspy:snapshot -t redshift -u username -p password -host hostname -db database -port portnum -s public -dp ~/Documents/Redshift/RedshiftJDBC42-1.2.1.1001.jar
Guessing this is obvious but I can't see it
from schemaspy.
@seanmuth redshift driver is not included with the docker image. You need to bind mount the driver using -v
from schemaspy.
-v "path-to-folder-with-jar:/drivers" add before image
from schemaspy.
Got it thanks @npetzall, I don't have a ton of experience with docker yet, my avatar definitely applies here :-P
from schemaspy.
@seanmuth the image and docker is pretty new so the docs hasn't been battle tested. I'll think of an update to improve the docs. I read it now and the -v is quite hidden.
from schemaspy.
no worries, I can help with docs too if you need it.
got through connecting relationships, error'd here:
.ERROR - Application startup failed
java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/libfontmanager.so: Error relocating /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/libfontmanager.so: AWTFontDefaultChar: symbol not found
from schemaspy.
@seanmuth I've noticed some possible improvements and also that I didn't pin the version of the "parent image" so might be an update there that has broken the docker image.
I'll have a look when I get to a computer. Currently in a cabin on the countrysidr with only a cellphone.
If your able to run locally without docker (graphiz installed) you can download the snapshot.jar
The error you get is probably related to fontconfig but there might be changes in newer jdk. So the setup I've doesnt work. I'll investigate and fix, but later... #122
from schemaspy.
Cabin in the countryside sounds great! I'll mess around locally and see where I can get!
from schemaspy.
@seanmuth you can join our chat on gitter
from schemaspy.
from schemaspy.
There is a link to download the latest snapshot in the readme.md so you can skip the download I hope.
https://github.com/schemaspy/schemaspy#latest-release
@rafalkasa we need to change the header to snapshot.
from schemaspy.
Updated the gist.
When I downloaded the snapshot it had the save version/file name as the version I downloaded earlier. Probably makes sense to have them have different versions names.
from schemaspy.
@drorm we have changed the name and also yesterday released 6.0.0.
I failed to ask back then, was the schema looking OK. Do we have any outstanding issues with redshirt?
from schemaspy.
The schema looked fine
from schemaspy.
Closing this.
Create new issues if found.
from schemaspy.
Related Issues (20)
- Too much information in error.
- Sign snapshots
- Cant get line breaks in Table Comments to work. HOT 6
- I am unable to get comments
- Oracle database - null password given HOT 5
- Driver Error HOT 7
- Failed to parse [schema].meta.xml HOT 5
- Terminating null reference error when generating HTML for Constraints MSSQL HOT 1
- SchemaSpy ERD (relationship tab) is not showing lines between tables HOT 4
- Relationship between Unique Keys and Foreign Key HOT 8
- ERROR - Bad config Schema (-s/-schemas) was not provided and unable to deduce schema, ... HOT 2
- Trying to set trustServerCertificate true in schemaspy.connprops Property in config file does not work HOT 2
- Getting an Exception when running against Oracle database in charset ISO-8859-15 HOT 2
- Feature request: "Comment" as title in relationships.html
- Get `AbstractMethodError` when connect to SQL Server by using `mssql17-jtds` driver. HOT 2
- Snowflake connection with private key pair HOT 4
- [Informix] Query to long when execute selectRoutineParametersSql HOT 3
- SQL/MED support (in my case PostgreSQL Foreign Data Wrappers) HOT 7
- Killed by OOM killer when analysing a complex schema HOT 2
- Live website? HOT 1
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 schemaspy.