Skip to main content

Advanced JSON Schema handing and Event Demuxing

Summary

  • Advanced JSON schema handling: This video explores how to manage rapidly changing JSON schemas using Variant data types and DLT with primed schemas to simplify schema inference and evolution.
  • Scalable demultiplexing patterns: Learn event demuxing techniques for breaking down complex streaming data into separate logical streams, enabling efficient processing at scale on the Databricks Data and AI platform.
  • Simplified pipeline implementation: See how DLT streamlines JSON processing and event demuxing, eliminating manual schema management and reducing code complexity in your data pipelines.

Advanced JSON Schema handing and Event Demuxing

Watch: Advanced JSON Schema handing and Event Demuxing
Talk by Dattatraya Walake, Specialist Solutions Architect, Databricks ; Murali Talluri, Specialist Solutions Architect, Databricks
this video explores advanced JSON Schema handing(inference and evolving), and event Demuxing Topics include: How from_json is currently used today and its challenges. How to use Variant for rapidly changing schema. How from_json in DLT with primed schema helps simplify schema handling. Demultiplexing patterns for scalable stream processing. Simply event Demuxing with DLT.
Here’s more to explore:
Production ready data pipelines for analytics and AI: https://www.databricks.com/solutions/data-engineering
The Big Book of Data Engineering: https://www.databricks.com/resources/ebook/big-book-data-engineering-2nd-edition
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements

Chapters

FAQs

What are the challenges with traditional JSON processing using from_json?

This video explains how from_json doesn't support schema inference and evolution, requiring you to specify schemas upfront. When upstream data changes, new fields are ignored, breaking pipelines. DLT with primed schemas solves these limitations on the Databricks Data and AI platform.

How do I handle schemas that evolve over time?

This video demonstrates using Variant data types and DLT's automatic schema management to handle evolving JSON data without breaking your pipelines. You can adapt to new fields and changing structures automatically on the Databricks Data and AI platform.

What is event demuxing and why is it important?

Event demuxing is the process of separating complex streaming data into distinct logical streams for specialized processing. This video shows simplified demuxing patterns using DLT that scale efficiently for high-volume event streams on the Databricks Data and AI platform.

How do I simplify JSON processing in my pipelines?

Learn how DLT streamlines JSON handling by eliminating manual schema management and reducing code complexity. This video demonstrates practical patterns for production-ready data pipelines on the Databricks Data and AI platform.

Full transcript

0:00 Introduction to JSON schema

Hello everyone. Uh very excited to see you all here. Um I'm a specialist solutions architect at data bricks. Um I've been with data bricks for a couple of years now. Uh good morning. This is the tatrial. Uh I'm a specialist solution architect in data engineer and couple of years with the data bricks. Today we are going to walk you through advanced JSON schema handling and demoxing. By the end of this talk, we hope you'll have a good understanding on how to ingest and process JSON data with varying schema and how demoxing can be simplified and can be done at scale using DLT.
So by the end of this talk right so um we'll talk about JSON schema handling and we'll understand why JSON schema handling is even important right modern data pipelines have to deal with um you know semiructured data like JSON and this data comes from variety of sources like IoT devices or you know your application logs um you know or APIs right um and we don't know the schema of this data that come that we need to process and the schema of this data changes is often and we often have no control over the upstream that ingest this data um and everyone loves to ingest um JSON data because it is flexible by design and our data pipelines have to be flexible in handling it too.
At least that's the expectation. Now let's see how JSON data is usually processed is using from JSON. Um from JSON is a function in Spark that parses a JSON call given you specify the schema. This is how the schema of from JSON looks like. It returns a strct and you basically have to extract fields from that strct. Right? The major challenge with using from JSON is it doesn't support schema inference and evolution. Meaning you have to specify the schema as a parameter at the beginning, right?

1:37 Challenges with from_json

And uh let's say you specify the schema and over a period of time if the data has new fields or the schema changes uh those changes would be ignored because the schema doesn't have those fields right. So that's a challenge. Now let's look at some examples of how from JSON is typically used. We'll quickly go over this right. So the first is RD way that most of you might know. What you do is you pick a record from the batch of data and convert it to an RDD and then convert it to data frame and get the schema of it and pass it to from JSON.
This is how the code looks like. And the second way is like you know this is lightweight comparatively. Um what you do is you again pick a batch from the batch of records you again pick a single record um get the convert it to a data frame and then use schema of JSON on top of that and get the schema and then pass it to from JSON as a parameter. um the code looks like this in both these approaches that you might end up picking that random record from the batch of data that might not have all the fields right.
So again you're missing fields. The third approach is basically to use map string comma string as a schema to from JSON and then you basically explore of that map and then you group by all the field fields and uh pivot and add by the key value pair right when you do this it's effective in a way like you know you capture all the fields in your JSON data but this is a very memory intensive operation and um and when you do this all your fields are passed as strings because that's a hint that you specify right that's not what you want even the digs and arrays are going to be like strings and you have to do further processing on it now let's see how we can use variant of to handle JSON processing with know varying schema what is variant like most of you might know variant is a data type in data bricks that uses binary encoding format under the hood to effectively store and query JSON data when you use variant you don't have to worry about the schema specifying schema and how the schema evolves and all that you basically ingest it as variant using variant it's very easy to land data into your bronze layer like data bricks um the reason is when you read JSON data as variant your injection always succeeds as long as your JSON data has valid right or as long as a valid JSON record and varant is actually a very good candidate when the schema of your data changes very often um and often you can't specify the schema.

3:49 JSON processing with variant

Let's look at some examples here where variant is a very good candidate and maybe the only option. So I have a data provider who is ingesting data with the schema and the first field here type indicates like the provider ID something like that. Um and the rest of the fields here there are like seven fields I think lot of fields um there are your actual data and I have another provider who is ingesting data with the schema and I end up having 100 different providers who are ingesting data with 100 different schemas right um what you need to do here is that all the data is coming into a single storage location and you have to basically pass the JSON data and then route it to the respective tables, right?
So, if you typically use autoloader and let's let's let's ignore the variant part for now. If you typically use autoloader and try to do regular JSON parsing, what would happen is autoloader would do some sampling based of the files or the size of the data and then it gets a schema from that sample. It uses that schema, right? And try to read the entire data and it realizes there are more fields in the data. So it's going to restart move the schema and try to get all the fields from your data and you might end up getting close to 700 fields because you have seven fields in each know um type of schema right so and you'll end up getting a in a bronze layer one delta table with 700 fields um that's I mean 700 columns that's not what you want right um now let's look at an u you know variant code example how this can be done you can actually use the same autoloader but you can ingest JSON data as variant this can be done by specifying that option single variant column and when you run this code what will happen is you don't have to worry about the schema parsing sampling and all that what it would basically do is you get a delta table um with just one column instead of 700 columns that you had before um one column and the name of the column is data and the type of it is variant and this is going to be way way way way faster for your injection on your bronze layer because it just checks your JSON data has valid records, right?
As long as it's a val it's not a cor record or something, the injection succeed. Um, now the goal is that now you have this data, it's it's a top one field, right? Now, how do you go about extracting those 100 schemas from it and route them to the respective tables in silver, right? Um this can be done using schema of variant a. What schema of variant a would do is it's going to give you the combined schema from all the fields.
It's going to handle things like type merging like let's say you have a field that's string and also integer or maybe integer and also long. Right? It's going to do the type merging and combine them to uh you know long or you know string based on based on your fields. Right? And it's going to do all that out of the box for you. And you can look at this code. What we are trying to do is we are extracting the type field basically and then trying to get the schema of that field a schema for that data provider type and then applying that schema back on your bronze layer and parsing the JSON and routing it to the respective silver uh table.
In this example we just have it's a it's a simplified example to be honest. So where we have just 100 providers, we have seen cases where we might have thousand different providers or more and schema for each provider would vary right uh within each provider we just have several wheels here but you might have more wheels there or any any level listed right um still using the same technique we can effectively handle um you know injection using variant now your scenario might be different right where variant is on Your scenario might be that you don't have 100 different providers.

8:38 Automatic schema management

You might have very few providers and um the schema of the data changes over a period of time maybe changes daily also right and um your goal is that you don't want to use variant because the schema already you want to enforce the schema on the data in your bronze layer itself maybe um and you want to do it without having to specify the schema because you don't have the schema in the first place and you don't want to worry about the new fields getting added.
You want your pipeline to be robust enough to like the flexibility, right? That's what we talked initially like how JSON is flexible. You want your pipeline to be flexible enough to handle all this. Um how do you do it? This can be done using same from JSON that we discussed before. But in DT you can do it by specifying schema as null. What you do here is that when you specify schema as null, it's going to kick off the automatic schema inference and evolution for you.
Here is how the syntax of from JSON looks like. You can see that schema is now and we we have to specify the schema location though schema location is where you're telling it to store the schema of the infert or the inferred schema of your JSON data right and um and it is managed by DG meaning your pipeline is uh you know deleted so it's going to be it's going to be deleted but it is managed by DG environment so let's see how this is done out of the box for you right let's get into some details What happens when you run the pipeline with from JSON specifying schema as none is um the first way the very first run it's going to see whether there is any uh schema in that schema location you specified right uh there is there is none so what it would do is it would do a schema of JSON act to get the schema of all the all the data that you have that it needs to process in that batch if the streaming engine decided to do you know these many records in your batch it's going to get the schema of um JSON a and get the all the fields and it's going to write it to uh that location and it restarts the pipeline and now in the next in the re after the restart it's going to read your data with that schema.
That's how it it does the first step of automatic schema inference, right? Um now after doing few batches of data, it realizes there is a schema change, right? Um then what will happen is um it it's going to infer those new fields that you added and it merges the schema to that schema location and reset up the pipeline again and tries to read the data with that schema. So that way it is also evolving uh in that schema the scheme your scheme of the data as it evolves the you know it is stored and evolved and it's going to be processed with that schema.
Okay. So what happens today with u you know with this functionality is that let's say you are running running this pipeline and it decided to process maybe a million records in a batch of data for example and your batch has three schema changes at the beginning at the middle at the end. um when it sees a record that has new schema what it does is basically it's going to infer the schema and merge the schema and restart.
Now it needs to process the same 1 million again right with that schema it sees another schema change it's going to restart again so what happens today is that if you have a batch of data that has three schema changes meaning three new fields are there um it it is restarting three times right um when DT gets to DBR6. 4 for that's that's actually um you know it's coming next week when it when it reaches that point we have this include schema evolution by batch meaning when it sees a new field it's not going to just infer off of that new field and then restart the pipeline it's going to do the schema of JSON act again on the entire data to capture all the new fields you have in that batch and merges so that even for 100 schema changes in your batch right uh it's going to reset only once so this is effectively coming maybe next week when DBR 64 is going to be available in the current channel or preview right it's already in preview I think so it's in um so you can start using that uh this is going to save a lot of time in terms of restarts too you can also override schema inference um you know by specifying schema hints right the expectation is that for those fields you give the hint they'll be honored by from JSON and the rest of the fields you are telling like you know automatically infer and a let's look at an example Here I'll quickly go through the example.
I have I have this JSON data with this schema right and I'm ingesting 25 million records thus and after over a period of time I want to introduce another field that's in field 2 and I'm inserting it as long and I have 25 million tickets here and then we are adding we're changing the type of in field and now we are inserting strings for that field right and u and we are also introducing another field under the dick field nested field right uh for it a new field doesn't have to be an outer field any level nested field is going to be considered as a new field right um and now I have 20 million records and then I'm inserting another field here um you know nested field three that's highlighted in the highlighted there right so what happens is you have now 100 million record right and there is one original schema and you have three schema changes and there is one type change but three new fields are there right now let's see how from JSON and DT would handle this for you right um the highlighted code tells you how you can call from JSON to use automatic schema entrance and evolution and uh I have million tickets here right I have like 100 million tickets here I'm specifying max per trigger as 10 million this is 10 million meaning I'm telling the streaming engine to do it in 10 badges right u when you run this code after processing 100 million right so this is how the schema of your delta table looks like and you can see all these new fields got added what happens on the DT side is that the first restart is going to be obvious right you can see it restarted four times the first restart is because there is nothing to infer so it's going to do schema of JSON and infer and then merge and then try to process the first you can't avoid the first restart and there are three restarts because um when it when because of the three schema changes it it sees a new field it's restarting and then merging schema and then processing again one important thing to notice here is that because we inserted in field two as basically uh as an integer.
That's what we declared long what we declared and later we inserting strings there for those records infield 2 is captured as rescue data column right now how do we avoid so many restarts and how do we make sure there are certain fields that you want to do uh you know you don't want to worry about the rescue data column right in your logic to process those fields so how do you how do you work around that for that we have the technique called schema priming what schema priming is basically preloading the schema uh of your data before you actually process the data.
Right? So how this can be done is using schema of JSON act. Uh the same technique that from JSON uses under the hood, right? So what you do is you basically do a schema of JSON act and store the schema and then you pass it to as as a schema into from JSON. That way you're priming, right? Um the advantages of rhyming is basically you can control the schema entrance and evolution although it's it's handled automatically if you want to say like you know like in the previous example where in field two originally came as I know a long or integer and now the type changes right so because it's already persisted it's you know it's going to go as rescue data column so you want to have some sort of control over the inference and evolution um by uh by priming schema and so that you don't worry about the rescue data fields and you can also avoid multiple restarts of your DT pipeline u basically and uh you know schema branding also help you to stabilize the tong stream pipelines because you know the schema of the data that you're processing right um now let's look at um quickly look at an demo for like how from JSON can be used right I have this pipeline here um this is a code for the pipeline where I'm using max offsets I'm specifying schema as none here right and u when you look at this pip line.

16:50 Schema management demo

What you can see is that um it it restarted these many times. If you look at the example here, you can see the first time it didn't process anything, right? Uh because there is no schema at all in the schema location. It did a schema of JSON. Um and it tries to read few batches because your batch size is 10 million, right? It it read two batches. That's why it processed 20 million and didn't saw a schema change and restarted.
You can see here in this example it figured out that there is a new field right um here in the schema location encountered a new field during parsing right yeah there you go in field two so it saw that and it restarted and that's how that's why it restarted so many times right um and then eventually it processed all your 100 million records now let's look at an example how you can prime your schema um by the way in the previous example It took like almost u 17 minutes or 18 minutes roughly right to browse your data.
Now you can prime using u now what I'm doing is from the same topic I'm trying to prime using schema of JSON act and I'm storing it as yaml file um to volume right and uh I'm passing I'm what I'm doing in my DT pipeline is basically I'm reading that prime schema and passing it as a schema h here. Now when you do that what happens is the pipeline processed all those 100 million records right um it didn't restart because you basically essentially what you're trying to do is you're telling it hey this is my schema and process it like this and you didn't see any new fields in the data so it never had to restart now over a period of time if you see new fields or you expect like more fields to going to be coming and you don't want restarts you can use the same technique of priming again and tell passing it as a hint and this priming technique can be essentially useful let's say you want to process be 10 billion ticket and um you don't want to read all that right away, right?
So, and maybe your batch size is 100 million meaning it has to go in like so many badges and you expect you you pretty much know that the schema is changing and you want to avoid the restarts. In this case, it restarted four times but you might end up having like 100 schema changes too, right? Because it's JSON. So, you can use a technique to effectively control and also you know make sure few fields they don't they don't go to rescue data column. um quickly walk you through here in this case out of the 100 million records you can see 14 million records went to rescue data column for that in field three right in field two sorry and if you use the technique um so nothing went because you pretty much know what to you know what to expect you told it like you know pass it as a string and all that so yeah this is how you you can use it and uh with this I conclude the demo and I want to pass it to data for the next session even demoxing thanks Thanks for so yeah.
So what is event demoxing? Uh so event mixing is the process where we can actually separate route and the classify the events based on the certain criteria right like based for example topic or the content of the payload like event type and this process is essential in the big data analytics since these events are generated by diverse systems with the mixed formats because the modern system supports this event modern uh system supports different types of the serialization formats like a JSON proto uh to run and etc.

19:48 Event demuxing concepts

So to parse this mixed data using uh single system will be challenging and where where this event demoxing will help to uh design these essential uh targeted events and based on that targeted events we can focus on specific streams and get the insights in the time and also this eventing process helps to design the scalable and easily maintainable systems. Uh so that's why the event demoxing is important. Uh so this is the technique.
Uh so generally uh we do the eventing two ways. Uh one is a topic based eventing. Uh where the producer or the events are published to the dedicated topic. Uh and generally this is useful when you are actually handling operational use cases where the producer publish the events to predefined topics. So this is a one to one um and this demox by based on the topic. So this is not much flexible to uh demox. Uh so use case like uh e-commerce where the order types events can publish to the order type topic and uh payments can publish to the payment type uh topics.
And the next type is the payload based multiplexing. Uh this is super flexible uh because you can demax by anything. Uh so instead of actually having independent topics everything comes to the shared stream. Uh so for example in the adtech uh use cases you can actually publish all ad events to the shared streams and then demix by uh based on the event type. So for example uh click events or the view events or the different types of events you can demox by uh them.
So it is super flexible to uh Demox. So Demox actually gives this tons of benefits to process the uh heavy event streams. However, like while implementing these event processing uh it comes some challenges since these events are generated by uh diverse systems with multiple formats. Uh we should have systems to capable to process or deralize these different formats. Let's say if your system is not capable to support the backward compatibility.
So with even a small schema changes your system will fail and that will have impact on the downstream systems. Uh also for handling low latency for example these operational use cases. So uh it is a tricky when you are handling low latency event streams with uh your debox logic and then with the scalability issue also because the modern systems supports to generate the events for example it per second it may generate millions of events.
So your system should capable to handle those those events otherwise we can see the throughput gets squeezed and also some special events like uh whenever special events like for example in the advertisements when you are doing camping then you may uh see unpredictable trafficics. So if your system downstream system is not capable to handle we may see uh the back pressure on the upstreams and there is a possibility of uh losing some records too.
So your system should be reliable uh which whenever your pipelines are fail it supports uh exactly one semantics or at least one semantics and handling that in the distributed systems is is not small right. Um and then other issues like it's it should supports the compliance and the security issues because events comes with some sensitive data sets too. So how we can handle all this? So using sparks on datab bricks and the DT uh this simplify this overall eventing pipeline.

24:21 Simplifying demuxing pipelines

So the datab bricks has a native uh functions uh to parse uh the different formats like let's say your data is coming the binary payloads are coming in the uh proto formats or the aero formats or JSON formats uh databix has inbuilt functions like from proto or from a so we can easily pass those event without having additional setup or tooling and also it supports uh because now many of the event system supports to support schema registry to support seoling schema.
So we can seamlessly integrate the schema registry while using this functions uh in natively. So using that we can get the data into the branch. Uh so as we know like in the database platform we can uh design the middle architecture to leverage the uh different layers. So here also we can leverage using middle architecture at bronze data you can get data in any format. Um and these native functions can support uh to dialize the data and on silver layer we can do actual demoxing.
Uh so the demoxing is method like we can achieve through the pan out options like the pan out like you can read the source single source and write to the multiple uh targets. So the to do this fan out options the D provides the flows and API uh flows and syncs APIs uh where using those flows and API we can seamlessly implement this uh pan outs and currently it supports uh the different syncs like delta syncs ka syncs and uh the for each batch sync uh if you are familiar with the structure streaming you know the for each batch so this is a similar semantics uh supported in the uh DT um So let's say the operational use cases if you want to write the data to capac here and um mostly where our customers we are seeing they're demoxing their data to the delta formats.
So the managed delta tables are created using the flows and let's say if you want to demox the data to external delta format tables there we can use the delta syncs um and then kapka syncs for the optional use cases and the forage batch syncs helps like your demox comes with some complex logic let's say you want to enrich your event with the different data sets or like you want to apply some uh rules before like let's say you want to quarant contain the bad data sets to Kapka and then you want to write valid data sets to delta.
So in that case we can use for each batch sync. Um this API is designed such a way uh like for each sync it creates their independent stream. So if you're not aware of the DT the DT is the declarative uh pipeline framework which is built top of the spark streaming. So it provides all the features out of the box and many maintenance task is handled automatically. Uh if you aware like for example the checkpoint management like when you are using structure streaming you have to maintain checkpoint uh explicitly but the with the DT those tasks those tasks handled automatically and these events are processed incrementally.
Uh so because of that like you can actually control specific uh demox let's say you are demoxing uh multiple streams and some streams may require additional resources or additional complex logic you can tune uh ind individual streams uh so using this uh close APIs and also these are the declarative APIs so you we can seamlessly handle uh multiple uh syncs and API using this uh DTD particular API. Um and also it supports the important rights.
Um and if you have any complex merge logic then it also supports merge API. Using merge API we can achieve those complex implementation. Um uh currently it supports uh like we can run uh 25 streams uh concurrently u and this is a soft limit because this again depends on how heavy your uh uh demox logic is how and what is expected as throughput based on that we can we can tune uh but we recommend uh to run uh 25 streams to one pipeline.
Uh but however we are seeing uh many of our customers are actually demoxing hundreds of uh streams and doing this like manually since we cannot run all 100 streams on a on the same pipeline we have to create the multiple pipelines right and doing that manually it's impractical uh so DT API the pipeline API supports to create this pipeline dynamically and allocate these uh newly created or newly onboarded topics to new pipeline uh using some configurations.
We'll see that those details in the demo how we can actually do this at your allocation. Uh this is a code snippet uh where you can let's say your payload types are in the AO format. We can use just from arrow and integrate with the schema registry and the prompt protobuff we can use or without with uh schema registry or without schema registry also we can use uh using prompto. So these are the simple like methods native functions without having additional uh setup we can pass the data.
So let's see this uh in action how we can implement. Yeah. So as part of this demo um I'm considering uh the ad tech use case and um where I'm creating the five independent topics and there is one pad topics where all event types are published um and the data we are creating in the in the JSON format. Um and I'm covering uh four use cases uh like the how how we can implement topic based event uh demoxing. Uh the second use case is how we can do the payload based demoxing and for the low latency how we can use a capka syncs and the how we can implement the complex use cases using uh for each batch sync.

30:19 Event demuxing demo

So uh this demo has set up through the three steps uh and in the readme you can follow read me how to set up this demo what are prerequisites and there are some uh private preview uh and uh disclaimers like there are some features we are using in this demo are in the private preview feature. So they will be available as is or if there are any changes. Um so we you can follow that uh important notes. So in step one uh what we're doing we are creating the sample topics and publishing the uh data to the sample topics.
Uh and also I'm creating here the schema sampling using schema of JSON we just saw in the previous demo. So this will create a ML configuration um and it will map the topic to uh schema and also it captures some metadata. Um along with that we are building a configuration system table which will be used for the at allocation like uh let's say if we have existing pipelines and pipeline has a space to allocate newly created topic then we can allocate this topic to existing pipeline or we can create a new pipeline.
So uh as part of this demo I'm uh using a five topics per pipeline we are using five topics and the if the newly going if the new topics comes then it will create the new pipeline. Uh so let me run this. and yeah and this it will create this configuration and this configuration table uh will look like this. So it is created the six topics and we are limiting five topics per pipeline. So if you see here the first five topics are assigned to the pipeline one pipeline one and the last topic it is assigned to the new uh new pipeline and we are capturing some metadata like the type and the event type.
So basically when you are processing the payload based event you need that criteria right like either uh the event type or any metadata from the payload. Um yeah and then the step two uh it will create the new pipeline and allocate the existing topics or newly created topic to existing pipeline or if the existing pipeline doesn't have enough capacity then it will allocate uh it will create the new pipeline and do this.
So this allocation will happen uh in round robin fashion. So that uh let's say you have a multiple pipelines are exist and you are onboarding the new topics then these new topics will be distributed uh evenly. Yeah. And then uh the last step uh like yeah before that I would like to show how this looks. So the use case one where we are actually demoxing based on the topic. So if you see here uh it is created the five five node.
So here we are actually reading the data from the Kafka and demoxing to the delta sync. So for five topics it creates the five syncs and five flows. Um and each stream has it there each uh flow has its own uh stream. So all these five five streams are actually running independently. And the second use case we saw uh here I'm actually using uh the fat topic. So this is a uh this is all all ad event topics. Um here I'm actually covering uh three use cases.
Uh one is like how to write this data to Kapka sync. uh and then how we can actually use the delta syncs and the uh complex use case we're using the porish batch sync uh and using this forish batch syncs we are writing invalid records quarantine to capka topics and valid records we are writing to the delta sync so let let's see how how it looks uh in the delta pipeline code so Yeah. So, uh, DT provides this declarative uh, API.
Uh, using this DLD for each batch syncs, we can create a create a sync. So, while creating syncs, you can provide the name and uh, if you see this batch semantic, it is similar like batch. If you are familiar in the uh structure streaming, it provides you the data frame and the batch id and then accordingly you can implement uh the demox specific logic inside this. So here here we are writing the valid records to delta sync and while writing we are actually using these two properties.
If you see this t uh transaction app id and transaction version uh it will help to maintain that item portal right. So if you reprocess the stream uh it will maintain this uh application ID and batch ID and uh maintain the uh avoid this writing duplicate records. Uh so how to link this flow right like you have to create the flow and you have create the sync. So using DD declarative API append flow uh we can create the flow and this link uh flow to target using the target name.
Uh so if you see here the sync name uh which we used to create the sync that way we can link uh append flow uh or read uh read stream to uh the output sync. Uh similarly we can create the capka sync. So build provides this uh grade sync um and the format and then you can specify the options capa options and similarly we can use create the delta syncs uh as well. So instead of just capka we can provide the uh delta sync.
Uh also it supports like a fan out like it supports fan in. So let's say you're reading uh multiple sources and writing to the single target. uh we can use this append flow we call it this is a fan in option or fan in fashion we can just write so this this will be useful when you are let's say you want to do back fill the data um to the same table so in the same pipeline we you can just add another append flow um and this whenever you require like just back fill that data so it will help uh to handle those kind of use cases uh and then yeah the last step we can just on this cleanup uh steps to clean up these resources.
So here I will conclude this demo. Uh with that uh I will wrap up uh today's uh so today we walk through uh how we can use a prom JSON in the DT how it offers the flexible way to automatically infer the schema and schema evolution. After that we saw the variant how it simplify the JSON injection and make very fast reads. After that we saw the event demoxing with common use cases and ways to handle. And then finally we saw the DT sync and close API how it making uh simplifying the demox processing.

38:21 Conclusion and resources

Uh the resources what we used as part of this demo they are available under this public GitHub repository. Um both the demos are available uh you can access. Yeah. Um yeah and thank you for uh your time. Let's see open session for the question.

Learn more about the Databricks Data and AI platform.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.