You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/11/22 06:10:10 UTC

[jira] [Comment Edited] (PHOENIX-2422) Differentiate between null and empty string

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

James Taylor edited comment on PHOENIX-2422 at 11/22/15 5:09 AM:
-----------------------------------------------------------------

Works as designed, but I've made this an enhancement request instead.


was (Author: jamestaylor):
WAD

> Differentiate between null and empty string
> -------------------------------------------
>
>                 Key: PHOENIX-2422
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2422
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 4.5.2
>         Environment: Sending Avatica requests to Phoenix 4.5.2 using Telerik Fiddler or any REST test tool
>            Reporter: Kevin Liew
>              Labels: char, null, phoenix, string
>
> Create a table with a character column (use the JDBC driver or bulk import tool)
> {noformat}
> DROP TABLE IF EXISTS SEN.Char_Table;
> CREATE TABLE IF NOT EXISTS SEN.Char_Table(
> 	KeyColumn VARCHAR(255) PRIMARY KEY,
> 	Column1 CHAR(100));
> {noformat}
> Upsert an empty string using Avatica wire protocol
> {noformat}
> request: {
>   "request": "prepareAndExecute",
>   "connectionId": "bed590dc-04d0-f1c2-16cd-a20107271BA9",
>   "sql": "UPSERT INTO SEN.CHAR_TABLE(KeyColumn, Column1) VALUES('ConversionTestKey', '')",
>   "maxRowCount": -1
> }
> {noformat}
> Query the inserted data
> {noformat}
> request: {
>   "request": "prepareAndExecute",
>   "connectionId": "bed590dc-04d0-f1c2-16cd-a20107271BA9",
>   "sql": "SELECT RTRIM(Column1) FROM SEN.CHAR_TABLE WHERE RTRIM(KeyColumn) = 'ConversionTestKey'",
>   "maxRowCount": -1
> }
> {noformat}
> Actual result:
> {noformat}
> {
>   "response": "Service$ExecuteResponse",
>   "results": [
>     {
>       "response": "resultSet",
>       "connectionId": "bed590dc-04d0-f1c2-16cd-a20107271BA9",
>       "statementId": 371048010,
>       "ownStatement": true,
>       "signature": {
>         "columns": [
>           {
>             "ordinal": 0,
>             "autoIncrement": false,
>             "caseSensitive": false,
>             "searchable": true,
>             "currency": false,
>             "nullable": 1,
>             "signed": false,
>             "displaySize": 255,
>             "label": "RTRIM(COLUMN1)",
>             "columnName": "RTRIM(COLUMN1)",
>             "schemaName": "",
>             "precision": 255,
>             "scale": 0,
>             "tableName": "SEN.CHAR_TABLE",
>             "catalogName": "",
>             "type": {
>               "type": "scalar",
>               "id": 12,
>               "name": "VARCHAR",
>               "rep": "STRING"
>             },
>             "readOnly": true,
>             "writable": false,
>             "definitelyWritable": false,
>             "columnClassName": "java.lang.String"
>           }
>         ],
>         "sql": null,
>         "parameters": [
>           
>         ],
>         "cursorFactory": {
>           "style": "LIST",
>           "clazz": null,
>           "fieldNames": null
>         }
>       },
>       "firstFrame": {
>         "offset": 0,
>         "done": true,
>         "rows": [
>           [
>             null
>           ]
>         ]
>       },
>       "updateCount": -1
>     }
>   ]
> }
> {noformat}
> Expected result: results.firstFrame.rows\[0\] should contain an empty string, not 'null'



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)