This looks related to https://issues.apache.org/jira/browse/CALCITE-1639 <https://issues.apache.org/jira/browse/CALCITE-1639>, which was fixed in 1.13 but only dealt with the TIMESTAMPADD function. Maybe “<date> - <month interval>” should have the same behavior. Someone should consult the SQL standard and other DBs before changing Calcite’s behavior. Please log a JIRA case to track.
Julian > On Aug 16, 2017, at 8:40 AM, Josh Elser <els...@apache.org> wrote: > > I'm not sure how to give you more context as I'm not familiar with how Kylin > uses Calcite/Avatica. > > Best suggestion I can give you is to look at the raw value (if you can?) and > compare that to what you receive via your SQL query. This is likely a problem > with either the TZ configuration when you wrote the record or when you are > reading it back out. I'd suggest you play around with the TZ setting to see > how it works. > > On 8/16/17 3:04 AM, apache_...@163.com wrote: >> HI, >> thinks . >> Can you describe it clearer? >> Local server(linux) timezone is correct. >> ZONE="Asia/Shanghai" >> apache_...@163.com >> From: Josh Elser >> Date: 2017-08-16 10:52 >> To: dev >> Subject: Re: date function error >> Hi, >> This sounds like a timezone issue to me. Depending on how you wrote the >> date, conversion from GMT into your local timezone can appear to >> "change" a date. >> Can you try setting the timeZone[1] parameter in the JDBC URL? >> [1] https://calcite.apache.org/avatica/docs/client_reference.html#timeZone >> On 8/15/17 10:24 PM, apache_...@163.com wrote: >>> Hi, >>> >>> when i run sql by kyline GUI,Right result is 2011-02-28,but i got >>> 2011-03-01,is bug? >>> >>> select cast('2011-03-31' as date) - INTERVAL '1' month from KYLIN_CAL_DT >>> >>> >>> >>> >>> apache_...@163.com >>>