Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2025 12:24 PM
Hi @arjunraja_azure , Below is the best version for your code which will avoid failure:
from pyspark.sql.functions import max
df = spark.read.table('workspace.default.emp')
df1 = df.agg(max('sal')) # Aggregate in separate step and also avoid caching before execution
df1.show() # Use show() instead of display()
If you still see this in Spark Connect + serverless, switch to a standard compute cluster, and it should resolve.