szymon_dybczak
Esteemed Contributor III

Hi @Ramana ,

Yep, RDD API is not supported on Serveless

szymon_dybczak_0-1757519217789.png

As a workaround you can obtain number of partitions in following way - using spark_partiton_id and then counting distinct occurance of each id

from pyspark.sql.functions  import spark_partition_id, countDistinct

df = spark.read.table("workspace.default.product_dimension")

display((
    df.withColumn("partitionid",spark_partition_id())
        .select("partitionid")                
        .agg(countDistinct("partitionid"))
))