This post is about how to exit and notebook and return a variable to the calling process.
It should be noted that Synapse can return any variable.
var = <SOME_VALUE> from notebookutils import mssparkutils mssparkutils.notebook.exit(var)
A place for tutorials on programming and other such works.
This post is about how to exit and notebook and return a variable to the calling process.
It should be noted that Synapse can return any variable.
var = <SOME_VALUE> from notebookutils import mssparkutils mssparkutils.notebook.exit(var)
This post is about how to exit and notebook and return a variable to the calling process.
It should be noted that Databricks can only return string values.
First you need to setup dbutils.
str = "<SOME_VALUE>" dbutils.notebook.exit(str)
This post is how to work with Databricks SQL through a Notebook.
Create a Temp View of a DataFrame.
df = <SOMETHING> df.createOrReplaceTempView("<TABLE_NAME>")
Drop a Table
%sql drop table <SCHEMA>.<TABLE>;
Describe Table
%sql desc table extended <SCHEMA>.<TABLE>;
Describe Detail
%sql describe detail <SCHEMA>.<TABLE>;
Show Table Properties
%sql SHOW TBLPROPERTIES <SCHEMA>.<TABLE>;
Describe History
%sql describe history <SCHEMA>.<TABLE>;
Create Schema
%sql CREATE SCHEMA IF NOT EXISTS <SCHEMA>;
Create Parquet Table
%sql CREATE TABLE <SCHEMA>.<TABLE> USING PARQUET LOCATION 'abfss://<COTNAINER>@<STORAGE_ACCOUNT>.dfs.core.windows.net/<FOLDER>/'
Create Delta Table
%sql CREATE TABLE <SCHEMA>.<TABLE> USING DELTA LOCATION 'abfss://<COTNAINER>@<STORAGE_ACCOUNT>.dfs.core.windows.net/<FOLDER>/'
Upsert
MERGE INTO schema.table t \ USING ( \ SELECT columns \ FROM table \ ) AS source ON (source.column = t.column) \ WHEN NOT MATCHED THEN \ INSERT ( \ ( \ column, column2 \ ) \ VALUES ( \ source.column, source.column2 \ ) \ WHEN MATCHED THEN \ UPDATE SET \ t.column = source.column \
You must be logged in to post a comment.