snowflake-connector-net icon indicating copy to clipboard operation
snowflake-connector-net copied to clipboard

SNOW-1926956: Attribute to map DDL queried from Snowflake

Open nh-tu-z opened this issue 2 weeks ago • 0 comments

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 avatar Feb 13 '25 09:02 nh-tu-z