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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to