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

SNOW-1926956: Attribute to map DDL queried from Snowflake #1099

Open
nh-tu-z opened this issue Feb 13, 2025 · 0 comments
Open

SNOW-1926956: Attribute to map DDL queried from Snowflake #1099

nh-tu-z opened this issue Feb 13, 2025 · 0 comments
Labels

Comments

@nh-tu-z
Copy link

nh-tu-z commented Feb 13, 2025

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of .NET driver are you using?
    4.3.0

  2. What operating system and processor architecture are you using?
    Windows 11 Pro | 64-bit operating system, x64-based processor

  3. What version of .NET framework are you using?
    .NET 8.0

  4. What did you do?

    I have queried the snowpark container endpoint to use in my application. I got the information successfully. However, it can not be mapped to class property.

public async Task<SnowparkServiceProperties> GetSnowparkServiceProperties(IDbConnection connection)
{
    return await connection.QuerySingleAsync<SnowparkServiceProperties>("SHOW ENDPOINTS IN SERVICE \"MY_SERVICE\"");
}
public class SnowparkServiceProperties
{
    [Column("ingress_url")]
    public string IngressUrl { get; set; } = string.Empty;
}

In somewhere, I try to get it:

var snowparkData = await _systemRepository.GetSnowparkServiceProperties(connection);

And I came up with snowparkData.IngressUrl = "" (empty) when trying to debug it.

  1. What did you expect to see?

    What should have happened and what happened instead?

With the steps mentioned above, I expect to have the ingress url in snowparkData.IngressUrl instead of empty. However, when I create the class like

public class SnowparkServiceProperties
{
    public string ingress_url { get; set; } = string.Empty;
}

it can totally get the result as I expected.

I am thinking that [Column("ingress_url")] attribute is not working in this case.

So what I am expecting is an attribute to map class property to the snowflake metadata (ingress_url to IngressUrl). Do we have an attribute to solve this problem?

For further information, I have successfully mapped sql query data from snowflake using Column attribute. But in case of DDL, I can't do that.

  1. Can you set logging to DEBUG and collect the logs?

    https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

    There is an example in READMD.md file showing you how to enable logging.

    Before sharing any information, please be sure to review the log and remove any sensitive
    information.

@nh-tu-z nh-tu-z added the bug label Feb 13, 2025
@github-actions github-actions bot changed the title Attribute to map DDL queried from Snowflake SNOW-1926956: Attribute to map DDL queried from Snowflake Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant