[
https://issues.apache.org/jira/browse/PHOENIX-1287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14370755#comment-14370755
]
ASF GitHub Bot commented on PHOENIX-1287:
-----------------------------------------
Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/46#discussion_r26819320
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/expression/LikeExpression.java ---
@@ -289,11 +289,16 @@ public boolean evaluate(Tuple tuple,
ImmutableBytesWritable ptr) {
return true;
}
- String value = (String) PVarchar.INSTANCE.toObject(ptr,
getStrExpression().getSortOrder());
- boolean matched = pattern.matcher(value).matches();
+ String value = null;
+ if (logger.isTraceEnabled()) {
+ value = (String) PVarchar.INSTANCE.toObject(ptr,
getStrExpression().getSortOrder());
+ }
+ PVarchar.INSTANCE.coerceBytes(ptr, PVarchar.INSTANCE,
getStrExpression().getSortOrder(),
--- End diff --
Minor, but add a local variables at the beginning for strExpression,
strSortOrder, strDataType, patternExpression, as they're repeated quote often.
Also, here, change to:
strDataType.coerceBytes(ptr, strDataType, strSortOrder);
> Use the joni byte[] regex engine in place of j.u.regex
> ------------------------------------------------------
>
> Key: PHOENIX-1287
> URL: https://issues.apache.org/jira/browse/PHOENIX-1287
> Project: Phoenix
> Issue Type: Bug
> Reporter: James Taylor
> Assignee: Shuxiong Ye
> Labels: gsoc2015
>
> See HBASE-11907. We'd get a 2x perf benefit plus it's driven off of byte[]
> instead of strings.Thanks for the pointer, [~apurtell].
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)