You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/09/16 03:00:05 UTC

[GitHub] [druid] tianzhipeng-git commented on issue #10380: Druid 0.13.0 NPE problem

tianzhipeng-git commented on issue #10380:
URL: https://github.com/apache/druid/issues/10380#issuecomment-693140391


   It's really strange, because I think it is impossible to generate NPE at  [`IncrementalIndex.java:1145->IncrementalIndex.java:1158`](https://github.com/apache/druid/blob/b924f717ee34d7aa48ad50c00eeae8ed84ec960f/processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java#L1158) of 0.13.0-incubating:
   ```
       public int compare(IncrementalIndexRow lhs, IncrementalIndexRow rhs)
       {
   1158:      int retVal = Longs.compare(lhs.timestamp, rhs.timestamp);
   1159:      int numComparisons = Math.min(lhs.dims.length, rhs.dims.length);
   ```
   (lhs and rhs comes from ConcurrentSkipListMap, which are both not null, and lhs.timestamp is long type)
   
   But line 1159 can generate NPE, maybe the source code messed. (IncrementalIndex.java:1145 is strage too, it looks right if add 1 to 1146 and 1159)
   So in line 1159, the row's dims maybe null,  can you make sure that *all rows in your data have dims values*, without null row?
   
   ----
   In Chinese: 这个报错非常奇怪, 我觉得IncrementalIndex.java:1158不可能产生空指针异常, 代码见上.
   IncrementalIndexRow lhs和rhs都是从ConcurrentSkipListMap中取出来的, 都不可能为空, 且lhs.timestamp是原始long类型也不会报空指针.
   但是我发现1159行其实是可能空指针的, 可能是源码串行了. (IncrementalIndex.java:1145这一行也奇怪, 如果两个行号都加1就看起来都正常了)
   所以如果是1159报空指针, 那么说明lhs或rhs的dims数组是空的, 所以可能是你数据中, 有的数据行, 没有维度列的值? 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org