Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
tan_thiamhuat
Post Patron
Post Patron

Py4JJavaError:

Py4JJavaError: An error occurred while calling o32067.csv. : org.apache.spark.SparkException: Job aborted due to stage failure: Serialized task 182:0 was 197125878 bytes, which exceeds max allowed: spark.rpc.message.maxSize (134217728 bytes). Consider increasing spark.rpc.message.maxSize or using broadcast variables for large values.

 

Where or what settings can I do in the Python notebook to increase its size?

 

Thanks.

1 ACCEPTED SOLUTION
burakkaragoz
Super User
Super User

Hi @tan_thiamhuat ,

 

This error usually comes up in Spark when the data or objects you’re sending between nodes are too large for the default configuration. The key setting here is spark.rpc.message.maxSize, and you can bump it up directly in your notebook.

In your Python notebook, you can increase this limit by adding a cell at the top with the following:

 
%%configure -f
{
    "conf": {
        "spark.rpc.message.maxSize": "512"
    }
}

You can adjust the value (like 512) to something higher if needed, depending on your data size.

If you’re still hitting limits after increasing this, it’s often a good idea to refactor your code to avoid sending huge objects between nodes, maybe by using broadcast variables or splitting up the data.

Hope this helps! Let us know if you run into any more issues.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @tan_thiamhuat,

As we haven’t heard back from you, we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,
Vinay Pabbu

burakkaragoz
Super User
Super User

Hi @tan_thiamhuat ,

 

This error usually comes up in Spark when the data or objects you’re sending between nodes are too large for the default configuration. The key setting here is spark.rpc.message.maxSize, and you can bump it up directly in your notebook.

In your Python notebook, you can increase this limit by adding a cell at the top with the following:

 
%%configure -f
{
    "conf": {
        "spark.rpc.message.maxSize": "512"
    }
}

You can adjust the value (like 512) to something higher if needed, depending on your data size.

If you’re still hitting limits after increasing this, it’s often a good idea to refactor your code to avoid sending huge objects between nodes, maybe by using broadcast variables or splitting up the data.

Hope this helps! Let us know if you run into any more issues.

nilendraFabric
Super User
Super User

Hello @tan_thiamhuat 

 

This means a Spark job tried to send a message (such as a serialized task or data) that is larger than the configured maximum (`spark.rpc.message.maxSize`, default 128 MiB).

 

 

%%configure -f
{
"conf": {
"spark.rpc.message.maxSize": "512"
}
}

 

 

try this too

 

df = df.repartition(100) # Increase the number as needed

Helpful resources

Announcements
FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

Check out the March 2026 Fabric update to learn about new features.