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

James Taylor updated PHOENIX-1242:
----------------------------------
    Attachment: PHOENIX-1242_v2.patch

I updated the patch to check the byte length up front instead of reacting to an 
ArrayIndexOutOfBoundsException. I also converted the unchecked exceptions to 
wrap a SQLException so that the client will see those instead of a 
RuntimeException and fixed a few unit tests that looked for the old exception.

Couple of things of the next patch:
- try to derive tests from BaseHBaseManagedTimeIT
- make sure to add the @Category annotation. In the next JUnit release, this 
won't be necessary any longer, but they currently don't inherit this property 
from a derived class.
- postfix your test names that spin up a mini cluster with "IT" for integration 
test and put them in the src/it/java directory. Spinning up/down a mini cluster 
is too expensive for a non integration test.
- make sure to call fail() in your tests when you catch expected exceptions so 
you fail the test if the exception *doesn't* occur. 

> ArrayoutofBoundException Phoenix mapping to exisiting Hbase
> -----------------------------------------------------------
>
>                 Key: PHOENIX-1242
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1242
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>            Reporter: nicolas maillard
>            Assignee: Alicia Ying Shu
>            Priority: Minor
>             Fix For: 5.0.0, 4.2, 3.2
>
>         Attachments: PHOENIX-1242_v2.patch, Phoenix-1242-V1.patch, 
> phoenix-1242.patch
>
>
> In a Phoenix mapping to an existing Hbase Table in case of mis-typing say try 
> to cast a long an actual string type, Phoenix will break with:
> java.lang.ArrayIndexOutOfBoundsException: 324
> This is a user mis-use but the error message is misleading. The problem is 
> trying to copy a string to a long a fixed Bytes[] in long decodeLong.
> Maybe a test to check if the translation is possible and a type error if size 
> don't match would provide for a more explicit error message for the user to 
> understand what he did wrong.



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

Reply via email to