title: Pyspark with error self._sock.recv_into(b) socket.timeout: timed out
body: <p>The goal is to use a UDF to categorize rows. I am using pyspark on windows.</p>
  <p>Using simple functions or operations like filter appear to work.</p>
  <p>Any direction on how to address the timeout/socket failure would be helpful (see error below).</p>
  <p>There are no nulls in the data.</p>
  <pre><code>from pyspark.sql.functions import udf
  from pyspark.sql.types import IntegerType,StringType
  
  def BreakDown(arr_value):
      start_year = arr_value[0]
      start_month = arr_value[1]
      end_year = arr_value[2]
      end_month = arr_value[3]
      curr_year = arr_value[4]
      curr_month = arr_value[5]
      if   (curr_year == start_year) &amp; (curr_month &gt;= start_month) : return 1
      elif   (curr_year == end_year) &amp; (curr_month &lt;= end_month) : return 1
      elif   (curr_year &gt; start_year) &amp; (curr_year &lt; end_year) : return 1
      else: return 0
  
      
  udfBreakDown = udf(BreakDown, IntegerType())
  
  temp = temp.withColumn('include', udfBreakDown(F.struct('start_year','start_month','end_year','end_month','curr_year','curr_month')))
  </code></pre>
  <blockquote>
  <p>PythonException:    An exception was thrown from the Python worker.
  Please see the stack trace below. Traceback (most recent call last):<br />
  File
  &quot;E:\spark\spark-3.0.1-bin-hadoop2.7\python\lib\pyspark.zip\pyspark\worker.py&quot;,
  line 585, in main   File
  &quot;E:\spark\spark-3.0.1-bin-hadoop2.7\python\lib\pyspark.zip\pyspark\serializers.py&quot;,
  line 593, in read_int
  length = stream.read(4)   File &quot;C:\ProgramData\Anaconda3\lib\socket.py&quot;, line 669, in readinto
  return self._sock.recv_into(b) socket.timeout: timed out</p>
  </blockquote>