Skip to content
Advertisement

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.

Advertisement

Answer

I couldn’t find any way to perform assertions in Snowflake, so I ended up building my own using a JavaScript UDF:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement