Skip to content

Commit

Permalink
add youtube link
Browse files Browse the repository at this point in the history
  • Loading branch information
buremba committed Aug 27, 2024
1 parent 20aaf73 commit 5b087ab
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 104 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ UniverSQL relies on Snowflake and Polaris for access control and data catalog so

[![Demo](https://s3.ezgif.com/tmp/ezgif-3-7afce8acdb.gif)](https://www.youtube.com/watch?v=s1fpSEE-pAc)

#### [Watch on YouTube](https://www.youtube.com/watch?v=s1fpSEE-pAc)


# How it works?

* Snowflake SQL API implementation to handle the Snowflake connections, acting as a proxy between DuckDB and Snowflake.
Expand Down
154 changes: 50 additions & 104 deletions testing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 68,
"execution_count": 23,
"id": "initial_id",
"metadata": {
"ExecuteTime": {
Expand All @@ -23,14 +23,17 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 24,
"id": "a28646d5a8560160",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-23T14:30:35.029029Z",
"start_time": "2024-08-23T14:30:34.783445Z"
},
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
Expand Down Expand Up @@ -112,7 +115,7 @@
" <td></td>\n",
" <td></td>\n",
" <td>600000</td>\n",
" <td>42540544</td>\n",
" <td>42494464</td>\n",
" <td>ACCOUNTADMIN</td>\n",
" <td>...</td>\n",
" <td>ON</td>\n",
Expand Down Expand Up @@ -220,7 +223,7 @@
"\n",
" bytes owner ... change_tracking is_external \\\n",
"0 43210240 ACCOUNTADMIN ... ON N \n",
"1 42540544 ACCOUNTADMIN ... ON N \n",
"1 42494464 ACCOUNTADMIN ... ON N \n",
"2 58829312 ACCOUNTADMIN ... ON N \n",
"3 42525678592 ACCOUNTADMIN ... OFF N \n",
"4 0 ACCOUNTADMIN ... OFF N \n",
Expand All @@ -242,7 +245,7 @@
"[5 rows x 22 columns]"
]
},
"execution_count": 27,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -253,40 +256,17 @@
},
{
"cell_type": "code",
"execution_count": 69,
"id": "ea7059a9dc949865",
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-08-25T02:20:47.093505Z",
"start_time": "2024-08-25T02:20:34.445351Z"
}
},
"outputs": [
{
"data": {
"text/plain": " C_MKTSEGMENT count\n0 AUTOMOBILE 119008\n1 BUILDING 120568\n2 FURNITURE 119872\n3 HOUSEHOLD 120756\n4 MACHINERY 119796",
"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>C_MKTSEGMENT</th>\n <th>count</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>AUTOMOBILE</td>\n <td>119008</td>\n </tr>\n <tr>\n <th>1</th>\n <td>BUILDING</td>\n <td>120568</td>\n </tr>\n <tr>\n <th>2</th>\n <td>FURNITURE</td>\n <td>119872</td>\n </tr>\n <tr>\n <th>3</th>\n <td>HOUSEHOLD</td>\n <td>120756</td>\n </tr>\n <tr>\n <th>4</th>\n <td>MACHINERY</td>\n <td>119796</td>\n </tr>\n </tbody>\n</table>\n</div>"
},
"execution_count": 69,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"con.cursor().execute(\"\"\"SELECT \"TPCH_SF1\".\"DYNAMIC_ICEBERG_TABLE_CUSTOMER\".\"C_MKTSEGMENT\" AS \"C_MKTSEGMENT\", COUNT(*) AS \"count\" FROM \"MY_ICEBERG_JINJAT\".\"TPCH_SF1\".\"DYNAMIC_ICEBERG_TABLE_CUSTOMER\" GROUP BY \"TPCH_SF1\".\"DYNAMIC_ICEBERG_TABLE_CUSTOMER\".\"C_MKTSEGMENT\" ORDER BY \"TPCH_SF1\".\"DYNAMIC_ICEBERG_TABLE_CUSTOMER\".\"C_MKTSEGMENT\" ASC\"\"\").fetch_pandas_all()\n"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "b157465faf38b029",
"execution_count": 26,
"id": "d01f1e0b-d4b7-4b16-b1a8-adf73b874dde",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-23T02:34:57.320352Z",
"start_time": "2024-08-23T02:34:56.948628Z"
"end_time": "2024-08-23T14:34:49.413Z",
"start_time": "2024-08-23T14:34:49.012550Z"
},
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
Expand Down Expand Up @@ -317,61 +297,60 @@
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>AUTOMOBILE</td>\n",
" <td>119008</td>\n",
" <td>MACHINERY</td>\n",
" <td>119796</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>HOUSEHOLD</td>\n",
" <td>120756</td>\n",
" <td>AUTOMOBILE</td>\n",
" <td>119008</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>BUILDING</td>\n",
" <td>120568</td>\n",
" <td>FURNITURE</td>\n",
" <td>119872</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>MACHINERY</td>\n",
" <td>119796</td>\n",
" <td>HOUSEHOLD</td>\n",
" <td>120756</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>FURNITURE</td>\n",
" <td>119872</td>\n",
" <td>BUILDING</td>\n",
" <td>120568</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" C_MKTSEGMENT count_star()\n",
"0 AUTOMOBILE 119008\n",
"1 HOUSEHOLD 120756\n",
"2 BUILDING 120568\n",
"3 MACHINERY 119796\n",
"4 FURNITURE 119872"
"0 MACHINERY 119796\n",
"1 AUTOMOBILE 119008\n",
"2 FURNITURE 119872\n",
"3 HOUSEHOLD 120756\n",
"4 BUILDING 120568"
]
},
"execution_count": 18,
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"con.cursor().execute('select C_MKTSEGMENT, count(*) from my_iceberg_jinjat.tpch_sf1.\"DYNAMIC_ICEBERG_TABLE_CUSTOMER\" group by all').fetch_pandas_all()"
"con.cursor().execute(\"select C_MKTSEGMENT, count(*) from my_iceberg_jinjat.tpch_sf1.dynamic_iceberg_table_customer group by all\").fetch_pandas_all()"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "d01f1e0b-d4b7-4b16-b1a8-adf73b874dde",
"execution_count": 27,
"id": "88d8a111-9e2e-4738-87e9-e43c53c0f4f5",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-23T14:34:49.413Z",
"start_time": "2024-08-23T14:34:49.012550Z"
},
"collapsed": false
"end_time": "2024-08-23T14:35:05.027142Z",
"start_time": "2024-08-23T14:34:51.583357Z"
}
},
"outputs": [
{
Expand All @@ -395,68 +374,37 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>C_MKTSEGMENT</th>\n",
" <th>count_star()</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>MACHINERY</td>\n",
" <td>119796</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>AUTOMOBILE</td>\n",
" <td>119008</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>FURNITURE</td>\n",
" <td>119872</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>BUILDING</td>\n",
" <td>120568</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>HOUSEHOLD</td>\n",
" <td>120756</td>\n",
" <td>1500000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" C_MKTSEGMENT count_star()\n",
"0 MACHINERY 119796\n",
"1 AUTOMOBILE 119008\n",
"2 FURNITURE 119872\n",
"3 BUILDING 120568\n",
"4 HOUSEHOLD 120756"
" count_star()\n",
"0 1500000000"
]
},
"execution_count": 31,
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"con.cursor().execute(\"select C_MKTSEGMENT, count(*) from my_iceberg_jinjat.tpch_sf1.dynamic_iceberg_table_customer group by all\").fetch_pandas_all()"
"con.cursor().execute(\"select count(*) from my_iceberg_jinjat.tpch_sf1.orders_iceberg_tpch_sf1000\").fetch_pandas_all()"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "88d8a111-9e2e-4738-87e9-e43c53c0f4f5",
"metadata": {
"ExecuteTime": {
"end_time": "2024-08-23T14:35:05.027142Z",
"start_time": "2024-08-23T14:34:51.583357Z"
}
},
"execution_count": 28,
"id": "5be1a409-d43e-4e5a-bae1-df3bc32f9a8d",
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -561,7 +509,7 @@
"[1000 rows x 2 columns]"
]
},
"execution_count": 32,
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -573,10 +521,8 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3bf62429db6fdb4f",
"metadata": {
"collapsed": false
},
"id": "22864020-2b0b-46b5-94be-c74a6e691fbb",
"metadata": {},
"outputs": [],
"source": []
}
Expand Down

0 comments on commit 5b087ab

Please sign in to comment.