I found usefull JS function that I want to implement into snowflake’s UDF in order to move complex computation to the dwh. http://trentrichardson.com/2010/04/06/compute-linear-regressions-in-javascript/ Attempt to rework above as SQL procedure: Execution fails with error: SQL compilation error: Invalid identifier which is odd since procedure has been created. Answer You’re almost there. To pass an array, try using ARRAY_CONSTRUCT or PARSE_JSON,
Tag: snowflake-cloud-data-platform
Difference between x = null vs. x IS NULL
In Snowflake, what is the difference between x = NULL and x IS NULL in a condition expression? It seems empirically that x IS NULL is what I want when I want to find rows where some column is blank. I ask because x = NULL is treated as valid syntax and I am curious whether there’s a different application
My last upload of data, the timestamp is off by 2 days, how can I fix it?
So I have a table in Snowflake that I uploaded and made the mistake of uploading some data with the incorrect datetime. The first few columns of the table are different json results, that correspond to the date they were fetched. Example: The INSERT was pretty straight forward, I staged the file and inserted it into an already created table.
Snowflake BIT datatype
i have BIT data type in sql server and i am trying to migrate it to snowflake but i am not able get the data into snowflake properly 0 goes as 0 but 1 goes into as 255 when i DT_UI1 data type to output the column in sql server can anybody help me how to send bit data type
Custom SQL for quarter count starting from previous month
I need to create a custom quarter calculator to start always from previous month no matter month, year we are at and count back to get quarter. Previous year wuarters are to be numbered 5, 6 etc So the goal is to move quarter grouping one month back. Assume we run query on December 11th, result should be: YEAR MNTH
Snowflake SQL, how to lookahead until a certain occurrence of a value
Below is a sample of the text that I am working with. — info1: * val: “A” — Type: * answers: * – ! * val: “B” * – ! * val: “C” — info2: * val: “D” — …
COPY INTO Snowflake Table with Extra Columns
I’ve got a table defined in Snowflake as: GLPCT and a file that looks like this: GLPCT.csv example: My copy into command looks like this: Problem Snowflake is throwing an error due to a column number mismatch. How can I get Snowflake to ignore the column that isn’t present in the file and not throw an error? I can move
avoiding write conflicts while re-sorting a table
I have a large table that I need to re-sort periodically. I am partly basing this on a suggestion I was given to stay away from using cluster keys since I am inserting data ordered differently (by time) from how I need it clustered (by ID), and that can cause re-clustering to get a little out of control. Since I
Assertions in Snowflake
Is there a way to perform assertions in Snowflake? Basically, I’m trying to do a bit of testing/TDD, and I’d like a mechanism similar to assertions in every other language: If the assertion succeeds, it returns true (and/or prints a success message). If the assertion fails, an exception is raised. Answer I couldn’t find any way to perform assertions in
Easter / Good Friday for Sowflake Date Dim
Further Evolved : The code below satisfies what was wanted in earlier comments [if you follow history] :), my new question right below is stumping me. Question: I want to have ‘Week_Of_Year’ Adjust …