 Hello, welcome to SSU Unitec social decide and this is continuation of Azure Databricks tutorial. So in this video we are going to see how we can read the data from the temp view by using the parameters. So this is the continuation of the previous video. So I would strongly recommend if you haven't watched the previous video of this video series. So you should watch that video before going to watch this video. I'll be providing the link of that video in the description of this video. So you can simply watch from here. Let me quickly go into the browser and we'll see in practical. So here we are going to create the multi select type parameter. So here we have already created this in the last video. So I'm not going to explain how we can create it. I'm going to simply execute it. So as here we can see this country MS has been created and it is having default value as Iceland. Now next we want to go inside the SQL server and here we are having this country master table. So we want to create a data frame and we'll be reading this country master table from this SQL to that data frame and it will be having three columns ID location and effective date and as we can see it is having total 27 rows. Now go back to the browser. We have also discussed how we can create the connection with the SQL server in the earlier videos. So I'm going to use that directly here without going to explain. So this is the syntax I'm going to execute directly. So it will be going to make the connection and after making the connection it will be going to have this remote table. So this will be the data frame and it will be having all the rows. Let me quickly delete this cell from here and let me use the display command. So we can see whatever the values there inside this remote table. So display is not working because this is the SQL type notebook. So let me try to use the magic command and inside the magic command we can use the Python code. So this is the typo mistake. Let me use the Python and try to execute it. So we should be able to see all the rows that we can see here. So next we need to create a temp view by using this data frame. So simply we can go here and we can use the create or replace temp view and inside that we can specify the name. So I'm going to specify the name as country data. Let me try to execute it. So this is the temp view which will be holding all the rows. So let me try to use the select query. So select a stick from your temp view which is a country data. So again it will be having all these rows. Now here we can see we are having this input parameter. So we need to use this input parameter and try to filter this temp view. So before going to filter out here we need to see how we can read this parameter value here. So we can simply use the select and after that get argument and under that we need to specify the name of this parameter. So the name is country MS. So we can simply use the country MS which is the name and we can execute it. So here we should be able to see the Iceland value that we can see. So if we want to use and try to filter with a single value then we can directly use this get argument. So here we can use the where clause and then we can see location that should be equals to this get argument value. Let me try to execute and it should be working as we can see. But if we are going to select the multiple values then let me try to execute and we'll see it is not working as we can see query written no result. So you are thinking we can use the in here. So if we are going to use the in then here you have to use the sub query. Let me try to execute and we'll see whether this is working or not. Again it is not returning anything why it's not returning. Let me quickly go here and see this parameter value. So it is having value with the comma separated values. But let me try to copy this and go to the SSMS and if we are going to use the where clause with the location and after that in if we are going to pass this value directly. So it will not be working because we have to use the single code inside this Iceland and Spain. That's why it's not working. So what you have to do you have to use the split function to convert this value as an array. So what you can do you can simply use the split and after that here you need to supply by using comma. So whenever we are having the comma we need to split that and this is split should be going to array. So we can execute and here we'll see it is having an array on the zero index we are having Iceland and the index one we are having this Spain. So this is we have done but if we are going to use this array directly inside the SQL query so SQL will not be able to understand how we can treat these values. So what you have to do you have to use the explore function. So explore function is very important and you will be seeing while we are discussing about the PI spark. So this is very important what it will be doing it will be going to parse this input array value to the proper plain test. So that's why we have to use the explore function and let me try to execute it. So as we can see we are having the values as an tabular format. So array is converted into a table. So while you are going to play with the JSON so on that JSON file you should be seeing multiple JSONs and those values could be inside the array. So for those purpose we will be seeing this explore function. So that explore function will be very helpful. So instead of using directly get argument we can use this query. So if we are going to use this query by replacing this and try to execute it. So this time we should be able to see two rows here. Now if you are going to select three rows and we will try to execute then we should be seeing we are having three. If you are going to select all these four then we can see it is also having all these four values. One more thing that you have noticed we have passed the hard code value for this country selection. So how we can make it dynamic we have already discussed in the earlier videos of this video series. So you can watch how we can make it as dynamic. So on the dynamic phase we are reading the values from this country master table of the country column and that we are going to see how it is appearing inside this parameter choices. So thank you so much for watching this video. If you like this video please subscribe our channel to get many more videos. See you in the next video.