You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Herman van Hovell (JIRA)" <ji...@apache.org> on 2016/09/07 11:17:20 UTC

[jira] [Commented] (SPARK-17429) spark sql length(1) return error

    [ https://issues.apache.org/jira/browse/SPARK-17429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15470329#comment-15470329 ] 

Herman van Hovell commented on SPARK-17429:
-------------------------------------------

TBH this seems like something which is very debatable. Why would anyone want this?

You can fix this by adding {{ImplicitCastInputTypes}} to the {{Length}} expression.

> spark sql length(1) return error
> --------------------------------
>
>                 Key: SPARK-17429
>                 URL: https://issues.apache.org/jira/browse/SPARK-17429
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.6.2
>            Reporter: cen yuhai
>
> select length(11);
> select length(2.0);
> these sql will return errors, but hive is ok.
> Error in query: cannot resolve 'length(11)' due to data type mismatch: argument 1 requires (string or binary) type, however, '11' is of int type.; line 1 pos 14
> Error in query: cannot resolve 'length(2.0)' due to data type mismatch: argument 1 requires (string or binary) type, however, '2.0' is of double type.; line 1 pos 14



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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