Skip to content

extractGroups() documented to return array of arrays but does not #6069

@theory

Description

@theory

The docs for extractGroups show this example:

WITH '< Server: nginx
< Date: Tue, 22 Jan 2019 00:26:14 GMT
< Content-Type: text/html; charset=UTF-8
< Connection: keep-alive
' AS s
SELECT extractGroups(s, '< ([\\w\\-]+): ([^\\r\\n]+)');

Returning this output

[['Server','nginx'],['Date','Tue, 22 Jan 2019 00:26:14 GMT'],['Content-Type','text/html; charset=UTF-8'],['Connection','keep-alive']]

But that's not what I see in 26.2:

Mac :) select version();

SELECT version()

Query id: f93a03ba-8f5c-4855-b3fd-821e449f8e75

   ┌─version()───┐
1. │ 26.2.1.1139 │
   └─────────────┘

1 row in set. Elapsed: 0.001 sec. 

Mac :) WITH '< Server: nginx
< Date: Tue, 22 Jan 2019 00:26:14 GMT
< Content-Type: text/html; charset=UTF-8
< Connection: keep-alive
' AS s
SELECT extractGroups(s, '< ([\\w\\-]+): ([^\\r\\n]+)');

WITH '< Server: nginx\n< Date: Tue, 22 Jan 2019 00:26:14 GMT\n< Content-Type: text/html; charset=UTF-8\n< Connection: keep-alive\n' AS s
SELECT extractGroups(s, '< ([\\w\\-]+): ([^\\r\\n]+)')

Query id: f7279dc1-49e0-4a3a-9b16-d852c23f77ee

   ┌─extractGroup⋯\\r\\n]+)')─┐
1. │ ['Server','nginx']       │
   └──────────────────────────┘

1 row in set. Elapsed: 0.002 sec. 

Here it returns only the first group. Is there some setting that affects this behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions