You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Magnus Mogren (Jira)" <ji...@apache.org> on 2021/11/24 19:52:00 UTC

[jira] [Updated] (CALCITE-4903) Avatica pads values returned from values-clause to same length

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

Magnus Mogren updated CALCITE-4903:
-----------------------------------
    Component/s: jdbc-driver

> Avatica pads values returned from values-clause to same length
> --------------------------------------------------------------
>
>                 Key: CALCITE-4903
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4903
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica, jdbc-driver
>    Affects Versions: avatica-1.19.0
>            Reporter: Magnus Mogren
>            Priority: Major
>
> When executing a values clause, the avatica driver returns the wrong values.
> It seems it checks what value is longest and then pads all other values in the values clause to the same length.
> {*}SQL{*}:
> {code:java}
> select * from (values ('a'),('abcd')){code}
> {*}Expected values to be returned{*}:
> {{'a'}}
> {{'abcd'}}
>  
> {*}Actual values returned{*}:
> {{'a   '}}
> {{'abcd'}}
> It seems that for some reason the driver thinks the columns for the values-clause should be treated as fixed length CHAR(4) instead of VARCHAR. This is also verified by calling ResultSet.getMetaData().getColumnType(1) for the ResultSet returned when executing the SQL statement. Indeed it returns 1 (java.sql.Types.CHAR)
> In my optinion this is a high priority bug since it affects any and all calcite adapters. In my example above no remote call is ever done.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)