Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
JuanMahecha
Helper I
Helper I

How to have a real-time gold table in a KQL DB, referencing internal or external tables?

I have a DB KQL with the bronze table receiving data in real time with information such as IDs and values, I have some master tables located in a lakehouse, which I shorcut to the DB KQL, the idea is to create a gold table that with the help of the master tables expands the information from the sensors, I have tried to use update policies and materialized views but it tells me that I cannot refer to tables external, I then tried to make a copy of the master tables within the KQL DB to reference them as an internal table, but it tells me now that I can't create an update policy to a table that has the streaming ingestion policy enabled and that also references some table, and disabling that feature means losing the feature of having and visualizing data in real time or with low latency.


So I want to know how I can get that gold table that can do joins or other transformations between internal and external tables, and update in real time for visualization of quick insights, or if at least this is possible from the queryset, or if it's time to use another tool or method.

 

This is the code I'm trying to get to work:

 

.create-or-alter function with (docstring = "Función para limpiar y transformar datos de sensores") UpdateDataFromBronce() {
    BronceDataSensores
    | join kind=inner main_sensores_internal on SensorId
    | join kind=inner master_equipo_internal on EquipoId
    | join kind=inner master_area_internal on AreaId
    | where isnotnull(SensorId) and isnotnull(Descripcion)
    and isnotnull(TipoSensor) and isnotnull(value)
    and isnotnull(EquipoId) and isnotnull(NombreEquipo)
    and isnotnull(AreaId) and isnotnull(NombreArea)
    and isnotnull(EventProcessedUtcTime)
    | project
        SensorId,
        Valor = value,
        EquipoId,
        AreaId,
        Fecha_Hora = EventProcessedUtcTime
}

.alter table GoldDataSensores policy update
@'[{ "IsEnabled": true, "Source": "BronceDataSensores", "Query": "UpdateDataFromBronce()", "IsTransactional": true,  "PropagateIngestionProperties": false }]'
 
I appreciate your help very much
1 ACCEPTED SOLUTION

Hello @JuanMahecha ,

 

Yes, by disabling streaming ingestion and enabling batch ingestion on your bronze table, you will be able to create an update policy that transforms and updates data into the gold table. The use of batch ingestion removes the restrictions imposed by streaming ingestion, allowing you to reference external tables and apply the necessary transformations. To achieve this, you would first disable streaming ingestion on the bronze table, then enable batch ingestion. Afterward, you can create an update policy on the gold table that will perform the required transformations on the incoming data.

 

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

Thankyou

View solution in original post

6 REPLIES 6
JuanMahecha
Helper I
Helper I

I appreciate your help very much, if you could please explain to me how to do a scheduled KQL query and a materialized work to know both options would be very useful to me.
Thanks a lot

v-tsaipranay
Community Support
Community Support

Hi @JuanMahecha ,

Thank you for reaching out to the Microsoft Fabric Community.

 

Currently, KQL DB does not support update policies or materialized views that reference external tables (e.g., Lakehouse shortcuts), as noted in this documentation.

Additionally, when streaming ingestion is enabled, update policies cannot reference other tables, per these restrictions. Due to these platform constraints, a gold table that joins streaming data with master tables in real time is not directly supported.

 

As a workaround, we recommend using a scheduled KQL query or materialized function to perform the enrichment at frequent intervals or leveraging Event stream with transformation nodes to join data before ingestion. If your use case is primarily analytical, modeling the joins in Power BI using Direct Lake can also provide near real-time insights without complex ingestion logic. We're happy to help further if you’d like assistance implementing any of these approaches.

 

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

Thankyou.

@v-tsaipranay 
I can't find documentation about programmed KQL or materialized function, could you explain to me how this works and how to do it, thanks you

Hi @JuanMahecha ,

Thank you for your follow-up.

 

To schedule KQL queries, you can use Microsoft Fabric Notebooks or Data Factory Pipelines. Notebooks allow you to write and schedule KQL queries to run at regular intervals, while Data Factory can orchestrate query execution automatically.

 

A materialized KQL function allows you to define reusable query logic (e.g., joins) without storing data. You can call this function whenever needed for on-demand enrichment.

For more on materialized functions, see Functions - Kusto | Microsoft Learn

 

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

Thankyou.

What about of Policy ingestionbatching? i can disable policy ingestionstreaming in bronce and activate ingestionbatching? In this way the bronze table would be updated in batch and by not having the streaming ingestion policy activated I could create the update policy that updates the data in gold with the transformations I want, this would work?

Hello @JuanMahecha ,

 

Yes, by disabling streaming ingestion and enabling batch ingestion on your bronze table, you will be able to create an update policy that transforms and updates data into the gold table. The use of batch ingestion removes the restrictions imposed by streaming ingestion, allowing you to reference external tables and apply the necessary transformations. To achieve this, you would first disable streaming ingestion on the bronze table, then enable batch ingestion. Afterward, you can create an update policy on the gold table that will perform the required transformations on the incoming data.

 

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

Thankyou

Helpful resources

Announcements
MarchFBCvideo - carousel

Fabric Monthly Update - March 2025

Check out the March 2025 Fabric update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Top Solution Authors