Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Normalization: Overrule default parameter values (query_tag a.o.) #9953

Closed
pjleiwa6g opened this issue Feb 1, 2022 · 5 comments
Closed
Assignees
Labels
area/connectors Connector related issues community connectors/destination/snowflake team/destinations Destinations team's backlog type/enhancement New feature or request

Comments

@pjleiwa6g
Copy link

pjleiwa6g commented Feb 1, 2022

Tell us about the problem you're trying to solve

When using 'basic normalization' for a Snowflake destination, the value of query_tag is set to 'normalization'. I would like to have an option to overrule this value.

Related issues, in which query_tag and other dbc parameters can be set: #9623 which also solves this issue: #9467, but it only does this for the 'raw' method.

Describe the solution you’d like

I would like to have the solution for #9623 to be extended. So when a query_tag is entered in the UI it would overrule the default query_tag which is used for normalization. And also other additional parameters that are set should overrule the default.

Describe the alternative you’ve considered or used

Use the 'raw' method and do the normalization outside of Airbyte.

┆Issue is synchronized with this Asana task by Unito

@ChristopheDuong
Copy link
Contributor

ChristopheDuong commented Feb 1, 2022

In that case, for implementation, I would suggest the destination-snowflake's spec should have a specific query-tag property instead of a generic jdbc-params (it's fine to keep the generic jdbc params, but it would be preferable to have the query tag isolated too)

Then in normalization you can check if the query-tag field is populated and use it or fallback to normalization here:

@pjleiwa6g
Copy link
Author

An possibility is to extract the query_tag value from the jdbc-params. If it's not in the jdbc-params, one can fall back to the default normalization.

Something like this (in transform.py):

  • parameter ->query_tag
  • jdbc_url_params ->config["jdbc_url_params"]
  • default -> normalization
    ....    
    import urllib.parse
    ....

    def transform_snowflake(config: Dict[str, Any]):
    ....
        query_tag=TransformConfig.get_jdbc_param_value("query_tag".upper(),config["jdbc_url_params"].upper(),"normalization")
    ....
       "query_tag": query_tag,
    ....
    
    def get_jdbc_param_value(parameter,jdbc_url_params,default_value):
        parameter_length=len(parameter) + 1 # +1 because of the = sign
        parameters=jdbc_url_params.split(',')
        parameter_value=default_value
        
        for i in parameters:
            if i.startswith(parameter):
                parameter_value=urllib.parse.unquote(i[parameter_length:])
                                
                return parameter_value

@ChristopheDuong
Copy link
Contributor

Sure it seems fine, you're welcome to push a PR there!

@vishjain
Copy link

vishjain commented Jul 7, 2022

Hi @marcosmarxm , Can you please assign this task? Thanks!

@grishick grishick added the team/destinations Destinations team's backlog label Sep 27, 2022
@marcosmarxm
Copy link
Member

Basic normalization is deprecatd and was removed for Snowflake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues community connectors/destination/snowflake team/destinations Destinations team's backlog type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants