You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "John Russell (JIRA)" <ji...@apache.org> on 2018/03/29 18:55:00 UTC

[jira] [Resolved] (IMPALA-4107) APPX_MEDIAN cuts string to 10 chars

     [ https://issues.apache.org/jira/browse/IMPALA-4107?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Russell resolved IMPALA-4107.
----------------------------------
    Resolution: Fixed

The gerrit was finalized and the restriction is now in the docs.

> APPX_MEDIAN cuts string to 10 chars
> -----------------------------------
>
>                 Key: IMPALA-4107
>                 URL: https://issues.apache.org/jira/browse/IMPALA-4107
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Docs
>    Affects Versions: Impala 2.6.0
>            Reporter: Peter Brejcak
>            Assignee: Alex Rodoni
>            Priority: Minor
>
> Function APPX_MEDIAN returns only first 10 characters for string input. I didn't find such restrictions in documentation.
> Expected result for code below should be that length(APPX_MEDIAN(t.value))>=min(length(t.value)) but real result is different
> Please let me know if anything is not clear
> {code}
> create table user_agents (id int, value string);
> insert into table user_agents values (1,'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
> insert into table user_agents values (2,'Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/44.0.2441.18 Safari/537.36');
> insert into table user_agents values (3,'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/39.0.2186.5 Safari/537.36');
> insert into table user_agents values (4,'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/33.0.1810.81 Safari/537.36');
> insert into table user_agents values (5,'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/33.0.1810.81 Safari/537.36');
> insert into table user_agents values (6,'Mozilla/5.0 (Windows NT 5.1; WOW64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/33.0.1828.68 Safari/537.36');
> insert into table user_agents values (7,'Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; GT-I8190 Build/JZO54K) AppleWebKit/534.30 (KHTML; like Gecko) Version/4.0 Mobile Safari/534.30 [FB_IAB/FB4A;FBAV/74.0.0.21.69;]');
> insert into table user_agents values (8,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/32.0.1713.94 Safari/537.36');
> insert into table user_agents values (9,'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/44.0.2421.69 Safari/537.36');
> select count(1), APPX_MEDIAN(value), length(APPX_MEDIAN(t.value)), min(length(t.value)) from user_agents t
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)