sambekar15 opened a new pull request #2297:
URL: https://github.com/apache/calcite/pull/2297


   Problem : As mentioned in CALCITE-2251 - SPARK SQL QUERIES USING - INSERT 
OVERWRITE, RLIKE,DATE,DAY,YEAR,MONTH sytanx is failing. I am using 1.26.0 
version of calcite-core and calcite-server.Also it throws error if 
year,day,month,identity,value,date is used as alias in SQL query
   
   Proposed Solution. Modified Parser.jj file to support these tokens and also 
added year,day,month,identity,value,date as non reserved keyword to 
config.fmpp.  Creating this PR to get feedback on proposed solution. It may 
still require modifications for SqlStdOperatorTable#RLIKE support etc.. 
   
   All the queries (mentioned in jira and also specified below) are passing  
with the changes:
   
   query1 = "select {D'1990-01-01'} as day,a as month from tableA"
   query2 = "select DATE('1990-01-01'),a from tableA"
   query3 = "select   DATE(gns_date) as dt"
   query4 = "select loan_id as year, as_of_date as date"
   query5 = "select date('2020-11-07') as  date"
   query6 = "select date('2020-11-07') as  value,date('2020-11-08') as identity"
   query7 = "select cola from tableA where MAX(realm_email) rlike '.@.\\\\..+'"
   query8 = "INSERT OVERWRITE TABLE sbg_schema.tableA
   select distinct SURV_MARK_CUST_IDEN
   ,latest_surv_oci
   ,tran_mark_cust_iden
   ,surv_tran_mci
   ,orgz_mark_cust_iden from tableB"
      
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to