You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "CARLTON PATTERSON (JIRA)" <ji...@apache.org> on 2019/08/11 16:58:00 UTC

[jira] [Created] (SPARK-28689) Unable to successfully issue spark sql code

CARLTON PATTERSON created SPARK-28689:
-----------------------------------------

             Summary: 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


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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org