snowflake-cloud-data-platform

“Numeric value '' is not recognized” - what column?

会有一股神秘感。 提交于 2021-02-10 15:49:47
问题 I am trying to insert data from a staging table into the master table. The table has nearly 300 columns, and is a mix of data-typed Varchars, Integers, Decimals, Dates, etc. Snowflake gives the unhelpful error message of " Numeric value '' is not recognized " I have gone through and cut out various parts of the query to try and isolate where it is coming from. After several hours and cutting every column, it is still happening. Does anyone know of a Snowflake diagnostic query (like Redshift

To convert date in Snowflake

╄→尐↘猪︶ㄣ 提交于 2021-02-10 14:32:41
问题 I am trying to work with the date (timestamp to be precise) and getting into trouble. My requirement is below. I have a stage table where the data is stored as JSON in a Variant Column and the data looks like below in that column. { “message_body”: { “campus_code”: “TEST”, “campus_name”: “TEST”, “event_type”: “TEST”, “location_code”: “A00000”, “location_name”: “TEST”, “order”: { “credit_total”: 0, “app_version”: “1.0.9”, “asap”: 1, “order_datetime”: “2021-01-08 18:19:34” } “timezone_offset

To convert date in Snowflake

允我心安 提交于 2021-02-10 14:32:22
问题 I am trying to work with the date (timestamp to be precise) and getting into trouble. My requirement is below. I have a stage table where the data is stored as JSON in a Variant Column and the data looks like below in that column. { “message_body”: { “campus_code”: “TEST”, “campus_name”: “TEST”, “event_type”: “TEST”, “location_code”: “A00000”, “location_name”: “TEST”, “order”: { “credit_total”: 0, “app_version”: “1.0.9”, “asap”: 1, “order_datetime”: “2021-01-08 18:19:34” } “timezone_offset

Passing Parameter from SSRS dataset to Snowflake

拟墨画扇 提交于 2021-02-10 14:06:03
问题 Is there a way to pass parameters from SSRS dataset to Snowflake.Previously I am connecting SSRS to SqlServer DB and passing parameter as @client_id.I want to move queries to run on snowflake.But i don't know how to pass parameter to query. When I use standard parameters against Snowflake I get syntax error @client_id is unexpected 来源: https://stackoverflow.com/questions/59295902/passing-parameter-from-ssrs-dataset-to-snowflake

Snowflake stored procedure variable binding error

旧城冷巷雨未停 提交于 2021-02-10 08:43:14
问题 I am trying to create and execute a simple Snowflake stored procedure which takes an input argument and creates a stage. However, when I try to call the procedure it throws ERROR: invalid value [:] for parameter create or replace procedure raw.test.create_stage_test(PARM_URL string) returns string language javascript execute as owner as $$ var cmd = `create or replace stage raw.test.agency_type_test url =:1 file_format = (type = json) credentials = (aws_role = 'arn:aws:iam::myrole');` var sql

TRY_TO_DATE with pattern?

拜拜、爱过 提交于 2021-02-10 05:32:33
问题 Snowflake has a TO_DATE(string, pattern) function, but currently has no TRY_TO_DATE version of the function with the same signature. While we've built a javascript parsing function as a workaround, it has abysmal performance due to its complexity and the fact that it's performance could never measure against a real native function. Is there a roadmap for the availability of such native function? Is there a community voting board to prioritize such function? 回答1: Although there is not a

TRY_TO_DATE with pattern?

被刻印的时光 ゝ 提交于 2021-02-10 05:32:09
问题 Snowflake has a TO_DATE(string, pattern) function, but currently has no TRY_TO_DATE version of the function with the same signature. While we've built a javascript parsing function as a workaround, it has abysmal performance due to its complexity and the fact that it's performance could never measure against a real native function. Is there a roadmap for the availability of such native function? Is there a community voting board to prioritize such function? 回答1: Although there is not a

TRY_TO_DATE with pattern?

依然范特西╮ 提交于 2021-02-10 05:31:23
问题 Snowflake has a TO_DATE(string, pattern) function, but currently has no TRY_TO_DATE version of the function with the same signature. While we've built a javascript parsing function as a workaround, it has abysmal performance due to its complexity and the fact that it's performance could never measure against a real native function. Is there a roadmap for the availability of such native function? Is there a community voting board to prioritize such function? 回答1: Although there is not a

Snowflake merge object / json

五迷三道 提交于 2021-02-08 16:55:47
问题 is there any way how to merge 2 objects in snowflake? I found https://docs.snowflake.net/manuals/sql-reference/functions/object_insert.html, but that only sets/updates one key at a time. I want to merge 2 objects (something like Object.assign() in js). Also tried to find workaround by converting to array, concatenating and construction object from that array, but did not manage to make it work. Thanks! 回答1: Snowflake does not have a built-in function like that, but it's trivial to do using,

generate_series() equivalent in snowflake

◇◆丶佛笑我妖孽 提交于 2021-02-08 15:16:32
问题 I'm trying to find the snowflake equivalent of generate_series() (the PostgreSQL syntax). SELECT generate_series(timestamp '2017-11-01', CURRENT_DATE, '1 day') 回答1: This is how I was able to generate a series of dates in Snowflake. I set row count to 1095 to get 3 years worth of dates, you can of course change that to whatever suits your use case select dateadd(day, '-' || seq4(), current_date()) as dte from table (generator(rowcount => 1095)) Originally found here EDIT: This solution is not