Switch from Legacy BigQuery to new BigQuery Linked Service

ShilpaGopal 100 Reputation points
2024-09-24T10:13:48.1233333+00:00

 

I have a BigQuery routine that takes start date and end date as input parameter and both input parameter is declared of type String in routine. This routine is working fine without errors.

I want to invoke the BigQuery routine from Azure Data Factory. I use “Copy data” to invoke BQ Routine from Data Factory. Using the old Big Query Linked Service (Legacy) the below invocation of BQ Routine from ADF works without errors.

@concat('

    CALL mycompany-gcp.analytics_266606666.get_appointment_report(

            ''',

            variables('BQStartDate'),

            ''', ''',

            variables('BQEndDate'),

            '''

        )

')

 

But, when I use the new Big Query Linked Service, the routine fails with below error code. The old and the new Big Query Linked service configuration are the same.

 User's image

 

I have gone through the ADF documentation where there is a comparison between legacy and new connector.

https://video2.skills-academy.com/en-us/azure/data-factory/connector-google-bigquery?tabs=data-factory

Is there any change in the format of input parameters passed to the BigQuery routine in hte new BigQuery LinkedService?

User's image

What change must be made when we switch from old legacy BiqQuery to new BigQuery linked service?

 

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,643 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 24,181 Reputation points
    2024-09-24T11:04:25.4033333+00:00

    Ensure that the parameters passed from Azure Data Factory (ADF) to BigQuery are correctly formatted for the new service. The new connector might require a different way of escaping or quoting parameters. For example, ensure that the single quotes are correctly formatted and variables are passed in the expected way.

    Temporarily replace variables('BQStartDate') and variables('BQEndDate') with hardcoded values to check if the issue persists. This can help determine if the issue lies in how ADF is resolving the variables or how they are passed to BigQuery.

    CALL mycompany-gcp.analytics_266606666.get_appointment_report(
    
     '2023-09-01', '2023-09-30'
    
    );
    
    

    The new connector might have updated rules for handling stored procedures and routines. Double-check the Microsoft Documentation on the new BigQuery connector to see if there are changes in how routines and input parameters are managed.

    Ensure that the data types for the input parameters are correctly declared and match what the new Linked Service expects. The routine takes String as input, but sometimes the connector may implicitly handle types differently, especially with dates.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.