You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jacques Nadeau (JIRA)" <ji...@apache.org> on 2014/06/06 05:02:03 UTC

[jira] [Commented] (DRILL-574) RPAD function returns different result compared to other rdbms when length is less than string

    [ https://issues.apache.org/jira/browse/DRILL-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14019520#comment-14019520 ] 

Jacques Nadeau commented on DRILL-574:
--------------------------------------

Fixed at master 3db1d5a and beyond.

> RPAD function returns different result compared to other rdbms when length is less than string
> ----------------------------------------------------------------------------------------------
>
>                 Key: DRILL-574
>                 URL: https://issues.apache.org/jira/browse/DRILL-574
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.0.0
>            Reporter: Krystal
>         Attachments: DRILL-574.patch
>
>
> The rpad function - rpad(str1, length [, str2]) returns different result compared to postgres, oracle and mysql when length is less than the lenght of str1.  For example:
> select * from voter where voter_id=10;
>  voter_id |     name      | age | registration | contributions | voterzone |     create_time     
> --------+---------------+-----+--------------+---------------+-----------+---------------------
>      10 | tom underhill |  75 | socialist    |        525.33 |     18592 | 2015-01-24 07:27:05
> 0: jdbc:drill:schema=dfs> select rpad(name, 8, 'A') from voter where voter_id=10;
> +------------+
> |   EXPR$0   |
> +------------+
> | nderhill   |
> +------------+
> The above result from drill truncates the name from right to left.  For the other rdbms:
> SQL> select rpad(name, 8, 'A') from voter where voter_id=10;
> RPAD(NAM
> --------
> tom unde
> Looks like truncation occurs from left to right eventhough it's rpad.  



--
This message was sent by Atlassian JIRA
(v6.2#6252)