Skip to content

Commit

Permalink
adjust databricks docs
Browse files Browse the repository at this point in the history
  • Loading branch information
drizk1 committed Jun 28, 2024
1 parent c8fc46a commit 7a18379
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions docs/examples/UserGuide/databricks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,36 @@
# - Schema Name
# - warehouse_id

# One thing to note,
# Since each time `db_table` runs, it runs a query to pull the metadata, you may choose to use run `db_table` and save the results, and use these results with `from_query()`. This will reduce the number of queries to your database and is illustrated below.

# Connecting will then proceed as follows:
# ```julia
# instance_id = "string_id"
# token "string_token"
# warehouse_id = "e673cd4f387f964a"
# con = connect(:databricks, instance_id, token, "DEMODB", "PUBLIC", warehouse_id)
# # After connection is established, a you may begin querying.
# stable_table_metadata = db_table(con, "MTCARS")
# stable_table_metadata = db_table(con, "mtcars")
# @chain from_query(stable_table_metadata) begin
# @select(WT)
# @mutate(TEST = WT *2)
# @select(wt)
# @mutate(test = wt *2)
# #@aside @show_query _
# @collect
# end
# ```
# ```
# 32×2 DataFrame
# Row │ wt test
# │ Float64 Float64
# ─────┼──────────────────
# 1 │ 2.62 5.24
# 2 │ 2.875 5.75
# 3 │ 2.32 4.64
# 4 │ 3.215 6.43
# ⋮ │ ⋮ ⋮
# 29 │ 3.17 6.34
# 30 │ 2.77 5.54
# 31 │ 3.57 7.14
# 32 │ 2.78 5.56
# 24 rows omitted
# ```

0 comments on commit 7a18379

Please sign in to comment.