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

Reply via email to