[
https://issues.apache.org/jira/browse/PHOENIX-1273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14143862#comment-14143862
]
James Taylor commented on PHOENIX-1273:
---------------------------------------
Excellent, [~jmspaggi]. I like the idea of having an ILIKE along the lines of
Postgres. The easiest path is going to be to piggyback on existing LIKE support
as follows:
- Add ILIKE to the grammar in PhoenixSQL.g
- Modify the factory method in ParseNodeFactory and the constructor of
LikeParseNode by adding something along the lines of a new enum with values of
CaseSensitive, CaseInsensitive:
{code}
public LikeParseNode like(ParseNode lhs, ParseNode rhs, boolean negate,
LikeType likeType) {
return new LikeParseNode(lhs, rhs, negate, likeType);
}
{code}
- Modify the visitor method in ExpressionCompiler for LIKE. It currently
constructs a LikeExpression directly, but we've been opportunistically changing
these to become create static constructors inside of the expression class
instead. So pass through the LikeType to the constructor or static constructor
there. Might be easiest to add the LikeType as an additional Expression child -
you could just instantiate a LiteralExpression for it's string representation.
{code}
@Override
public Expression visitLeave(LikeParseNode node, List<Expression> children)
throws SQLException {
{code}
- Modify LikeExpression to use LikeType. This is going to be easier than
deriving a new class, as I suspect everything will be the same except for the
args you pass when the Pattern is created.
> Phoenix should provide ILIKE keyword
> ------------------------------------
>
> Key: PHOENIX-1273
> URL: https://issues.apache.org/jira/browse/PHOENIX-1273
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.2
> Reporter: Jean-Marc Spaggiari
> Assignee: Jean-Marc Spaggiari
> Priority: Minor
> Attachments: PHOENIX-1273-v1.patch, PHOENIX-1273.patch
>
>
> Phoenix provides LIKE keyword but not ILIKE which is a case insensitive LIKE.
> Goal of this patch is to add this keyword.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)