phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m2je <...@git.apache.org>
Subject [GitHub] phoenix pull request #317: PHOENIX-3547 Supporting more number of indices pe...
Date Tue, 31 Jul 2018 23:32:15 GMT
Github user m2je commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/317#discussion_r206715551
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java ---
    @@ -204,14 +205,19 @@ private void appendPKColumnValue(StringBuilder buf, byte[] range,
Boolean isNull
                 range = ptr.get();
             }
             if (changeViewIndexId) {
    -            Short s = (Short) type.toObject(range);
    -            s = (short) (s + (-Short.MAX_VALUE));
    -            buf.append(s.toString());
    +            PDataType viewIndexDataType = tableRef.getTable().getViewIndexType();
    +            buf.append(getViewIndexValue(type, range, viewIndexDataType).toString());
             } else {
                 Format formatter = context.getConnection().getFormatter(type);
                 buf.append(type.toStringLiteral(range, formatter));
             }
         }
    +
    +    private Long getViewIndexValue(PDataType type, byte[] range, PDataType viewIndexDataType){
    +        boolean useLongViewIndex = MetaDataUtil.getViewIndexIdDataType().equals(viewIndexDataType);
    +        Object s =  type.toObject(range);
    +        return (useLongViewIndex ? (Long) s : (Short) s) - (useLongViewIndex ? Long.MAX_VALUE
: Short.MAX_VALUE);
    --- End diff --
    
    Done


---

Mime
View raw message