Regexp matching with dynamic pattern

Hi,

I want to match a string with a pattern in a join condition, using the extract_pattern function provided by the assistance.
I receive an error in the server.log file that indicates that the pattern must be a constant !

Any idea if there could be a way to do rexgexp match/capture with a dynamic pattern using Dremio ?

Thanks

@dfleckinger, can you provide and example of the match you are trying to do and the error message from the logs? Is there a query profile generated? If so, kindly share that as well.

@ben,

here is an example of a query where i want to identify the brand of a product given its productName, knowing that the products belong to an account whom I know a list of potentiel possible brands.

select products.productName,
extract_pattern(products.productName, accounts.brand_pattern, 0, ‘CAPTURE_GROUP’) AS brand_found
FROM
products
inner join account_brands on products.account_id = account_brands.account_id
where
products.productName is not null

for instance brand pattern can be something such as ‘.(\b(Apple|Samsung|Huawei)\b).

There query results in an error :

IllegalArgumentException: The argument ‘pattern’ of Function ‘extract_pattern’ has to be constant!

Query profile associated :
3dff27cb-56c7-4ca6-ab5e-e1cb9d5d402f.zip (9.9 KB)