Open countergram opened 5 years ago
I was about to open a separate issue for configuring the timezone just like the snowflake python api client.
Would that come under this same issue @sfc-gh-jfan ? Or should I open a new issue specifically for timezone support?
I'm also curious about is there a set time to add supports to QUERY_TAG
? We do hope to use tagging for some internal efforts.
hi; thank you for submitting this issue. this has been brought to attention of the dev team to look at and prioritise if found feasible. thank you for bearing with us !
Please! it's highly needed!
@sfc-gh-dszmolka This is really being a blocker for us here as well. We have our application in node, but our queries require the week_start
parameter value change. I understand that it is possible to do it in python
thank you for letting us know about the business impact of the lack of capability. i now relayed it again to the driver team.
please note, we absolutely cannot commit any timelines to any enhancement in the open-sourced driver - however if you are a Snowflake customer, you do have a quite powerful option at your disposal, and that's letting your account executive know of how important this is for you. they can usually give some traction to requests. i'm not very happy to having relay this message, but wanted to set the expectations here.
but as mentioned, i again reiterated with the team how important this request is, hopefully they can put it on the timeline in the foreseeable future.
a possible workaround which might help getting some of you unblocked, or at least something to consider. with a fairly recent version of the driver (1.6.18) we now support multi-statement queries. Documentation can be found here.
The idea here for this workaround is to:
ALTER SESSION SET <session_parameter> = <desired_value>
This way, the queries should run with the desired session parameter, which is not yet supported directly in the connection string. Should be applicable for any session parameter, not just QUERY_TAG
for which this Issue was originally opened
@sfc-gh-dszmolka thanks for the suggestion but i'm wondering will it create additional credit cost to issue a new query every time? I also tried multi-statement queries but somehow I cannot get it work since it was complaining "stmt.hasNext()" and "stmt.NextResult()" don't exist on type. For more context I am using snowflake-sdk@1.6.20
and @types/snowflake-sdk@1.6.12
since snowflake-sdk lacks official typescript typings support, which is such a pity.
@hanliao this is a very valid question. I don't believe the costs should increase or at least not significantly, since the extra queries (ALTER SESSION..
) introduced as the workaround to not use compute (warehouse) at all, but the cloud services layer instead. Also the latter is not billed unless it exceeds the 10% of the compute usage you are already using, see How Are Costs Incurred?
Of course the best way is to test it e.g. for a day or week and see how it goes for you.
About the multi-statement queries example: the examples (without typings support, so the core snowflake-sdk) do work, both of them, tested them myself. How to tackle them with @types/snowflake-sdk
, perhaps the maintainers or the users of that can help. Perhaps it needs adjustments, but I'm not sure.
@sfc-gh-dszmolka right, for multi-statement queries, what I mean is that this package doesn't have native typings support so I have to either writing my own typings files and maintain them, or use an existing third party typings package which lacks Snowflake support, since our service uses TypeScript.
Regarding query_tags
passing them in as parameter
in a query option will work. See https://github.com/snowflakedb/snowflake-connector-nodejs/blob/ef1a7d70879ea4d2b5a2f54d050293ad9938e1a1/lib/connection/statement.js#L1229 and the subsequent API POST request in the code
The JDBC docs note that any session parameter can be included in a connection string: https://docs.snowflake.net/manuals/user-guide/jdbc-configure.html#other-parameters
This would be useful in the Node.js connector as well. E.g. we try to keep query_tags on as many of our workloads as possible and would would like to make it part of all of our connection params by default.