On Mon, Jun 24, 2019, at 3:33 AM, Preutti Puawade wrote:
> Hi there,
> 
> It could be a non-sense question for you but for I've struggling on this for 
> weeks and search result from google cannot help so I'm end up here.
> 
> Normally I've use SQL client program as SQLwokbench/J and it's using JDBC 
> connection below to connect 3 databases 1 Presto, 2 Redshift.
> 
> jdbc:presto://bdp-e2e-presto.xxx.com:xxxx/hive?user=x...@xxxx.com&SSL=true&SSLTrustStorePath=C:/Users/Downloads/bdp-ts.jks
> 
> jdbc:redshift://xxx-edm-oregon-prod02.cgdmyxu24bfx.us-west-2.redshift.amazonaws.com:xxxx/bdpdw?tcpKeepAlive=true&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
> 
> jdbc:redshift:iam://bdp-dp-redshift-hdd01:us-west-2/drive?tcpKeepAlive=true&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory&plugin_name=com.amazon.redshift.plugin.AdfsCredentialsProvider&idp_host=access.xxxx.com&idp_port=xxx&DbGroups=grp_hdd_r&preferred_role=arn:aws:iam::xxxxxxxxxxxx:role/AWS-BDP-ENG-REDSHIFT-HDD-Prod
> 
> Couple weeks ago I'm try to use sqlalchemy to connect to those databases. But 
> I don't know how can I fit the above information into standard form of 
> sqlalchemy like
> 
> dialect+driver://username:password@host:port/database
> 
> I'm trying this 
> 
> create_engine('jdbc:postgres:redshift://hgst-edm-oregon-prod02.cgdmyxu24bfx.us-west-2.redshift.amazonaws.com:xxxx/bdpdw?tcpKeepAlive=true&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory/vqaa
>  <http://org.postgresql.ssl.nonvalidatingfactory/vqaa>')

SQLAlchemy URLs don't use JDBC as that is a technology that only applies to the 
Java VM. To connect to redshift from Python you should use the 
sqlalchemy-redshift driver from 
https://github.com/sqlalchemy-redshift/sqlalchemy-redshift .





> 
> and error message came up like this.
> 
> *ArgumentError*: Could not parse rfc1738 URL from string 
> 'jdbc:postgres:redshift://hgst-edm-oregon-prod02.cgdmyxu24bfx.us-west-2.redshift.amazonaws.com:xxxx/bdpdw?tcpKeepAlive=true&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory/vqaa'
> 
> Please kindly advise. 
> 
> thank you.
> 

> --
>  SQLAlchemy - 
>  The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
>  To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
>  --- 
>  You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
>  To post to this group, send email to sqlalchemy@googlegroups.com.
>  Visit this group at https://groups.google.com/group/sqlalchemy.
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/dcc979fd-ea9c-48ed-9cc2-ad96ce906bf8%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/dcc979fd-ea9c-48ed-9cc2-ad96ce906bf8%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/ee59af8d-388f-4e99-98d8-da6f2caec9b2%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to