You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Tim Armstrong (JIRA)" <ji...@apache.org> on 2018/06/11 17:06:00 UTC

[jira] [Resolved] (IMPALA-1081) String expression discards data when single quote inside double-quoted string

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

Tim Armstrong resolved IMPALA-1081.
-----------------------------------
    Resolution: Cannot Reproduce

I can't reproduce this on a recent build. I think IMPALA-3942 probably fixed it.

> String expression discards data when single quote inside double-quoted string
> -----------------------------------------------------------------------------
>
>                 Key: IMPALA-1081
>                 URL: https://issues.apache.org/jira/browse/IMPALA-1081
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 1.4
>            Reporter: John Russell
>            Assignee: Alexander Behm
>            Priority: Major
>
> If I use INSERT...VALUES with a double-quoted string, and the string contains any single quotes, some of the string data is lost.
> [localhost:21000] > create table single_quote (s string);
> [localhost:21000] > insert into single_quote values ("I'm just tryin' to insert a value where I'm using single quotes.");
> [localhost:21000] > select * from single_quote;
> +-----------------------------+
> | s                           |
> +-----------------------------+
> | I to insert a value where I |
> +-----------------------------+
> What I have observed is that everything after the first single quote is discarded. (I.e. if there's only one single quote, everything after that is truncated.) If there's another single quote later, the text following that is preserved, at least until the next single quote when it's discarded again.
> The quotes and the discarded text are actually missing from the table contents when I look at the text data file.
> Things I didn't check:
> - Whether this affects INSERT...SELECT or only INSERT...VALUES.
> - If it happens with inserts via JDBC.
> It looks like it's something directly in expression evaluation for strings, because the data gets thrown away from any string expression:
> [localhost:21000] > select "I'm only a squirrel trying to get a nut";
> +-------------------------------------------+
> | 'i'm only a squirrel trying to get a nut' |
> +-------------------------------------------+
> | I                                         |
> +-------------------------------------------+
> [localhost:21000] > select "I'm hungry" = "I'm thirsty";
> +------------------------------+
> | 'i'm hungry' = 'i'm thirsty' |
> +------------------------------+
> | true                         |
> +------------------------------+
> Assigning to Abdullah because he and I and Ishaan talked about it maybe being an impala-shell bug.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org