Giter Site home page Giter Site logo

Comments (33)

drorm avatar drorm commented on July 19, 2024 4

I just successfully created a schema for redshift.

Instructions in https://gist.github.com/drorm/14ca3ac50d90cada44fa1d8f0e121bd1

from schemaspy.

wkasa avatar wkasa commented on July 19, 2024

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.

rafalkasa avatar rafalkasa commented on July 19, 2024

@thebogusman PR created by @wkasa was already merged. So you can clone the main repository for your test and verification.

from schemaspy.

thebogusman avatar thebogusman commented on July 19, 2024

@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:

  1. Reported row count for some tables is -1 (affects about 10% of all tables, seems to be random)
  2. 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.
  3. 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.

output_obf.txt

from schemaspy.

wkasa avatar wkasa commented on July 19, 2024

@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.

thebogusman avatar thebogusman commented on July 19, 2024

@wkasa sure, I will come up with something next week.

from schemaspy.

thebogusman avatar thebogusman commented on July 19, 2024

@wkasa actually, I've already got it. Here's the ddl for both schemas:
schemaspy_test_ddl.zip

from schemaspy.

wkasa avatar wkasa commented on July 19, 2024

@thebogusman thanks! I'll look on it next week.

from schemaspy.

wkasa avatar wkasa commented on July 19, 2024

@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.
image

from schemaspy.

rafalkasa avatar rafalkasa commented on July 19, 2024

@thebogusman based on @wkasa explanation I suppose that's something incorrect in your database.
Could you verify and let us know ?

from schemaspy.

wkasa avatar wkasa commented on July 19, 2024

@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.

rafalkasa avatar rafalkasa commented on July 19, 2024

@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.

thebogusman avatar thebogusman commented on July 19, 2024

@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.

wkasa avatar wkasa commented on July 19, 2024

Ok then, let's wait until @thebogusman will receive some feedback from Amazon.

from schemaspy.

wkasa avatar wkasa commented on July 19, 2024

@thebogusman any update?

from schemaspy.

lovegis avatar lovegis commented on July 19, 2024

@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.

seanmuth avatar seanmuth commented on July 19, 2024

+1 for interest in this.
can help with testing/investigation

from schemaspy.

npetzall avatar npetzall commented on July 19, 2024

@seanmuth

There is a dbtype for redshift that you can test a provide feedback for.

redshift

from schemaspy.

seanmuth avatar seanmuth commented on July 19, 2024

@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.

npetzall avatar npetzall commented on July 19, 2024

@seanmuth redshift driver is not included with the docker image. You need to bind mount the driver using -v

from schemaspy.

npetzall avatar npetzall commented on July 19, 2024

-v "path-to-folder-with-jar:/drivers" add before image

from schemaspy.

seanmuth avatar seanmuth commented on July 19, 2024

Got it thanks @npetzall, I don't have a ton of experience with docker yet, my avatar definitely applies here :-P

from schemaspy.

npetzall avatar npetzall commented on July 19, 2024

@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.

seanmuth avatar seanmuth commented on July 19, 2024

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.

npetzall avatar npetzall commented on July 19, 2024

@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.

seanmuth avatar seanmuth commented on July 19, 2024

Cabin in the countryside sounds great! I'll mess around locally and see where I can get!

from schemaspy.

npetzall avatar npetzall commented on July 19, 2024

@seanmuth you can join our chat on gitter

from schemaspy.

lovegis avatar lovegis commented on July 19, 2024

from schemaspy.

npetzall avatar npetzall commented on July 19, 2024

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.

drorm avatar drorm commented on July 19, 2024

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.

npetzall avatar npetzall commented on July 19, 2024

@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.

drorm avatar drorm commented on July 19, 2024

The schema looked fine

from schemaspy.

npetzall avatar npetzall commented on July 19, 2024

Closing this.

Create new issues if found.

from schemaspy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.