You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Shaofeng SHI (JIRA)" <ji...@apache.org> on 2019/03/04 10:30:00 UTC
[jira] [Resolved] (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:all-tabpanel ]
Shaofeng SHI resolved KYLIN-3828.
---------------------------------
Resolution: Fixed
> 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: v2.6.1
>
>
> 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)