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

Hyukjin Kwon resolved SPARK-28689.
----------------------------------
    Resolution: Invalid

> Unable to successfully issue spark sql code
> -------------------------------------------
>
>                 Key: SPARK-28689
>                 URL: https://issues.apache.org/jira/browse/SPARK-28689
>             Project: Spark
>          Issue Type: Question
>          Components: Build
>    Affects Versions: 2.4.3
>            Reporter: CARLTON PATTERSON
>            Priority: Minor
>
> Hello Community,
> My first post here, so please forgive me if I'm not following protocol.
> I'm trying to run the following code, however I keep on getting the error
> Invalid number of arguments for function add_months. Expected: 2; Found: 1;
> Even though, I certain I have two arguments. 
> Can someone take a look at the code and let me know where I might be going 
> wrong.
>  
> test5 = spark.sql("""SELECT
>  TRX_EVENT_END AS TRX_EVENT
>  ,SALES_QUANTITY
> FROM Transactions
> WHERE TRX_EVENT_END BETWEEN CAST(YEAR(DATE_ADD(CURRENT_DATE(),-1)) AS 
> CHAR(4))+ RIGHT('0' + CAST(ADD_MONTHS(DATE_ADD(CURRENT_DATE(),-1))AS 
> VARCHAR(2)),2) + '01'AND LAST_DAY(DATE_ADD(CURRENT_DATE(),-1))""")
>  
> Thanks
>  
> Carlton



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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

Reply via email to