Skip to content

Instantly share code, notes, and snippets.

@nagoodman
Created September 16, 2020 14:37
Show Gist options
  • Save nagoodman/4603b87d7f8960899937eb88d127431f to your computer and use it in GitHub Desktop.
Save nagoodman/4603b87d7f8960899937eb88d127431f to your computer and use it in GitHub Desktop.
Happy SNOW day!
* SnowSQL * v1.1.86
Type SQL statements or !help
SNOWACE#NGOODMAN_WH@HAPPY_IPO_DAY.PUBLIC>select * from table(happy_snow_day());
+---------------------------------------------------------------------------------+
| HAPPY_IPO_DAY_SEPTEMBER_16_2020 |
|---------------------------------------------------------------------------------|
| ███╗ ██╗██╗ ██╗███████╗███████╗ ███████╗███╗ ██╗ ██████╗ ██╗ ██╗ |
| ████╗ ██║╚██╗ ██╔╝██╔════╝██╔════╝██╗ ██╔════╝████╗ ██║██╔═══██╗██║ ██║ |
| ██╔██╗ ██║ ╚████╔╝ ███████╗█████╗ ╚═╝ ███████╗██╔██╗ ██║██║ ██║██║ █╗ ██║ |
| ██║╚██╗██║ ╚██╔╝ ╚════██║██╔══╝ ██╗ ╚════██║██║╚██╗██║██║ ██║██║███╗██║ |
| ██║ ╚████║ ██║ ███████║███████╗╚═╝ ███████║██║ ╚████║╚██████╔╝╚███╔███╔╝ |
| ╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚══════╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚══╝╚══╝ |
| |
+---------------------------------------------------------------------------------+
7 Row(s) produced. Time Elapsed: 1.524s
CREATE OR REPLACE FUNCTION "HAPPY_SNOW_DAY"()
RETURNS TABLE (HAPPY_IPO_DAY_SEPTEMBER_16_2020 varchar)
LANGUAGE JAVASCRIPT
AS
$$
{
finalize: function f(rowWriter, context) {
var result = [];
result.push( "███╗ ██╗██╗ ██╗███████╗███████╗ ███████╗███╗ ██╗ ██████╗ ██╗ ██╗");
result.push( "████╗ ██║╚██╗ ██╔╝██╔════╝██╔════╝██╗ ██╔════╝████╗ ██║██╔═══██╗██║ ██║");
result.push( "██╔██╗ ██║ ╚████╔╝ ███████╗█████╗ ╚═╝ ███████╗██╔██╗ ██║██║ ██║██║ █╗ ██║");
result.push( "██║╚██╗██║ ╚██╔╝ ╚════██║██╔══╝ ██╗ ╚════██║██║╚██╗██║██║ ██║██║███╗██║");
result.push( "██║ ╚████║ ██║ ███████║███████╗╚═╝ ███████║██║ ╚████║╚██████╔╝╚███╔███╔╝");
result.push( "╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚══════╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚══╝╚══╝ ");
result.push( " ");
result.forEach (function (x) { rowWriter.writeRow({HAPPY_IPO_DAY_SEPTEMBER_16_2020:x}) });
},
processRow: function f(row, rowWriter, context) {
}
}
$$
;
select * from table(happy_snow_day());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment