[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553989#comment-15553989 ] Todd Nemet commented on SPARK-17818: Oh man, you are right. I cut and pasted and wrong part of my terminal session. I meant to put this in: {code} 0: jdbc:hive2://localhost:10016/> select NULL; Error: java.lang.IllegalArgumentException: Unrecognized type name: null (state=,code=0) {code} No biggie, just the entire point of the JIRA... > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > Fix For: 2.0.2 > > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553798#comment-15553798 ] Dongjoon Hyun commented on SPARK-17818: --- Ur, Todd. Could you look at your JIRA description again? The following is what I mentioned as `your example`. I don't believe that is a valid one. What I wanted is answering your request. :) > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: {code} 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); Error: org.apache.spark.sql.catalyst.parser.ParseException: DataType null() is not supported.(line 1, pos 20) {cde} > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > Fix For: 2.0.2 > > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553792#comment-15553792 ] Todd Nemet commented on SPARK-17818: I'm referring to your example above of SELECT CAST(NULL AS NULL) which I don't believe is valid SQL. SELECT NULL definitely is, and that's what needs to work. I cast NULL as an INT and a STRING, but not a NULL. Again, thanks for the help. > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > Fix For: 2.0.2 > > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553785#comment-15553785 ] Dongjoon Hyun commented on SPARK-17818: --- Thanks. > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > Fix For: 2.0.2 > > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553781#comment-15553781 ] Dongjoon Hyun commented on SPARK-17818: --- It's your example, [~tnemet]. :) > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > Fix For: 2.0.2 > > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553779#comment-15553779 ] Todd Nemet commented on SPARK-17818: Definitely a duplicate. I did a search before filing - not sure how I missed it. Closing. Thanks for your help with this. > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553777#comment-15553777 ] Todd Nemet commented on SPARK-17818: I don't believe you can CAST AS NULL in SQL since NullType isn't exposed at the SQL layer. Not an expert though. > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553745#comment-15553745 ] Dongjoon Hyun commented on SPARK-17818: --- Could you close this issue as 'Duplicate' of SPARK-17112 if you agree with this? > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553738#comment-15553738 ] Dongjoon Hyun commented on SPARK-17818: --- Now, everything seems to work. BTW, the first example is not a regression. Spark 1.6.2 also works like the following. {code} bin/beeline -u jdbc:hive2://localhost:1 -e "select cast(NULL as NULL)" Connecting to jdbc:hive2://localhost:1 log4j:WARN No appenders could be found for logger (org.apache.hive.jdbc.Utils). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Connected to: Spark SQL (version 1.6.2) Driver: Hive JDBC (version 1.2.1.spark2) Transaction isolation: TRANSACTION_REPEATABLE_READ Error: org.apache.spark.sql.AnalysisException: cannot recognize input near 'NULL' ')' '' in primitive type specification; line 1 pos 20 (state=,code=0) Closing: 0: jdbc:hive2://localhost:1 {code} > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553732#comment-15553732 ] Dongjoon Hyun commented on SPARK-17818: --- {code} Connected to: Spark SQL (version 2.1.0-SNAPSHOT) Driver: Hive JDBC (version 1.2.1) Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2://localhost:1> select null; +---+--+ | NULL | +---+--+ | NULL | +---+--+ 1 row selected (0.148 seconds) 0: jdbc:hive2://localhost:1> select null=null; ++--+ | (NULL = NULL) | ++--+ | NULL | ++--+ 1 row selected (0.099 seconds) 0: jdbc:hive2://localhost:1> select cast(NULL as int); ++--+ | CAST(NULL AS INT) | ++--+ | NULL | ++--+ 1 row selected (0.084 seconds) 0: jdbc:hive2://localhost:1> select cast(NULL as string); +---+--+ | CAST(NULL AS STRING) | +---+--+ | NULL | +---+--+ 1 row selected (0.076 seconds) {code} > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-17818) Cannot SELECT NULL
[ https://issues.apache.org/jira/browse/SPARK-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15553726#comment-15553726 ] Dongjoon Hyun commented on SPARK-17818: --- Hi, [~tnemet]. It looks similar with SPARK-17112 . I'll check in the current master again. > Cannot SELECT NULL > -- > > Key: SPARK-17818 > URL: https://issues.apache.org/jira/browse/SPARK-17818 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.0, 2.0.1 >Reporter: Todd Nemet > > When connecting to Spark SQL via JDBC/thriftserver, running `SELECT NULL` > returns this error: > {code} > 0: jdbc:hive2://localhost:10016/> select cast(NULL as NULL); > Error: org.apache.spark.sql.catalyst.parser.ParseException: > DataType null() is not supported.(line 1, pos 20) > {code} > This is a regression from Spark 1.x/Hive QL compatibility. In Spark 1.5.2, > The same query returns NULL: > {code} > 0: jdbc:hive2://localhost:10015/> select null; > +---+--+ > | _c0 | > +---+--+ > | NULL | > +---+--+ > 1 row selected (0.658 seconds) > {code} > I can select expressions that evaluate to NULL or CAST NULL to different > types: > {code} > 0: jdbc:hive2://localhost:10016/> select null=null > 0: jdbc:hive2://localhost:10016/> ; > ++--+ > | (NULL = NULL) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.69 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as int); > ++--+ > | CAST(NULL AS INT) | > ++--+ > | NULL | > ++--+ > 1 row selected (0.676 seconds) > 0: jdbc:hive2://localhost:10016/> select cast (NULL as string); > +---+--+ > | CAST(NULL AS STRING) | > +---+--+ > | NULL | > +---+--+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org