You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yuming Wang (JIRA)" <ji...@apache.org> on 2017/06/08 08:43:18 UTC

[jira] [Resolved] (SPARK-19963) create view from select Fails when nullif() is used

     [ https://issues.apache.org/jira/browse/SPARK-19963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuming Wang resolved SPARK-19963.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.2.0

Marked as fix.

> create view from select Fails when nullif() is used
> ---------------------------------------------------
>
>                 Key: SPARK-19963
>                 URL: https://issues.apache.org/jira/browse/SPARK-19963
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: Jay Danielsen
>            Priority: Minor
>             Fix For: 2.2.0
>
>
> Test Case : Any valid query using nullif.
> SELECT nullif(mycol,0) from mytable;
> Create view FAILS when nullif used in select.
> CREATE VIEW my_view as
> SELECT nullif(mycol,0) from mytable;
> Error: java.lang.RuntimeException: Failed to analyze the canonicalized SQL: ...
> I can refactor with CASE statement and create view successfully.
> CREATE VIEW my_view as
> SELECT CASE WHEN mycol = 0 THEN NULL ELSE mycol END mycol from mytable;



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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