You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "liusong (JIRA)" <ji...@apache.org> on 2016/04/27 10:38:12 UTC

[jira] [Commented] (PHOENIX-2861) phoenix user-defined function

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

liusong commented on PHOENIX-2861:
----------------------------------

Here is my code.
https://github.com/oldmanls/phoenix/blob/master/src/main/java/com/fitech/hadoop/phoenix/CharLength.java

> phoenix user-defined function
> -----------------------------
>
>                 Key: PHOENIX-2861
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2861
>             Project: Phoenix
>          Issue Type: Test
>    Affects Versions: 4.4.0
>         Environment: hbase 0.98  phoenix4.4
>            Reporter: liusong
>              Labels: test
>             Fix For: 4.4.1
>
>   Original Estimate: 101h
>  Remaining Estimate: 101h
>
> I'm coding phoenix user-defined function recently.I have a problem when i code the function.I need to check the filed is null or not null.I upsert the data in phoenix set the filed null.Here is the code.
> String sourceStr = (String) getSourceStrExpression().getDataType().toObject(ptr,
> 				getSourceStrExpression().getSortOrder());
> if (ptr.getLength() == 0) {
> ptr.set(PVarchar.INSTANCE.toBytes("false"));}
> else{
> ptr.set(PVarchar.INSTANCE.toBytes("true"));}
> I always get true in phoenix but i think i will get false.
> How can i check the field is null?



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