-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the structure to the original structure and made pyarrow as o…
…ptional
- Loading branch information
1 parent
c42961b
commit 8417134
Showing
75 changed files
with
1,733 additions
and
891 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
databricks_sql_connector_core/src/databricks/sqlalchemy/__init__.py
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
from databricks import sql | ||
import os | ||
|
||
with sql.connect(server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME"), | ||
http_path = os.getenv("DATABRICKS_HTTP_PATH"), | ||
access_token = os.getenv("DATABRICKS_TOKEN")) as connection: | ||
with sql.connect( | ||
server_hostname=os.getenv("DATABRICKS_SERVER_HOSTNAME"), | ||
http_path=os.getenv("DATABRICKS_HTTP_PATH"), | ||
access_token=os.getenv("DATABRICKS_TOKEN"), | ||
) as connection: | ||
|
||
with connection.cursor() as cursor: | ||
cursor.execute("CREATE TABLE IF NOT EXISTS squares (x int, x_squared int)") | ||
with connection.cursor() as cursor: | ||
cursor.execute("CREATE TABLE IF NOT EXISTS squares (x int, x_squared int)") | ||
|
||
squares = [(i, i * i) for i in range(100)] | ||
values = ",".join([f"({x}, {y})" for (x, y) in squares]) | ||
squares = [(i, i * i) for i in range(100)] | ||
values = ",".join([f"({x}, {y})" for (x, y) in squares]) | ||
|
||
cursor.execute(f"INSERT INTO squares VALUES {values}") | ||
cursor.execute(f"INSERT INTO squares VALUES {values}") | ||
|
||
cursor.execute("SELECT * FROM squares LIMIT 10") | ||
cursor.execute("SELECT * FROM squares LIMIT 10") | ||
|
||
result = cursor.fetchall() | ||
result = cursor.fetchall() | ||
|
||
for row in result: | ||
print(row) | ||
for row in result: | ||
print(row) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
from databricks import sql | ||
import os | ||
|
||
with sql.connect(server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME"), | ||
http_path = os.getenv("DATABRICKS_HTTP_PATH"), | ||
access_token = os.getenv("DATABRICKS_TOKEN")) as connection: | ||
with sql.connect( | ||
server_hostname=os.getenv("DATABRICKS_SERVER_HOSTNAME"), | ||
http_path=os.getenv("DATABRICKS_HTTP_PATH"), | ||
access_token=os.getenv("DATABRICKS_TOKEN"), | ||
) as connection: | ||
|
||
with connection.cursor() as cursor: | ||
cursor.execute("SELECT * FROM default.diamonds LIMIT 2") | ||
result = cursor.fetchall() | ||
with connection.cursor() as cursor: | ||
cursor.execute("SELECT * FROM default.diamonds LIMIT 2") | ||
result = cursor.fetchall() | ||
|
||
for row in result: | ||
print(row) | ||
for row in result: | ||
print(row) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
from databricks import sql | ||
import os | ||
|
||
with sql.connect(server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME"), | ||
http_path = os.getenv("DATABRICKS_HTTP_PATH"), | ||
access_token = os.getenv("DATABRICKS_TOKEN"), | ||
_user_agent_entry="ExamplePartnerTag") as connection: | ||
with sql.connect( | ||
server_hostname=os.getenv("DATABRICKS_SERVER_HOSTNAME"), | ||
http_path=os.getenv("DATABRICKS_HTTP_PATH"), | ||
access_token=os.getenv("DATABRICKS_TOKEN"), | ||
_user_agent_entry="ExamplePartnerTag", | ||
) as connection: | ||
|
||
with connection.cursor() as cursor: | ||
cursor.execute("SELECT * FROM default.diamonds LIMIT 2") | ||
result = cursor.fetchall() | ||
with connection.cursor() as cursor: | ||
cursor.execute("SELECT * FROM default.diamonds LIMIT 2") | ||
result = cursor.fetchall() | ||
|
||
for row in result: | ||
print(row) | ||
for row in result: | ||
print(row) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.