"Stream is closed" error, but program finishes executing correctly
See original GitHub issueI’m running a .NET Spark app for batch processing with a selection of GitHub projects data. My program runs as expected up through making a Spark Sql call:
// ...Code creating spark session, reading into data frame, doing some sorting...
// Then move on to creating UDF, SQL call:
spark.Udf().Register<string, bool>("MyUDF", (date) => DateTest(date));
cleanedProjects.CreateOrReplaceTempView("dateView");
DataFrame dateDf = spark.Sql("SELECT *, MyUDF(dateView.updated_at) AS datebefore FROM dateView");
After the Sql query, I perform a Filter() and Drop() for some final processing:
DataFrame filteredDates = dateDf.Filter(dateDf["datebefore"] == true);
filteredDates.Show();
filteredDates.Drop("datebefore").Show();
After I Show() each of these modified DataFrames, I get the error: ProcessStream() failed with exception: System.ArgumentException: The stream is closed.
However, even with that error, both calls to Show() do execute successfully and see the correct output.
Why might I be receiving this error (twice)? Since I get the correct output, the error doesn’t seem to be affecting anything?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
"Stream Closed" Error caused apparently by multiple submits
My java code works most of the time, but sometimes randomly I get the Stream Closed exception. I suspect this may be if...
Read more >Processing Error
StreamClosedError: Stream is closed During handling of the above exception, another exception occurred: Traceback (most recent call last): File ...
Read more >java.io.IOException: Stream is closed! Error in HDInsight ...
I have been in touch with the development team regarding this error I have been getting when running a command to write a...
Read more >1014393 – Stream closed exception in resetStream on IBM ...
IOException: Stream closed` error when using IBM JDK 16, 17 or `xerces:xercesImpl:2.9.1-redhat-x` (provided by EAP 6) as a dependency in a resteasy 2.3.6....
Read more >The try-with-resources Statement - Exceptions
A resource is an object that must be closed after the program is finished with it. The try -with-resources statement ensures that each...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
I got a similar issue with Spark .Net 1.0 but the issue is only when I am using Udf functions. The Show method shows the correct results.
Is it something that I should worry about? or is just some cleaning exceptions because the log is showing that the “RunSimpleWorker() finished successfully” and also “DotnetRunner: .NET application exited successfully”.
Java version 8 Spark 2.4.1 or Spark 3.0 .Net Core 3.1 Microsoft.Spark.Worker-1.0.0
The udf functions are
Not sure, but I don’t think show would cause this error. Could be Udf related issue.