Skip to content

Instantly share code, notes, and snippets.

@ari-vedant-jain
Last active November 9, 2016 21:08
Show Gist options
  • Save ari-vedant-jain/62ae60dc2a6148d56ae9 to your computer and use it in GitHub Desktop.
Save ari-vedant-jain/62ae60dc2a6148d56ae9 to your computer and use it in GitHub Desktop.
import jaydebeapi
conn = jaydebeapi.connect('org.apache.phoenix.jdbc.PhoenixDriver', \
['jdbc:phoenix:localhost:2181:/hbase-unsecure', '', ''], \
'/usr/hdp/current/phoenix-client/phoenix-client.jar', \
['phoenix.functions.allowUserDefinedFunctions', 'true'])
curs = conn.cursor()
curs.execute('select * from "driver_dangerous_events"')
curs.fetchall()
curs.execute('select "driverId", "driverName", count("eventType") from "driver_dangerous_events" GROUP BY "driverId", "driverName"')
curs.fetchall()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment