Skip to content
Permalink
Browse files
Revert "[PATCH] Add "regexstringnocase" to ParseFilter for case-insen…
…sitivity (#2784)"

Will re-commit with the proper jira ID

This reverts commit 51cee00.
  • Loading branch information
wchevreuil committed Dec 21, 2020
1 parent 51cee00 commit d13010fa260ac313b027333ec6c8a4c847fa3e6e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
@@ -244,13 +244,6 @@ public final class ParseConstants {
public static final byte [] regexStringType = new byte [] {'r','e','g','e', 'x',
's','t','r','i','n','g'};

/**
* RegexStringNoCaseType byte array
*/
public static final byte [] regexStringNoCaseType = new byte [] {'r','e','g','e','x',
's','t','r','i','n','g',
'n','o','c','a','s','e'};

/**
* SubstringType byte array
*/
@@ -28,7 +28,6 @@
import java.util.EmptyStackException;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.Set;
import java.util.Stack;

@@ -813,9 +812,6 @@ else if (Bytes.equals(comparatorType, ParseConstants.binaryPrefixType))
return new BinaryPrefixComparator(comparatorValue);
else if (Bytes.equals(comparatorType, ParseConstants.regexStringType))
return new RegexStringComparator(new String(comparatorValue, StandardCharsets.UTF_8));
else if (Bytes.equals(comparatorType, ParseConstants.regexStringNoCaseType))
return new RegexStringComparator(new String(comparatorValue, StandardCharsets.UTF_8),
Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
else if (Bytes.equals(comparatorType, ParseConstants.substringType))
return new SubstringComparator(new String(comparatorValue, StandardCharsets.UTF_8));
else
@@ -24,7 +24,6 @@
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.hadoop.hbase.CompareOperator;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.testclassification.MediumTests;
@@ -280,20 +279,6 @@ public void testQualifierFilter() throws IOException {
assertEquals("pre*", new String(regexStringComparator.getValue(), StandardCharsets.UTF_8));
}

@Test
public void testQualifierFilterNoCase() throws IOException {
String filterString = "QualifierFilter(=, 'regexstringnocase:pre*')";
QualifierFilter qualifierFilter =
doTestFilter(filterString, QualifierFilter.class);
assertEquals(CompareOperator.EQUAL, qualifierFilter.getCompareOperator());
assertTrue(qualifierFilter.getComparator() instanceof RegexStringComparator);
RegexStringComparator regexStringComparator =
(RegexStringComparator) qualifierFilter.getComparator();
assertEquals("pre*", new String(regexStringComparator.getValue(), StandardCharsets.UTF_8));
int regexComparatorFlags = regexStringComparator.getEngine().getFlags();
assertEquals(Pattern.CASE_INSENSITIVE | Pattern.DOTALL, regexComparatorFlags);
}

@Test
public void testValueFilter() throws IOException {
String filterString = "ValueFilter(!=, 'substring:pre')";

0 comments on commit d13010f

Please sign in to comment.