Convert Unix epoch time into Snowflake Date

Many relational databases such as PostgreSQL support functions to convert Unix epoch time into a date or timestamp value. But, there are no built-in functions available in Snowflake that you can use to convert epoch time. You will have to use an alternate approach to convert epoch format. In this article, we will check how to convert Unix epoch time into the Snowflake date with some examples. Convert Unix epoch time into Snowflake Date The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1,…

Continue ReadingConvert Unix epoch time into Snowflake Date
Comments Off on Convert Unix epoch time into Snowflake Date

Snowflake Snowsql Windows System Exit Codes

In my other article, Snowflake Snowsql Exit Codes for Unix/Linux Systems, we have discussed on SnowSQL exit codes for Linux systems. But, many developers prefer to use a Windows system. In this article, we will check Snowflake Snowsql windows system exit codes and how to capture them on a Windows command prompt. Snowflake Snowsql Windows System Exit Codes SnowSQL command line interface for Snowflake is written in pure Python. You can download the msi installer and install same on your Windows machine. The configuration is pretty much similar to that…

Continue ReadingSnowflake Snowsql Windows System Exit Codes
Comments Off on Snowflake Snowsql Windows System Exit Codes

Snowflake Snowsql Exit Codes for Unix/Linux Systems

Snowsql is a command line interface written on the top of the Snowflake Python connector. The interface is a pure Python tool. Similar to many relational database tools, Snowsql also returns several exit codes. In this article, we will check Snowflake Snowsql exit codes for Unix or Linux system. Snowflake Snowsql Exit Codes The Snowsql exit code are very much important when you are working with a script such as ETL/ELT. Snowflake Snowsql exit codes provide the information about the execution status of the SQL queries or commands. SnowSQL returns…

Continue ReadingSnowflake Snowsql Exit Codes for Unix/Linux Systems
Comments Off on Snowflake Snowsql Exit Codes for Unix/Linux Systems

Snowflake rowcount and QueryID of last Executed Query

The best part about Snowflake cloud data warehouse is that it provides almost all feature that are available in other relational databases. The MPP databases such as Teradata provides the number of rows affected by the last SQL statement within its BTEQ files. Similar feature is also available within SnowSQL which is a Snowflake command line interface. In this article, we will check how get rowcount and the queryID of the last executed Snowflake query. Snowflake rowcount and QueryID of last Executed Query SnowSQL includes a set of built-in variables…

Continue ReadingSnowflake rowcount and QueryID of last Executed Query
Comments Off on Snowflake rowcount and QueryID of last Executed Query

Different Snowflake Connectors and Explanation

A Snowflake cloud data warehouse supports connection from many leading programming languages. You can use these connectors and drivers to take advantage of Snowflake's unique capabilities and features. Snowflake supports many third-party and native connectors. In this article, we will check different Snowflake connectors, drivers and third-party tools. Different Snowflake Connectors Following is a list of different connectors and drivers available in Snowflake. SnowSQL - Snowflake Command Line InterfaceSnowflake Connector for PythonSnowflake Connector for SparkGo Snowflake DriverSnowflake Connector for KafkaNode.js Driver.NET DriverJDBC DriverODBC DriverSnowCD (Connectivity Diagnostic Tool) Now, let us…

Continue ReadingDifferent Snowflake Connectors and Explanation
Comments Off on Different Snowflake Connectors and Explanation

How to Find Snowflake Table Size? – Query and Examples

Snowflake is a fully managed cloud data warehouse solution. It is fast, reliable and comes with near zero management. Similar to many relational databases, Snowflake support many system tables and views. System tables can store the important information such as records count, constraint details, etc. In this article, we will check how to find the Snowflake table size using system tables present in the information schema. How to Find Snowflake Table Size? As mentioned earlier, Snowflake maintains the important information in system tables. One of such view is TABLE_STORAGE_METRICS view.…

Continue ReadingHow to Find Snowflake Table Size? – Query and Examples
Comments Off on How to Find Snowflake Table Size? – Query and Examples

How to Execute Snowflake Commands from Shell Script?- Example

Snowflake is one of the leading cloud data warehouse providers. Snowflake provides support for many leading programming languages either by providing JDBC, ODBC drivers, or language specific connectors (Python connector). In this article, we will check how to execute Snowflake commands from shell script with some examples. Execute Snowflake Commands from Shell Script The best part about Snowflake is that it provides an interactive terminal called SnowSQL. You can use it to execute queries, create database objects and perform some of the admin tasks. You can call the SnowSQL from…

Continue ReadingHow to Execute Snowflake Commands from Shell Script?- Example
Comments Off on How to Execute Snowflake Commands from Shell Script?- Example

Export Snowflake Table Data to Local CSV format

The exporting tables to local system is one of the common requirements. You may need to export Snowflake table to analyze the data or transport it to a different team. You can export the Snowflake schema in different ways, you can use COPY command, or Snowsql command options. In this articles, we will check how to export Snowflake table data to a local CSV format. Using the COPY command may be the fastest method. But, it will unload tables to S3 location. You need to have an AWS subscription to…

Continue ReadingExport Snowflake Table Data to Local CSV format
Comments Off on Export Snowflake Table Data to Local CSV format

Execute SQL Script File using Snowflake Snowsql Variable Substitution

Snowflake allows variable substitution using -D or --variable options. The variable substitution is one of the nice feature that allows you to pass values to the script dynamically. For example, pass month value to the SQL script. Many modern day databases support the variable substitution. In this article, we will check how to a execute SQL script file using Snowflake Snowsql variable substitution with an example. Snowflake Snowsql Variable Substitution Snowsql supports the variable substitution with the help of -D or --variable option. You can use that defined variable inside…

Continue ReadingExecute SQL Script File using Snowflake Snowsql Variable Substitution
Comments Off on Execute SQL Script File using Snowflake Snowsql Variable Substitution

Access Snowflake using Snowsql without Password Prompt – Snowsql Environment Variables

There are many ways you can connect to Snowflake cloud data warehouse server. The options include Snowsql, JDBC and ODBC drivers, python connector, Spark connectors, etc. In this article, we will discuss how to access Snowflake using Snowsql without password prompt. We will also check Snowsql environment variables. Access Snowflake using Snowsql without Password Prompt Password less access is useful when your application requires to connect to Snowflake frequently. There are multiple options that you can use to achieve password less communication to Snowflake server. Export Snowflake Database Server Environmental…

Continue ReadingAccess Snowflake using Snowsql without Password Prompt – Snowsql Environment Variables
Comments Off on Access Snowflake using Snowsql without Password Prompt – Snowsql Environment Variables