Created
November 24, 2022 15:28
-
-
Save mshakhomirov/b1f442a296ffef52c7baa1245e1dc316 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with events as ( | |
select 'open_chat' as event_name, '10.1.0' as app_display_version union all | |
select 'open_chat' as event_name, '10.1.9' as app_display_version union all | |
select 'open_chat' as event_name, '9.1.4' as app_display_version union all | |
select 'open_chat' as event_name, '9.0.0' as app_display_version | |
) | |
select | |
app_display_version | |
,REGEXP_EXTRACT(app_display_version, '^[^.^]*') main_version | |
,safe_cast(REGEXP_EXTRACT(app_display_version, '[0-9]+.[0-9]+') as float64) release_version | |
,safe_cast(REGEXP_EXTRACT(app_display_version, r"^[a-zA-Z0-9_.+-]+.[a-zA-Z0-9-]+\.([a-zA-Z0-9-.]+$)") as int64) as mod_version | |
from events | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment