You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Kevin Liew (JIRA)" <ji...@apache.org> on 2015/12/23 21:25:46 UTC

[jira] [Updated] (PHOENIX-2355) Avatica fetch does not return an update row-count for upsert, delete

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

Kevin Liew updated PHOENIX-2355:
--------------------------------
    Description: 
1. prepare an upsert or delete
{noformat}request: {
  "request": "prepare",
  "connectionId": "c28224cd-a688-4117-af44-0d1510918bd8",
  "sql": "upsert into test.integer_table values ('test3', ?)",
  "maxRowCount": -1
}
{noformat}
Response:
{noformat}
{
  "response": "prepare",
  "statement": {
    "connectionId": "36acc5c4-0136-874a-2fcf-a3ec747d7FD4",
    "id": 1532322378,
    "signature": {
      "columns": [
        
      ],
      "sql": "upsert into test.integer_table values ('test3', ?)",
      "parameters": [
        {
          "signed": false,
          "precision": 0,
          "scale": 0,
          "parameterType": 4,
          "typeName": "INTEGER",
          "className": "java.lang.Integer",
          "name": "?1"
        }
      ],
      "cursorFactory": {
        "style": "LIST",
        "clazz": null,
        "fieldNames": null
      }
    }
  }
}
{noformat}
2. execute by calling 'fetch' to Phoenix
{noformat}
request: {
  "request": "fetch",
  "connectionId": "36acc5c4-0136-874a-2fcf-a3ec747d7FD4",
  "statementId": 1532322378,
  "parameterValues": [
    {
      "type": "INTEGER",
      "value": 1
    }
  ],
  "offset": 0,
  "fetchMaxRowCount": 100
}
{noformat}

Result:
{noformat}
{
  "response": "fetch",
  "frame": {
    "offset": 0,
    "done": true,
    "rows": [
      
    ]
  }
}
{noformat}

using prepareAndExecute, we get back an update row-count, but prepareAndExecute cannot be used for parameterized statements


  was:
1. prepare an upsert or delete
{noformat}request: {
  "request": "prepare",
  "connectionId": "c28224cd-a688-4117-af44-0d1510918bd8",
  "sql": "upsert into test.integer_table values ('test3', ?)",
  "maxRowCount": -1
}
{noformat}
Response:
{noformat}
{
  "response": "prepare",
  "statement": {
    "connectionId": "36acc5c4-0136-874a-2fcf-a3ec747d7FD4",
    "id": 1532322378,
    "signature": {
      "columns": [
        
      ],
      "sql": "upsert into test.integer_table values ('test3', ?)",
      "parameters": [
        {
          "signed": false,
          "precision": 0,
          "scale": 0,
          "parameterType": 4,
          "typeName": "INTEGER",
          "className": "java.lang.Integer",
          "name": "?1"
        }
      ],
      "cursorFactory": {
        "style": "LIST",
        "clazz": null,
        "fieldNames": null
      }
    }
  }
}
{noformat}
2. execute by calling 'fetch' to Phoenix
{noformat}
request: {
  "request": "fetch",
  "connectionId": "36acc5c4-0136-874a-2fcf-a3ec747d7FD4",
  "statementId": 1532322378,
  "parameterValues": [
    {
      "type": "INTEGER",
      "value": 1
    }
  ],
  "offset": 0,
  "fetchMaxRowCount": 100
}
{noformat}

result:
{noformat}
{
  "response": "fetch",
  "frame": {
    "offset": 0,
    "done": true,
    "rows": [
      
    ]
  }
}
{noformat}

using prepareAndExecute, we get back an update row-count, but prepareAndExecute cannot be used for parameterized statements



> Avatica fetch does not return an update row-count for upsert, delete
> --------------------------------------------------------------------
>
>                 Key: PHOENIX-2355
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2355
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.5.0
>         Environment: Hortonworks HDP 2.3 upgraded to Phoenix 4.5.0
>            Reporter: Kevin Liew
>              Labels: avatica, calcite, fetch, phoenix, prepare, wireprotocol
>
> 1. prepare an upsert or delete
> {noformat}request: {
>   "request": "prepare",
>   "connectionId": "c28224cd-a688-4117-af44-0d1510918bd8",
>   "sql": "upsert into test.integer_table values ('test3', ?)",
>   "maxRowCount": -1
> }
> {noformat}
> Response:
> {noformat}
> {
>   "response": "prepare",
>   "statement": {
>     "connectionId": "36acc5c4-0136-874a-2fcf-a3ec747d7FD4",
>     "id": 1532322378,
>     "signature": {
>       "columns": [
>         
>       ],
>       "sql": "upsert into test.integer_table values ('test3', ?)",
>       "parameters": [
>         {
>           "signed": false,
>           "precision": 0,
>           "scale": 0,
>           "parameterType": 4,
>           "typeName": "INTEGER",
>           "className": "java.lang.Integer",
>           "name": "?1"
>         }
>       ],
>       "cursorFactory": {
>         "style": "LIST",
>         "clazz": null,
>         "fieldNames": null
>       }
>     }
>   }
> }
> {noformat}
> 2. execute by calling 'fetch' to Phoenix
> {noformat}
> request: {
>   "request": "fetch",
>   "connectionId": "36acc5c4-0136-874a-2fcf-a3ec747d7FD4",
>   "statementId": 1532322378,
>   "parameterValues": [
>     {
>       "type": "INTEGER",
>       "value": 1
>     }
>   ],
>   "offset": 0,
>   "fetchMaxRowCount": 100
> }
> {noformat}
> Result:
> {noformat}
> {
>   "response": "fetch",
>   "frame": {
>     "offset": 0,
>     "done": true,
>     "rows": [
>       
>     ]
>   }
> }
> {noformat}
> using prepareAndExecute, we get back an update row-count, but prepareAndExecute cannot be used for parameterized statements



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