calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: How to add user defined operator in Calcite?
Date Fri, 04 Aug 2017 20:30:21 GMT
"<>" is a built-in operator in standard SQL and in Calcite, so that
might be tricky.

If you were to add a new operator, say "<=>", you'd have to change the
parser, and also add an entry to the operator table
(SqlStdOperatorTable or similar).

If you can live with function syntax (as opposed to operator syntax)
it's easier to use use add a user-defined function.

Julian


On Fri, Aug 4, 2017 at 11:06 AM, Junwei Li <junwei.li.1987@gmail.com> wrote:
> Hi,
>
> I am a newbie to Calcite and SQL. Recently, I am trying to develop a
> calcite adapter for a new kind of data source. This data source has some
> different operators compared to SQL. For example, in SQL, if we want to
> find all rows that don't contain a certain keyword:
>
> select * from table where value not like 'abc%'
>
>
> In this new data source, the query string is:
>
>
> select * from table where value <> 'abc%'
>
>
>
> So in this data source, <> is a new operator.
>
>
> As of now, I have to manually generate the where clause in the filter rule.
> Does Calcite support adding new operator, so that it can automatically
> translate? Thanks!
>
>
> Sincerely,
> Junwei Li

Mime
View raw message