Hi, I've noticed that using regex in TEXT_MATCH en...
# troubleshooting
t
Hi, I've noticed that using regex in TEXT_MATCH ends up getting different results from using REGEXP_LIKE. It appears that TEXT_MATCH sometimes misses data. Is this behavior expected?
m
Can you provide both the queries? Also @Atri Sharma to comment.
a
The syntax is typically different, so it would be great to see the queries
t
I made a minimal example where there is a string col, and I ingested the string
a.1
: This returns the col correctly:
Copy code
select distinct(col) from test_regex
where REGEXP_LIKE(col, 'a.1')
However this returns nothing:
Copy code
select distinct(col) from test_regex
where TEXT_MATCH(col, '/a.1/')
It seems this happens when there is a period followed by a number in the string
a
Did you try escaping the period?
t
I tried escaping the period in the regex string and it does nothing
a
Can you share the exact query that did not work?
t
Copy code
select distinct(col) from test_regex
where TEXT_MATCH(col, '/a\.1/')
just checking, any ideas?
m
@Atri Sharma ^^
a
Let me try this locally and revert
👍 1
t
based on my brief debugging, I think this issue is because Pinot uses the StandardAnalyzer for the lucene index: https://github.com/apache/pinot/blob/088da3f8c2f7077c51b7d8531b7b967ad1cf58c6/pino[…]/local/realtime/impl/invertedindex/RealtimeLuceneTextIndex.java From my understanding, the StandardAnalyzer doesn't support special characters
@Atri Sharma just checking if there are any updates?
a
It is indeed an analysis problem - it would be solved if we used Whitespace Analyzer. I am wondering if its worthwhile to allow users to specify which type of analyzer they wish to use while creating a text field. Thoughts @Mayank?
m
Yeah. Let’s file an issue on GH and discuss there?
t
m
Thanks