[
https://issues.apache.org/jira/browse/HIVE-27559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alagappan Maruthappan updated HIVE-27559:
-----------------------------------------
Description:
The following query
{code:java}
SELECT * FROM src WHERE key LIKE
'abc%def%ghi%jkl%mno%pqr%stu%vwxyz%abc%def%ghi%jkl%mno%pqr%stu%vwxy_z';
{code}
would hang trying to determine if the LIKE clause can be chained in
ChainedCheckerFactory. This is because the CHAIN_PATTERN is defined as
"(%?[^%_\\\\]{+}%?){+}" which is trying to do a greedy match and ends doing a
catastrophic backtracking.
We need the full expression to match, so we can convert define this pattern
using possessive quantifier to avoid the backtracking.
was:
The following query
{code:java}
SELECT * FROM src WHERE key LIKE
'abc%def%ghi%jkl%mno%pqr%stu%vwxyz%abc%def%ghi%jkl%mno%pqr%stu%vwxy_z';
{code}
would hang trying to determine if the LIKE clause can be chained in
ChainedCheckerFactory. This is because the CHAIN_PATTERN is defined as
"(%?[^%_\\\\]+%?)+" which is trying to do a greedy match and ends doing a
catastrophic backtracking.
We need the full expression to match, so we can convert define this pattern
using possessive quantifier to avoid the backtracking.
> Query hangs while trying to determine if the LIKE clause can be chained
> -----------------------------------------------------------------------
>
> Key: HIVE-27559
> URL: https://issues.apache.org/jira/browse/HIVE-27559
> Project: Hive
> Issue Type: Bug
> Reporter: Alagappan Maruthappan
> Assignee: Alagappan Maruthappan
> Priority: Major
> Labels: pull-request-available
>
> The following query
> {code:java}
> SELECT * FROM src WHERE key LIKE
> 'abc%def%ghi%jkl%mno%pqr%stu%vwxyz%abc%def%ghi%jkl%mno%pqr%stu%vwxy_z';
> {code}
> would hang trying to determine if the LIKE clause can be chained in
> ChainedCheckerFactory. This is because the CHAIN_PATTERN is defined as
> "(%?[^%_\\\\]{+}%?){+}" which is trying to do a greedy match and ends doing a
> catastrophic backtracking.
> We need the full expression to match, so we can convert define this pattern
> using possessive quantifier to avoid the backtracking.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)