# Snowflake -Pyspark numPartitions support

**URL:** <https://discuss.elastic.co/t/snowflake-pyspark-numpartitions-support/329203>\
**Category:** Elastic Security\
**Created:** [April 3, 2023, 11:47am UTC](https://discuss.elastic.co/t/snowflake-pyspark-numpartitions-support/329203 "2023-04-03T11:47:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![digitalspecz](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@digitalspecz](https://discuss.elastic.co/u/digitalspecz)\
**Post date:** [April 3, 2023, 11:47am UTC](https://discuss.elastic.co/t/snowflake-pyspark-numpartitions-support/329203/1 "2023-04-03T11:47:20Z")

</div>

We're attempting to run the snowflake query with Pyspark, and we've set numPartitions to 10 and submitted a spark query. However, when I checked the Snowflake History tab. As far as I can tell, only one query is being executed rather than ten.

Is the numPartitions clause supported by snowflake -Spark? The sample code we used to execute is shown below.

```auto
sfOptions = dict()
sfOptions["url"] ="jdbc:snowflake:// **************.privatelink.snowflakecomputing.com"
sfOptions["user"] ="**01d"
sfOptions["private_key_file"] = key_file
sfOptions["private_key_file_pwd"] = key_passphrase
sfOptions["db"] ="**_DB"
sfOptions["warehouse"] =" **** _WHS"
sfOptions["schema"] ="***_SHR"
sfOptions["role"] ="**_ROLE"
sfOptions["numPartitions"]="10"
sfOptions["partitionColumn"] = "***_TRANS_ID"
sfOptions["lowerBound"] = lowerbound
sfOptions["upperBound"] = upperbound

print(sfOptions)

df = spark.read.format('jdbc') \
    .options(**sfOptions) \
    .option("query", "select * from ***_shr.SPRK_TST as f") \
    .load()

```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 3, 2023, 11:53am UTC](https://discuss.elastic.co/t/snowflake-pyspark-numpartitions-support/329203/2 "2023-04-03T11:53:32Z")

</div>

How is this related to Elasticsearch or the Elastic Stack?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 4, 2023, 1:30am UTC](https://discuss.elastic.co/t/snowflake-pyspark-numpartitions-support/329203/3 "2023-04-04T01:30:14Z")

</div>

Welcome to our community! 😃

As Christian mentions, this isn't related to the Elastic Stack and we cannot help sorry. You will need to find a snowflake community and ask there.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 2, 2023, 1:30am UTC](https://discuss.elastic.co/t/snowflake-pyspark-numpartitions-support/329203/4 "2023-05-02T01:30:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
