Perform Verify Operation

Below are the examples showing use of Verify operation with different Formats.

Note: We recommend to use Format 5 to perform Verify Opertaion in Snowflake.
  • Performing Verify operation in Snowflake environment by using Format 1:
    create or replace table all_data_result as 
                        select ID,addressline1,city, state, zip, verify(      
                        iff (ADDRESSLINE1 is not null, ADDRESSLINE1,'') 
                        || iff (city is not null, ','||city,'')
                        || iff (state  is not  null, ','||state,'')
                        || iff (zip  is not  null, ','||zip,'')
                        ,country) as address, country from all_data;
                    
  • Performing Verify operation in Snowflake environment by using Format 2:
    create or replace table all_data_result as 
                            select ID,addressline1,city,state,zip, verify(array_construct(    
                            iff(ADDRESSLINE1 is not null, ADDRESSLINE1,'') 
                            ||iff(city is not null, ','||city,'')
                            ||iff(state  is not  null, ','||state,'')
                            ||iff(zip  is not  null, ','||zip,''),country)) 
                            as address,country from all_data;
                        
  • Performing Verify operation in Snowflake environment by using Format 3:
    create or replace table all_data_result as 
                        select ID,addressline1,city,state,zip, verify(
                        array_construct( 
                        'addressLines, iff(ADDRESSLINE1 is not null, ADDRESSLINE1,''),
                        'country',country     
                        ))
                        as address,country from all_data;
                    
  • Performing Verify operation in Snowflake environment by using Format 4:
    create or replace table all_data_result as 
                            select ID,addressline1,city,state,zip, verify(
                            array_construct( 
                            'addressLines', iff(ADDRESSLINE1 is not null, ADDRESSLINE1,'')
                            ,'country',country
                            ,'city',iff(city is not null, city,'')
                            ,'admin1',iff(state  is not  null, state,'')
                            ,'postalCode',iff(zip  is not  null, zip,'')
                            ))
                            as address,country from all_data ;
                        
  • Performing Verify operation in Snowflake environment by using Format 5 (Recommended):
    create or replace table all_data_result as 
                            select ID,addressline1,city,state,zip,  
                            object_construct( 
                            'addressId', iff(ID is not null, ID,'')
                            ,'addressLines', array_construct(iff(ADDRESSLINE1 is not null, ADDRESSLINE1,''))
                            ,'country',country
                            ,'city',iff(city is not null, city,'')
                            ,'admin1',iff(state  is not  null, state,'')
                            ,'postalCode',iff(zip  is not  null, zip,'')
                            ) as sentObject
                            , verify(sentObject) as address,country from all_data;