You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/02/25 08:10:00 UTC

[jira] [Commented] (KYLIN-3828) ArrayIndexOutOfBoundsException thrown when build a streaming cube with empty data in its first dimension

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

ASF GitHub Bot commented on KYLIN-3828:
---------------------------------------

nichunen commented on pull request #482: KYLIN-3828 Fix heading empty string be ignored in StringUtil.join
URL: https://github.com/apache/kylin/pull/482
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> ArrayIndexOutOfBoundsException thrown when build a streaming cube with empty data in its first dimension
> --------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-3828
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3828
>             Project: Kylin
>          Issue Type: Bug
>          Components: NRT Streaming
>    Affects Versions: v2.6.0
>            Reporter: nichunen
>            Assignee: nichunen
>            Priority: Major
>             Fix For: Future
>
>
> The root cause is 
> in org.apache.kylin.source.kafka.hadoop.KafkaFlatTableMapper#doMap
> {code:java}
>     public void doMap(LongWritable key, BytesWritable value, Context context) throws IOException, InterruptedException {
>         ByteBuffer buffer = ByteBuffer.wrap(value.getBytes(), 0, value.getLength());
>         StreamingMessageRow row = streamingParser.parse(buffer).get(0);
>         if (row == null) {
>             throw new IllegalArgumentException("");
>         }
>         data = StringUtil.join(row.getData(), delimiter);
>         // output this row to value
>         outValue.set(Bytes.toBytes(data));
>         context.write(outKey, outValue);
>     }
> {code}
> Method _StringUtil.join_ is used to join a collection of string to a single string with delimiter. But _org.apache.kylin.common.util.StringUtil#join_ will ignore the leading empty strings in the colletion, source code is:
> {code:java}
>     public static String join(Iterable<String> parts, String separator) {
>         StringBuilder buf = new StringBuilder();
>         for (String p : parts) {
>             if (buf.length() > 0)
>                 buf.append(separator);
>             buf.append(p);
>         }
>         return buf.toString();
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)