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

Chetan Bhat updated SPARK-34179:
--------------------------------
    Description: 
*array_sort examples provided in 
[https://spark.apache.org/docs/latest/api/sql/index.html#array_sort] link not 
working.*

 

SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right then 
-1 when left > right then 1 else 0 end); –> *this example when executed in 
spark-sql fails with below error*

SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right then 
-1 when left > right then 1 else 0 end);
 Error in query:
 extraneous input '->' expecting \{')', ','}(line 1, pos 48)

== SQL ==
 SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right then 
-1 when left > right then 1 else 0 end)
 ------------------------------------------------^^^

spark-sql>

 

SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left is 
null and right is null then 0 when left is null then -1 when right is null then 
1 when left < right then 1 when left > right then -1 else 0 end);  --> *This 
example when executed fails with below error*

 

spark-sql>
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 > SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left 
 > is null and right is null then 0 when left is null then -1 when right is 
 > null then 1 when left < right then 1 when left > right then -1 else 0 end);
 Error in query:
 extraneous input '->' expecting \{')', ','}(line 1, pos 57)

== SQL ==
 SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left is 
null and right is null then 0 when left is null then -1 when right is null then 
1 when left < right then 1 when left > right then -1 else 0 end)
 ---------------------------------------------------------^^^

spark-sql>

 

 

Issue 2 :-

 

 

  was:
*array_sort examples provided in 
https://spark.apache.org/docs/latest/api/sql/index.html#array_sort link not 
working.*

 

SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right then 
-1 when left > right then 1 else 0 end); –> *this example when executed in 
spark-sql fails with below error*

SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right then 
-1 when left > right then 1 else 0 end);
Error in query:
extraneous input '->' expecting \{')', ','}(line 1, pos 48)

== SQL ==
SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right then 
-1 when left > right then 1 else 0 end)
------------------------------------------------^^^

spark-sql>

 

SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left is 
null and right is null then 0 when left is null then -1 when right is null then 
1 when left < right then 1 when left > right then -1 else 0 end);  --> *This 
example when executed fails with below error*

 

spark-sql>
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 > SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left 
 > is null and right is null then 0 when left is null then -1 when right is 
 > null then 1 when left < right then 1 when left > right then -1 else 0 end);
Error in query:
extraneous input '->' expecting \{')', ','}(line 1, pos 57)

== SQL ==
SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left is 
null and right is null then 0 when left is null then -1 when right is null then 
1 when left < right then 1 when left > right then -1 else 0 end)
---------------------------------------------------------^^^

spark-sql>

 

 


> examples provided in https://spark.apache.org/docs/latest/api/sql/index.html  
>  link not working
> -----------------------------------------------------------------------------------------------
>
>                 Key: SPARK-34179
>                 URL: https://issues.apache.org/jira/browse/SPARK-34179
>             Project: Spark
>          Issue Type: Bug
>          Components: docs
>    Affects Versions: 2.4.5
>         Environment: Spark 2.4.5
>            Reporter: Chetan Bhat
>            Priority: Minor
>
> *array_sort examples provided in 
> [https://spark.apache.org/docs/latest/api/sql/index.html#array_sort] link not 
> working.*
>  
> SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right 
> then -1 when left > right then 1 else 0 end); –> *this example when executed 
> in spark-sql fails with below error*
> SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right 
> then -1 when left > right then 1 else 0 end);
>  Error in query:
>  extraneous input '->' expecting \{')', ','}(line 1, pos 48)
> == SQL ==
>  SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right 
> then -1 when left > right then 1 else 0 end)
>  ------------------------------------------------^^^
> spark-sql>
>  
> SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left is 
> null and right is null then 0 when left is null then -1 when right is null 
> then 1 when left < right then 1 when left > right then -1 else 0 end);  --> 
> *This example when executed fails with below error*
>  
> spark-sql>
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  > SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left 
> is null and right is null then 0 when left is null then -1 when right is null 
> then 1 when left < right then 1 when left > right then -1 else 0 end);
>  Error in query:
>  extraneous input '->' expecting \{')', ','}(line 1, pos 57)
> == SQL ==
>  SELECT array_sort(array('bc', 'ab', 'dc'), (left, right) -> case when left 
> is null and right is null then 0 when left is null then -1 when right is null 
> then 1 when left < right then 1 when left > right then -1 else 0 end)
>  ---------------------------------------------------------^^^
> spark-sql>
>  
>  
> Issue 2 :-
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to