title: Snowflake vs Spark - Insufficient privileges to operate on schema
body: <p>I've created a new free standard snowflake account "xxxxx" I was able to access the default database, schema, and the tables from Snowflake web UI.</p>
  
  <p>And tried connecting to Snowflake from Spark</p>
  
  <pre><code>val spark = SparkSession.builder()
      .master("local[1]")
      .appName("SparkByExamples.com")
      .getOrCreate();
  
    var sfOptions = Map(
      "sfURL" -&gt; "https://xxxxxx.us-east-1.snowflakecomputing.com/",
      "sfAccount" -&gt; "xxxxxx",
      "sfUser" -&gt; "xxxxx",
      "sfPassword" -&gt; "#########",
      "sfDatabase" -&gt; "snowflake_sample_data",
      "sfSchema" -&gt; "tpch_sf1"
    )
    val df: DataFrame = spark.read
      .format("net.snowflake.spark.snowflake")
      .options(sfOptions)
      .option("query", "SELECT l_returnflag,l_linestatus,sum(l_quantity) as sum_qty FROM lineitem GROUP BY l_returnflag,l_linestatus")
      .load()
  </code></pre>
  
  <p>After running, getting "Insufficient privileges to operate on schema 'TPCH_SF1' " error. Could someone please help.</p>
  
  <p>20/02/23 19:35:12 WARN SnowflakeStrategy: Pushdown failed :SQL access control error:
  Insufficient privileges to operate on schema 'TPCH_SF1'
  20/02/23 19:35:13 INFO SnowflakeSQLStatement: Spark Connector Master: execute query with bind variable: create  temporary stage if not exists identifier(?) 
  20/02/23 19:35:13 WARN SnowflakeStrategy: Pushdown failed :SQL access control error:
  Insufficient privileges to operate on schema 'TPCH_SF1'
  20/02/23 19:35:14 INFO SnowflakeSQLStatement: Spark Connector Master: execute query with bind variable: create  temporary stage if not exists identifier(?) 
  Exception in thread "main" net.snowflake.client.jdbc.SnowflakeSQLException: SQL access control error:
  Insufficient privileges to operate on schema 'TPCH_SF1'
      at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)
      at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)
      at net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)
      at net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)
      at net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)
      at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)
      at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)
      at net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)</p>