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

ASF GitHub Bot commented on NIFI-238:
-------------------------------------

Github user rdblue commented on a diff in the pull request:

    https://github.com/apache/incubator-nifi/pull/24#discussion_r24836760
  
    --- Diff: 
nifi/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/src/main/java/org/apache/nifi/processors/kite/JSONFileReader.java
 ---
    @@ -0,0 +1,111 @@
    +/*
    + * Copyright 2015 Cloudera Inc.
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.nifi.processors.kite;
    +
    +import com.fasterxml.jackson.databind.JsonNode;
    +import com.google.common.base.Function;
    +import com.google.common.base.Preconditions;
    +import com.google.common.collect.Iterators;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.util.Iterator;
    +import javax.annotation.Nullable;
    +import org.apache.avro.Schema;
    +import org.apache.avro.generic.GenericData;
    +import org.kitesdk.data.DatasetIOException;
    +import org.kitesdk.data.spi.AbstractDatasetReader;
    +import org.kitesdk.data.spi.DataModelUtil;
    +import org.kitesdk.data.spi.JsonUtil;
    +import org.kitesdk.data.spi.ReaderWriterState;
    +
    +/**
    + * This is a temporary addition. The version in 0.18.0 throws a NPE when 
the
    + * InputStream constructor is used.
    + */
    +public class JSONFileReader<E> extends AbstractDatasetReader<E> {
    --- End diff --
    
    This one is in the NiFi namespace because it relies on public parts of the 
Kite SPI, it's the CSVFileReader that had to be in the Kite namespace.
    
    The version of Kite is bundled in the NAR, so I think dropping in a 
different version is a low risk.
    
    This should definitely be package-private, but we can't make it much 
smaller. The parent maintains its state and requires a call to initialize. We 
can't change either the `state` or `incoming` stream, so there isn't much to do 
but copy the class and fix this in the next version of Kite (due out very soon).


> Add processors to write datasets using Kite
> -------------------------------------------
>
>                 Key: NIFI-238
>                 URL: https://issues.apache.org/jira/browse/NIFI-238
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Extensions
>            Reporter: Ryan Blue
>
> I think it would be great to have a set of processors that parse incoming 
> flow files and add the data to Kite datasets.



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

Reply via email to