Hi Danny, I really appreciate the fix. Thank you very much for your help.
Regards, Hrudaya -----Original Message----- From: Danny Chan <yuzhao....@gmail.com> Sent: Saturday, January 18, 2020 6:40 PM To: dev@calcite.apache.org Subject: [EXTERNAL] Re: Usage of SqlStdOperatorTable.BETWEEN from RelBuilder See https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.apache.org_jira_browse_CALCITE-2D3747&d=DwIFaQ&c=IrjCfGj3zOfzN2DRIASEFg&r=MjX6IuQXq8W7yQ_nB4S_UQ&m=RSRhgtqD7MKnJ5_j6ApJPGaJ2QgW99X_SA5HlXDyH5I&s=G32bsRDyarFEXqJPnO5CxZcbtFNF19mSI3faMqK0ri0&e= Best, Danny Chan 在 2020年1月18日 +0800 AM9:56,Hrudaya Reddy <hre...@csod.com>,写道: > Hi all, > > We are trying to generate the following sql query > > SELECT [user_id], [create_date] > FROM [users] > WHERE [user_id] BETWEEN 1 AND 5 > > I am trying the following but I get ClassCastException error > > RexNode betweenCondition = > relBuilder.call(SqlStdOperatorTable.BETWEEN, > relBuilder.field("user_id"), relBuilder.literal(1), > relBuilder.literal(5)); > > Exception in thread "main" java.lang.ClassCastException: > org.apache.calcite.rex.RexCallBinding cannot be cast to > org.apache.calcite.sql.SqlCallBinding > at > org.apache.calcite.sql.fun.SqlBetweenOperator.inferReturnType(SqlBetwe > enOperator.java:139) at > org.apache.calcite.rex.RexBuilder.deriveReturnType(RexBuilder.java:276 > ) at org.apache.calcite.tools.RelBuilder.call(RelBuilder.java:602) > at org.apache.calcite.tools.RelBuilder.call(RelBuilder.java:596) > > I would really appreciate it if you could guide me with the correct usage of > the BETWEEN operator. > > Thanks in advance. > > Regards, > Hrudaya > > This message, together with any attachments, is intended only for the use of > the individual or entity to which it is addressed and may contain > confidential and/or privileged information. If you are not the intended > recipient(s), or the employee or agent responsible for delivery of this > message to the intended recipient(s), you are hereby notified that any > dissemination, distribution or copying of this message, or any attachment, is > strictly prohibited. If you have received this message in error, please > immediately notify the sender and delete the message, together with any > attachments, from your computer. Thank you for your cooperation. ---------------------------------------------------------------------- *EXTERNAL MESSAGE WARNING: This email originated from outside of Cornerstone. Do not click links or open attachments unless you recognize the sender and know the content is safe. Please see this wiki for more information on email safety: https://wiki.cornerstoneondemand.com/display/ISS/Security+Awareness