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

Broken data returned to PySpark dataframe if any large numbers used in Scala land

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.3.0
    • 1.4.0
    • PySpark, SQL
    • None
    • Spark 1.3, Python 2.7.6, Scala 2.10

    Description

      When trying to access data stored in a Parquet file with an INT96 column (read: TimestampType() encoded for Impala), if the INT96 column is included in the fetched data, other, smaller numeric types come back broken.

      In [1]: sql.parquetFile("/Users/hornairs/Downloads/part-r-00001.parquet").select('int_col', 'long_col').first()
      Out[1]: Row(int_col=Decimal('1'), long_col=Decimal('10'))
      
      In [2]: sql.parquetFile("/Users/hornairs/Downloads/part-r-00001.parquet").first()
      Out[2]: Row(long_col={u'__class__': u'scala.runtime.BoxedUnit'}, str_col=u'Hello!', int_col={u'__class__': u'scala.runtime.BoxedUnit'}, date_col=datetime.datetime(1, 12, 31, 19, 0, tzinfo=<DstTzInfo 'America/Toronto' EDT-1 day, 19:00:00 DST>))
      

      Note the {u'_class_': u'scala.runtime.BoxedUnit'} values being returned for the int_col and long_col columns in the second loop above. This only happens if I select the date_col which is stored as INT96.

      I don't know much about Scala boxing, but I assume that somehow by including numeric columns that are bigger than a machine word I trigger some different, slower execution path somewhere that boxes stuff and causes this problem.

      If anyone could give me any pointers on where to get started fixing this I'd be happy to dive in!

      Attachments

        1. part-r-00001.parquet
          1 kB
          Harry Brundage

        Issue Links

          Activity

            People

              davies Davies Liu
              airhorns Harry Brundage
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: