Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BI-5526: Add regexp_extract_all function #485

Merged
merged 12 commits into from
Jun 26, 2024
Merged

Conversation

br0vk1n-ia
Copy link
Contributor

No description provided.

@br0vk1n-ia
Copy link
Contributor Author

Был вопросик по уровням вложенности, вывод у функции такой:

(SELECT array_agg(anon_2.strs) AS array_agg_1
  FROM (SELECT (REGEXP_MATCHES('100-200, 300-400', '(\d+)-(\d+)', 'g'))[1] AS strs) AS anon_2) AS anon_1

@br0vk1n-ia
Copy link
Contributor Author

postgresql, as in other tests, returns None

# regexp_extract_all
base.FuncRegexpExtractAll(
variants=[
V(D.CLICKHOUSE, lambda text, pattern: sa.func.extractAll(sa.func.assumeNotNull(text), pattern)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://clickhouse.com/docs/en/sql-reference/functions/functions-for-nulls#assumenotnull
kinda scared of "Returned values: An arbitrary value, if the input value is NULL". can we wrap the case of text being NULL?
also, definitely need a test for that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this functions wraps null text to ""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added test

@br0vk1n-ia br0vk1n-ia merged commit 4dc60d6 into main Jun 26, 2024
57 checks passed
@br0vk1n-ia br0vk1n-ia deleted the add_regexp_extract_all branch June 26, 2024 11:41
@KonstantAnxiety KonstantAnxiety added component/formula Formula changelog Changes should be included in changelog type/feat New features labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Changes should be included in changelog component/formula Formula type/feat New features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants