Skip to content

Instantly share code, notes, and snippets.

@satybald
Last active May 28, 2018 19:07
Show Gist options
  • Select an option

  • Save satybald/93688815d8e7da1939614f510e023ee2 to your computer and use it in GitHub Desktop.

Select an option

Save satybald/93688815d8e7da1939614f510e023ee2 to your computer and use it in GitHub Desktop.
sql_magic_conn
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" * presto://user@localhost:8080/system\n",
"Done.\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>node_id</th>\n",
" <th>query_id</th>\n",
" <th>state</th>\n",
" <th>user</th>\n",
" <th>source</th>\n",
" <th>query</th>\n",
" <th>queued_time_ms</th>\n",
" <th>analysis_time_ms</th>\n",
" <th>distributed_planning_time_ms</th>\n",
" <th>created</th>\n",
" <th>started</th>\n",
" <th>last_heartbeat</th>\n",
" <th>end</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>ffffffff-ffff-ffff-ffff-ffffffffffff</td>\n",
" <td>20180528_190710_00001_x28f6</td>\n",
" <td>FINISHED</td>\n",
" <td>user</td>\n",
" <td>pyhive</td>\n",
" <td>select * from runtime.queries</td>\n",
" <td>2</td>\n",
" <td>15</td>\n",
" <td>0</td>\n",
" <td>2018-05-28 21:07:10.973</td>\n",
" <td>2018-05-28 21:07:10.995</td>\n",
" <td>2018-05-28 21:07:11.081</td>\n",
" <td>2018-05-28 21:07:11.082</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" node_id query_id \\\n",
"0 ffffffff-ffff-ffff-ffff-ffffffffffff 20180528_190710_00001_x28f6 \n",
"\n",
" state user source query queued_time_ms \\\n",
"0 FINISHED user pyhive select * from runtime.queries 2 \n",
"\n",
" analysis_time_ms distributed_planning_time_ms created \\\n",
"0 15 0 2018-05-28 21:07:10.973 \n",
"\n",
" started last_heartbeat end \n",
"0 2018-05-28 21:07:10.995 2018-05-28 21:07:11.081 2018-05-28 21:07:11.082 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd = %sql select * from runtime.queries limit 1\n",
"pd.DataFrame().head()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment