[
https://issues.apache.org/jira/browse/PHOENIX-2424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15007770#comment-15007770
]
James Taylor edited comment on PHOENIX-2424 at 11/22/15 5:29 AM:
-----------------------------------------------------------------
This works as designed, but I've made this an enhancement request instead.
There'd be little to no difference between VARCHAR and CHAR if this is
implemented. We currently support only single byte characters in CHAR so that
we do not need to put a terminating byte in our row key for CHAR types (which
we'd no longer be able to do if we support multi-byte characters).
was (Author: jamestaylor):
WAD
> Support multi-byte characters in CHAR data type
> -----------------------------------------------
>
> Key: PHOENIX-2424
> URL: https://issues.apache.org/jira/browse/PHOENIX-2424
> 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, phoenix, string
>
> Create a table with a character column (use the JDBC driver or bulk import
> tool)
> {noformat}
> DROP TABLE IF EXISTS SEN.WChar_Table;
> CREATE TABLE IF NOT EXISTS SEN.WChar_Table(
> KeyColumn VARCHAR(255) PRIMARY KEY,
> Column1 CHAR(100));
> {noformat}
> Upsert an unsupported character using Avatica wire protocol
> {noformat}
> request: {
> "request": "prepareAndExecute",
> "connectionId": "1ccf2934-7b9b-491b-7d37-17be44bc811E",
> "sql": "UPSERT INTO SEN.WVARCHAR_TABLE(KeyColumn, Column1)
> VALUES('ConversionTestKey', '喂')",
> "maxRowCount": -1
> }
> {noformat}
> We expect an error (as occurs when attempting to upsert into a CHAR column)
> but instead the upsert succeeds. So we query the inserted data and find that
> incorrect data was inserted at results.firstFrame.rows\[0\]
> {noformat}
> {
> "response": "Service$ExecuteResponse",
> "results": [
> {
> "response": "resultSet",
> "connectionId": "1ccf2934-7b9b-491b-7d37-17be44bc811E",
> "statementId": 592785849,
> "ownStatement": true,
> "signature": {
> "columns": [
> {
> "ordinal": 0,
> "autoIncrement": false,
> "caseSensitive": false,
> "searchable": true,
> "currency": false,
> "nullable": 1,
> "signed": false,
> "displaySize": 510,
> "label": "COLUMN1",
> "columnName": "COLUMN1",
> "schemaName": "",
> "precision": 510,
> "scale": 0,
> "tableName": "SEN.WVARCHAR_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": [
> [
> "å"
> ]
> ]
> },
> "updateCount": -1
> }
> ]
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)