โ07-24-2024 05:06 AM
I am currently using the `apply_changes` feature. I saw for the regular decorator `dlt.table` you can create temporary tables. I do not see the option you could use this feature with `dlt.create_streaming_table(`, in the sql version it looks it is supported: CREATE OR REFRESH TEMPORARY STREAMING TABLE.
Is there any other way I could create a table without the use of `dlt.create_streaming_table`?
โ07-25-2024 07:41 AM - edited โ07-25-2024 07:51 AM
@mbaas you're right, it's not possible to mix %sql with %python magic commands in DLT pipelines source code notebooks.
Adding to the @Icassatti explanation on DLT temporary tables:
"Create a table, but do not publish metadata for the table. The temporary
keyword instructs Delta Live Tables to create a table that is available to the pipeline but should not be accessed outside the pipeline. To reduce processing time, a temporary table persists for the lifetime of the pipeline that creates it, and not just a single update". Source: Delta Live Tables Python language reference
โ07-24-2024 02:51 PM - edited โ07-24-2024 02:54 PM
Hi @mbaas, support for temporary tables by using the create_streaming_table() function is under development at the current moment.
Is there any other way I could create a table without the use of `dlt.create_streaming_table`?
Yes, through the CREATE STREAMING TABLE SQL statement on DLT or DBSQL. In the future this might also be possible through serverless notebooks or serverless job compute.
โ07-25-2024 06:13 AM
Hi @raphaelblg, good news you guys are working on it. I am using python file deployed by databricks bundles. I think it is not possible to mix SQL with python in dlt pipelines right?
โ07-25-2024 07:41 AM - edited โ07-25-2024 07:51 AM
@mbaas you're right, it's not possible to mix %sql with %python magic commands in DLT pipelines source code notebooks.
Adding to the @Icassatti explanation on DLT temporary tables:
"Create a table, but do not publish metadata for the table. The temporary
keyword instructs Delta Live Tables to create a table that is available to the pipeline but should not be accessed outside the pipeline. To reduce processing time, a temporary table persists for the lifetime of the pipeline that creates it, and not just a single update". Source: Delta Live Tables Python language reference
โ07-24-2024 09:03 PM
Read this articles:
Delta Live Tables Python language reference - Azure Databricks | Microsoft Learn
The APPLY CHANGES APIs: Simplify change data capture with Delta Live Tables - Azure Databricks | Mic...
Even you could define as temporary, it would be storage into catalog _Databricks_Internal, so forget temporary in this case.
You must have an append only data source before you apply changes
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group