Skip to content

Instantly share code, notes, and snippets.

View guanjieshen's full-sized avatar

Guanjie Shen guanjieshen

  • Canada
View GitHub Profile
@guanjieshen
guanjieshen / databricks_python_library.py
Last active August 10, 2023 21:22
Databricks SQL Execution API Examples
from databricks import sql
import os
with sql.connect(server_hostname = "adb-xxxxxx.xx.azuredatabricks.net",
http_path = "/sql/1.0/warehouses/c130039b655d51f4",
access_token = "dapixxxxxx") as connection:
with connection.cursor() as cursor:
cursor.execute("SELECT l_orderkey, l_extendedprice, l_shipdate FROM lineitem LIMIT 2")
result = cursor.fetchall()
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"connectorName": {
"defaultValue": "testConnector",
"type": "String",
"metadata": {
"description": "The name of the Azure Databricks Access Connector to create."
}
@guanjieshen
guanjieshen / Delta Sharing Reciever.ipynb
Last active June 24, 2022 21:43
Import the Open Databricks Data Sets into a Databricks Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guanjieshen
guanjieshen / multi_sink_structured_streaming.ipynb
Last active May 28, 2022 04:59
Multi-Sink Structured Streaming
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guanjieshen
guanjieshen / Databricks MS Access Example.ipynb
Last active May 18, 2022 19:22
Example of how to connect to a Microsoft Access Database using Databricks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guanjieshen
guanjieshen / Dockerfile
Last active January 11, 2022 20:00
Databricks Container Base + Custom Maven Dependencies
FROM databricksruntime/standard:9.x
# Add Additional dependencies
ADD https://repo1.maven.org/maven2/com/microsoft/azure/azure-eventhubs-spark_2.12/2.3.21/azure-eventhubs-spark_2.12-2.3.21.jar databricks/jars
@guanjieshen
guanjieshen / keybase.md
Created June 2, 2021 17:20
Keybase Proof

Keybase proof

I hereby claim:

  • I am guanjieshen on github.
  • I am guanjieshen (https://keybase.io/guanjieshen) on keybase.
  • I have a public key ASDU9ZS9tBaoEwxFR-KrQnnLgQHQ2Tqcwp5ibx6tF6YnQgo

To claim this, I am signing this object: