Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-3415

Using sys.stderr in pyspark results in error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.2, 1.1.0
    • 1.2.0
    • PySpark

    Description

      Using sys.stderr in pyspark results in:
      File "/home/spark-1.1/dist/python/pyspark/cloudpickle.py", line 660, in save_file
      from ..transport.adapter import SerializingAdapter
      ValueError: Attempted relative import beyond toplevel package

      Code to reproduce (copy paste the code in pyspark):

      import sys

      class TestClass(object):
      def _init_(self, out = sys.stderr):
      self.out = out
      def getOne(self):
      return 'one'

      def f():
      print type(t)
      return 'ok'

      t = TestClass()
      a = [ 1 , 2, 3, 4, 5 ]
      b = sc.parallelize(a)
      b.map(lambda x: f()).first()

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wardviaene Ward Viaene
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: