 Hey guys welcome to SSUnitex which is in this side and today we are going to see about the union transformation. So what is union transformation? So union will combine multiple data stream into one with the SQL union of those streams as a new output from the union transformation. All the schema from each input stream will be combined inside your data flow without needing have a join key. You can combine a number of stream in the setting table by selecting the plus icon next to each configured row. So that we will see in the practical don't worry if it's not very understanding now. Next including both source data as well as the stream from the existing transformation in your data flow. So go to on the browser and we will try to implement this in practical. So what is the union transformation? So union transformation is nothing but it will be having for example one two or three input source and by using the union transformation we can combine all those source into a single. So this single will be going to generate a new output side. So this is the just appending the row values from each input stream. So this is the union transformation. So go to on the browser and we will try to implement this in practical. So here as we are in the as your broad storage. So here we can see these three files like the India UK and US. So these three files are having the same data of the employee for the India UK and US. So it is having the four columns here employee ID name employee address and department. So all those files are having the same data. So we just want to combine all those together and after combining those we just want to put this into the output folder. So go to on the Azure data factory and let me try to create a new data flow here. So let me quickly call this data flow as union. Now here we are required to add the source. So the first source and this source is for India. So let me call this as India and here let me try to use the inline query instead of creating the data sets because data sets will be physically created inside your data sets. But I'm using this as a demo only. So I'm going to use the inline data query here. Go to the inline data set type. So obviously that should be the delimited file. So delimited text is here linked service as we have already created SSU testing. So we can select that one inside the source option we can browse and we can go inside the input folder and under this input folder we can select this India file click on OK. We can scroll a little bit downside and here the first row as header. So we can select that one we have done for the India. Similarly we have to do for the UK and US. So let me do for US this time inline data query delimited text we can select and after that we can select the link service name inside the source option we can browse and we can go inside the input folder and under the input folder we can select the US and here we can select the first row as header. Now we can go and select for UK this time. So here we can select for UK. Now we can go for inline and here that should be delimited text. We need to select the link service as SSU testing in the source option we can browse go inside input and we can select for UK. So here we have only these three as a source in your case it might be more than that. So we can add all those and after that here we can see this plus symbol. So we can go and we can use the union. So union as we can see it is taking multiple inputs and generating only a single output. So we can select that one here we can see the union. So let me call this as union employee data incoming stream either we can select India US or UK. So we cannot use the underscore so we can remove that here we can select India US or UK. So I am going to select India by default here we can see the option for union by so either we can union by name or the position. So what it means so as Microsoft said when you choose the union by name each column value will drop into the corresponding column from each source with a new concatenated metadata schema. If you are going to choose union by position each column will drop into the original position from each corresponding source resulting a new combined stream of the data where the data from each source is added to the same stream. So like here the same stream like India so all the data will be adding in India. So I am going to leave for by default as name here we can see the union width here we have to specify the streamer. So we can go with the US here we can see the plus symbol to add another one so we can add for UK next we can add plus symbol here we don't have any another so that's why no incoming stream feasible for union because that is not there. So these two we are going to append next we can go inside the data preview and try to refresh it. So this should have combined data so we can wait and we can check so here as we can explore a little bit of side so here we can see ID 1 2 3 so these are from India only then we can see the US like New York Chicago Chicago next we can see the null values here so it is added the new columns because we did some mistake so what mistake we did if we are doing such type of mistakes so it will be going to add the new columns in the union so in the UK side we can go here we did not selected this first row as header so we have to select that option as well now we can go in the data preview and try to refresh it again so here we can see first for the India then we can see for US then we can see the Cambridge Oxford Manchester is from UK so this is all about the data now we can add the sync location here where we just want to keep all these in a single file and here let me use the inline query again with the delimited text and it should be ssu testing go to the setting here we can browse to the path and the power that should be the output we can select it now here we can select the first row as header that is true now we can go in the data preview option and we will try to see the data so it should be having all the data as we have already seen now go to the settings again and here we can scroll in the bottom side so here we can see the file name option instead of by default we just want to keep this in a single file and let me call that file name is employee data so that's it now we can publish it so once we will publish it so it is saying output to a single so we can go here and let me try to select the sync again we need to set the single partition we can select that and after that we can do the publish so it will be published and we can create a new pipeline whether we can call this data set so let me try to create a new pipeline quickly and under this pipeline so publish is completed for the data flow and here let me try to use the data flow activity and here we need to select the data flow that we have created the union one so we have done that now we can just debug it so it will be creating a new file in the output folder with the employee data and that will have all the combined data now we can go here go to the output folder so under this output folder we can see the employee data because our pipeline is executed we can see that it is executed successfully now we can refresh so this is having the employee data here let me try to open this go to the edit so under this edit we will see all the data that we have already seen there so this is all about the union transformation so thank you so much for watching this video see you in the next video