File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change 2121
2222from sqlalchemy import create_engine
2323
24- # It is usually not a good idea to bury starting the JVM in a library. Doing so would
25- # make it so that JPype can only be used in the module and not available for other things.
26- # You would also have to handle cases were the JVM is already started or the JVM was started
27- # with a different thread than main.
28- import jpype
29- #jpype.startJVM("-ea")
30- jpype .startJVM ("-ea" , classpath = "lib/*" )
24+ engine = create_engine ('drill+sadrill://localhost:8047/dfs?use_ssl=False' )
3125
32- #engine = create_engine('drill+sadrill://localhost:8047/dfs?use_ssl=False')
33- #
34- #with engine.connect() as con:
35- # rs = con.execute('SELECT * FROM cp.`employee.json` LIMIT 5')
36- # for row in rs:
37- # print(row)
26+ with engine .connect () as con :
27+ rs = con .execute ('SELECT * FROM cp.`employee.json` LIMIT 5' )
28+ for row in rs :
29+ print (row )
3830
3931print ("Now JDBC" )
4032jdbc_engine = create_engine ('drill+jdbc://admin:password@localhost:31010' )
You can’t perform that action at this time.
0 commit comments