anurag1007
anurag1007

Reputation: 137

snowflake is creating table even with invalid warehouse name

I am using snowflake jdbc, and trying to create a table in snowflake by passing an invalid warehouse name and its still creating the table in default warehouse.

String jdbcUrl = "jdbc:snowflake://<identifier>.snowflakecomputing.com?warehouse=invalid_warehouse&db=db&schema=schema&role=role";
        Connection conn = null;
        Statement st = null;
        try {
            conn = DriverManager.getConnection(jdbcUrl, "username", "password");
            st = conn.createStatement();
            
            ResultSet result = st.executeQuery("create table test_table_err (name varchar(32))");

Upvotes: 1

Views: 306

Answers (2)

anurag1007
anurag1007

Reputation: 137

I think there is 1 more way to validate:

Use warehouse <warehouse_name>

Upvotes: 0

Clark Perucho
Clark Perucho

Reputation: 466

Create table like any other metadata-only operations in Snowflake does NOT need a warehouse to execute.

To verify if a warehouse was used in a query, you can go to the Query History and look for CLUSTER_NUMBER or SIZE (warehouse size), if these are empty/null, it means that the warehouse was not used.

enter image description here

Try running SELECT that returns some data and see if the default warehouse will still be used

Upvotes: 3

Related Questions