teragrep / pth_10

Data Processing Language (DPL) translator for Apache Spark
GNU Affero General Public License v3.0
0 stars 6 forks source link

searchmatch does not support implicit _raw column matching #214

Closed eemhu closed 2 weeks ago

eemhu commented 7 months ago

Describe the bug | eval a = if(searchmatch("ERROR"), 1, 0) should find the text ERROR from the _raw column. Only _raw=ERROR is supported. Wildcards also seem to only be implemented as , not as a part of a string. Example: `_raw=works,_raw=a*` does not.

Expected behavior Implicit matching from "_raw" should be the default. Wildcards should function as a part of a string as well.

How to reproduce Try to use the command example mentioned first. It does not match from the _raw column, instead results in an error.

Screenshots

Software version

4.17.0

Desktop (please complete the following information if relevant):

Additional context

51-code commented 3 weeks ago

QA testing done for the latest fixes in the PR. Proceeding to peer review for the fixes. Noticed a bug in the eval function. If using just a searchmatch without having it in if(), the results will not be True and False as in the unit tests, but "Error in entry". This is because UI doesn't support boolean table columns. The solution is that the eval should check what the datatype of the resulting column is and it should throw an exception if it is boolean. Writing a new issue about that.

51-code commented 3 weeks ago

Refactored the logic and improved the unit tests based on peer review comments.