โ10-12-2023 01:50 AM
Hi,
How can I set up the notification email to show all of rows from query_result_table, not only first 10?
โ10-16-2023 03:21 AM
Hi @MeggieFox ,
By default, the body of an email notification for a Databricks Job with a query result table will display the first 10 rows of the query result table. However, you can configure the notification to display all the rows by customizing the email template used for notification.
Hereโs how to configure the email template:
Go to your Databricks workspace and select User > Account Settings > Notifications.
In the Email template section, select Custom.
In the Custom template textbox, replace the existing message with the following template:
Results of query {{job_result.id}}
{% for row in job_result.result().collect() %}
{{ row }}
{% endfor %}
The customized email template uses a Jinja2 template that iterates through all rows in the query result table and appends them as a string. This ensures that all query rows are included in the notification email, instead of just the first 10 rows.
Now, when you run a Job with query results, the notification email will display all of the rows in the query result table.
โ10-16-2023 04:05 AM
Thank you for your reply, but it is not exactly what I thought. I use SQL alerts so dont know where should I go to put this changes written by you.
Workspace > user settings:
I check
โ11-03-2023 04:26 AM
Can you help me with my problem? I have a workspace admin but I cannot find the path as you wrote. When I go to the Account Settings > Notifications I can only see:
โ10-17-2023 04:04 AM
I see that my previous message has been cut.
So, I just wanted to check where can I change email setting using the code above, because when I open User > Account Settings > Notifications I can see only option like this:
there is no place to configuration emails.
regards,
Meggie
Excited to expand your horizons with us? Click here to Register and begin your journey to success!
Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!