You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ryan Blue (JIRA)" <ji...@apache.org> on 2016/11/08 22:57:00 UTC

[jira] [Created] (SPARK-18368) Regular expression replace throws NullPointerException when serialized

Ryan Blue created SPARK-18368:
---------------------------------

             Summary: Regular expression replace throws NullPointerException when serialized
                 Key: SPARK-18368
                 URL: https://issues.apache.org/jira/browse/SPARK-18368
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.0.1, 2.1.0
            Reporter: Ryan Blue


This query fails with a [NullPointerException on line 247|https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala#L247]:

{code}
SELECT POSEXPLODE(SPLIT(REGEXP_REPLACE(ranks, '[\\[ \\]]', ''), ',')) AS (rank, col0)
FROM table;
{code}

The problem is that POSEXPLODE is causing the REGEXP_REPLACE to be serialized after it is instantiated. The null value is a transient StringBuffer that should hold the result. The fix is to make the result value lazy.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org