<jupyter_start><jupyter_text>Reading Customer parquet files from the mount point and writing to Delta tables.<jupyter_code>configs = {
  "fs.azure.account.auth.type": "CustomAccessToken",
  "fs.azure.account.custom.token.provider.class": spark.conf.get("spark.databricks.passthrough.adls.gen2.tokenProviderClassName")
}

dbutils.fs.mount(
  source = "abfss://<EMAIL>",
  mount_point = "/mnt/Gen2Source",
  extra_configs = configs)
#Reading parquet files and adding a new column to the dataframe and writing to delta table
cust_path = "/mnt/Gen2Source/Customer/parquetFiles"
 
df_cust = (spark.read.format("parquet").load(cust_path)
      .withColumn("timestamp", current_timestamp()))
 
df_cust.write.format("delta").mode("overwrite").save("/mnt/Gen2Source/Customer/delta")
display(dbutils.fs.ls("/mnt/Gen2Source/Customer/delta"))
%sql
-- Creating Delta table 
DROP TABLE IF EXISTS Customer;
CREATE TABLE Customer
USING delta
location "/mnt/Gen2Source/Customer/delta"
%sql
select * from Customer limit 10;
#dbutils.fs.unmount("/mnt/Gen2Source")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13594040968342644, 'fraction_numerical': 0.008379888268156424, 'mean_word_length': 5.761006289308176, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '282893', 'license': 'MIT', 'n_tokens_mistral': 371, 'n_tokens_neox': 361, 'n_words': 71, 'path': 'Chapter10/Code/10.3-Reading Writing using Credential passthrough.ipynb', 'repo_name': 'ssprsiva/cloned_databricks', 'size': '1123'}