ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Goncharuk <alexey.goncha...@gmail.com>
Subject Re: SQL Query Regular Expression
Date Tue, 16 Jun 2015 21:13:41 GMT
SQL grammar and limitations are fully defined by the H2 SQL rules as Ignite
uses H2 as the underlying SQL engine:

For your case something like "SELECT * FORM Table WHERE column REGEXP
'^abc' " should work. The documentation says that regular java Matcher.find
rules are applied. Note, though, that indexes most likely will not be
involved in such a query (this is just my speculation, maybe Sergi can shed
more light on this).
However, for your case the following query will also work: "SELECT * FORM
Table WHERE column LIKE 'abc%' ". Such syntax allows to do less than
regexp, but this query should be able to pick up an index.

Finally, if neither of the above works for you, you can plug a custom SQL
function with @QuerySqlFunction annotation and do whatever filtering you

Hope this helps,

2015-06-16 13:47 GMT-07:00 fluffy <fhafner@gmail.com>:

> Does anyone know what the Ignite capabilities are regarding SQL and Regular
> Expressions?
> Specifically, I am trying to do an SQLFieldQuery based on 2 fields where I
> would like the text to start with a sequence of characters. In regular SQL
> speak, this can be done using the '^' character at the beginning of the
> regular expression.
> However, I tried putting the '^' character in my SQLFieldQuery as well as
> in
> the setArgs() method, but neither seemed to work.
> Does anyone have more detailed on Ignite Regular Expressions?
> Thanks much,
> Florian
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/SQL-Query-Regular-Expression-tp505.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message