On JDBC again

221 views
Skip to first unread message

passionbytes bigdata

unread,
Jan 27, 2014, 1:37:05 PM1/27/14
to presto...@googlegroups.com
How to write a sample ion Presto to connect to MySQL ? I am getting an error like below(expected)
2013-11-12T17:24:13.936-0800    ERROR   main    com.facebook.presto.server.PrestoServer No factory for connector mysql
java.lang.IllegalArgumentException: No factory for connector mysql
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:120) ~[guava-15.0.jar:na]
        at com.facebook.presto.connector.ConnectorManager.createConnection(ConnectorManager.java:100) ~[presto-main-0.57.jar:0.57]
        at com.facebook.presto.metadata.CatalogManager.loadCatalog(CatalogManager.java:79) ~[presto-main-0.57.jar:0.57]
        at com.facebook.presto.metadata.CatalogManager.loadCatalogs(CatalogManager.java:64) ~[presto-main-0.57.jar:0.57]
        at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:87) [presto-server-0.57.jar:0.57]
        at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:47) ...


This is what I did. I built the latest distribution 0.59-SNAPSHOT.
In side etc/catalog , I created  jdbc.properties as

connector.name=mysql
mysql.metastore.uri=jdbc:mysql://localhost:3306/myschema

Also put the JDBC jar file of MYSQL in lib folder of Presto.

Anything else? Nowhere anyone is mentioning on how to do it, other than giving the link for presto-jdbc plugin. We know its out there, but can anyone please explain how to use it  briefly ? Thanks

Best regards,
Ravi

sumant...@sprinklr.com

unread,
Jun 5, 2015, 10:19:10 AM6/5/15
to presto...@googlegroups.com
pls help

袁安峰

unread,
Jun 7, 2015, 10:24:12 PM6/7/15
to presto...@googlegroups.com, sumant...@sprinklr.com
The latest version is 0.107, and the mysql connector has no problem.

在 2015年6月5日星期五 UTC+8下午10:19:10,sumant...@sprinklr.com写道:

Sumanth Bandi

unread,
Jun 8, 2015, 9:22:02 AM6/8/15
to presto...@googlegroups.com

The 'mysql.properties' file should be present in presto-main/etc/catalog folder

Also, 'presto-main/etc/config.properties' should be edited. '../presto-mysql/pom.xml' need to be appended in plugin.bundles shown below

$ cat presto-main/etc/config.properties

# sample nodeId to provide consistency across test runs
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.environment=test
http-server.http.port=8080

discovery-server.enabled=true
discovery.uri=http://localhost:8080

exchange.http-client.max-connections=1000
exchange.http-client.max-connections-per-server=1000
exchange.http-client.connect-timeout=1m
exchange.http-client.read-timeout=1m

scheduler.http-client.max-connections=1000
scheduler.http-client.max-connections-per-server=1000
scheduler.http-client.connect-timeout=1m
scheduler.http-client.read-timeout=1m

query.client.timeout=5m
query.max-age=30m

plugin.bundles=\
  ../presto-raptor/pom.xml,\
  ../presto-hive-cdh4/pom.xml,\
  ../presto-example-http/pom.xml,\
  ../presto-kafka/pom.xml,\
  ../presto-tpch/pom.xml,\
  ../presto-mysql/pom.xml

presto.version=testversion
experimental-syntax-enabled=true
distributed-joins-enabled=true
Reply all
Reply to author
Forward
0 new messages