You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "dharani_sugumar (JIRA)" <ji...@apache.org> on 2017/03/28 03:31:41 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=15944461#comment-15944461 ] 

dharani_sugumar commented on SPARK-19963:
-----------------------------------------

@Jay Danielsen: I'm looking into this.

> 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
>
> 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