[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2017-04-10 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/254


> Convert JSON format to CSV
> --
>
> Key: NIFI-1583
> URL: https://issues.apache.org/jira/browse/NIFI-1583
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Core Framework
>Affects Versions: 0.4.1
>Reporter: Adis Cesir
>Priority: Minor
>
> Processor with the ability to flatten out multi nested JSON Objects and 
> Arrays into tabular format / CSV. An example of a use for this is the common 
> server responses and log events producing JSON which can be converted into 
> fixed delimited structure to ingest into RDBMS,HDFS/Hive and any other system 
> preferring 2 dimensional tabular formats.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2017-02-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

Github user joewitt commented on the issue:

https://github.com/apache/nifi/pull/254
  
I plan to close out this PR in a stale PR sweep soon.


> Convert JSON format to CSV
> --
>
> Key: NIFI-1583
> URL: https://issues.apache.org/jira/browse/NIFI-1583
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Core Framework
>Affects Versions: 0.4.1
>Reporter: Adis Cesir
>Priority: Minor
>
> Processor with the ability to flatten out multi nested JSON Objects and 
> Arrays into tabular format / CSV. An example of a use for this is the common 
> server responses and log events producing JSON which can be converted into 
> fixed delimited structure to ingest into RDBMS,HDFS/Hive and any other system 
> preferring 2 dimensional tabular formats.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2016-10-02 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

Github user trixpan commented on the issue:

https://github.com/apache/nifi/pull/254
  
@acesir wondering if you had time to rebase the PR so we can complete 
review and possibly merge it?


> Convert JSON format to CSV
> --
>
> Key: NIFI-1583
> URL: https://issues.apache.org/jira/browse/NIFI-1583
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Core Framework
>Affects Versions: 0.4.1
>Reporter: Adis Cesir
>Priority: Minor
>
> Processor with the ability to flatten out multi nested JSON Objects and 
> Arrays into tabular format / CSV. An example of a use for this is the common 
> server responses and log events producing JSON which can be converted into 
> fixed delimited structure to ingest into RDBMS,HDFS/Hive and any other system 
> preferring 2 dimensional tabular formats.



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


[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2016-07-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

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

https://github.com/apache/nifi/pull/254#discussion_r71981054
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONtoCSV.java
 ---
@@ -0,0 +1,360 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.standard;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.io.StreamCallback;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+@Tags({"JSON, CSV, convert"})
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@WritesAttribute(attribute="mime.type", description="Sets the mime type to 
application/csv")
+@CapabilityDescription("Converts a JSON document to CSV. This processor 
reads the entire content " +
+"of incoming FlowFiles into memory in order to perform the 
conversion. The processor will parse JSON Arrays, JSON Objects " +
+"and the combination of the two regardless of the level of nesting 
in the JSON document.")
+public class ConvertJSONtoCSV extends AbstractProcessor {
+volatile String delimiter;
+volatile String removeFields;
+volatile String emptyFields = "";
+
+public static final AllowableValue INCLUDE_HEADER_TRUE = new 
AllowableValue(
+"True", "True", "Creates headers for each JSON file.");
+public static final AllowableValue INCLUDE_HEADER_FALSE = new 
AllowableValue(
+"False", "False", "Only parses the JSON fields and does not 
include headers");
+
+
+public static final PropertyDescriptor DELIMITER = new 
PropertyDescriptor
+.Builder().name("CSV Delimiter")
+.description("Delimiter used for the generated CSV output 
(Example: , | -)")
+.required(true)
+.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+.build();
+
+public static final PropertyDescriptor REMOVE_FIELDS = new 
PropertyDescriptor
+.Builder().name("Remove JSON Fields/Columns")
+.description("Comma delimited list of columns that should be 
removed when parsing JSON and building the CSV. " +
+"This includes all top level and most granular nested 
fields/columns. By default with nothing specified every field " +
+   

[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2016-07-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

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

https://github.com/apache/nifi/pull/254#discussion_r71981046
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONtoCSV.java
 ---
@@ -0,0 +1,360 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.standard;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.io.StreamCallback;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+@Tags({"JSON, CSV, convert"})
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@WritesAttribute(attribute="mime.type", description="Sets the mime type to 
application/csv")
+@CapabilityDescription("Converts a JSON document to CSV. This processor 
reads the entire content " +
+"of incoming FlowFiles into memory in order to perform the 
conversion. The processor will parse JSON Arrays, JSON Objects " +
+"and the combination of the two regardless of the level of nesting 
in the JSON document.")
+public class ConvertJSONtoCSV extends AbstractProcessor {
+volatile String delimiter;
+volatile String removeFields;
+volatile String emptyFields = "";
+
+public static final AllowableValue INCLUDE_HEADER_TRUE = new 
AllowableValue(
+"True", "True", "Creates headers for each JSON file.");
+public static final AllowableValue INCLUDE_HEADER_FALSE = new 
AllowableValue(
+"False", "False", "Only parses the JSON fields and does not 
include headers");
+
+
+public static final PropertyDescriptor DELIMITER = new 
PropertyDescriptor
+.Builder().name("CSV Delimiter")
+.description("Delimiter used for the generated CSV output 
(Example: , | -)")
+.required(true)
+.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+.build();
+
+public static final PropertyDescriptor REMOVE_FIELDS = new 
PropertyDescriptor
+.Builder().name("Remove JSON Fields/Columns")
+.description("Comma delimited list of columns that should be 
removed when parsing JSON and building the CSV. " +
+"This includes all top level and most granular nested 
fields/columns. By default with nothing specified every field " +
+   

[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2016-07-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

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

https://github.com/apache/nifi/pull/254#discussion_r71980960
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONtoCSV.java
 ---
@@ -0,0 +1,360 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.standard;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.io.StreamCallback;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+@Tags({"JSON, CSV, convert"})
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@WritesAttribute(attribute="mime.type", description="Sets the mime type to 
application/csv")
+@CapabilityDescription("Converts a JSON document to CSV. This processor 
reads the entire content " +
+"of incoming FlowFiles into memory in order to perform the 
conversion. The processor will parse JSON Arrays, JSON Objects " +
+"and the combination of the two regardless of the level of nesting 
in the JSON document.")
+public class ConvertJSONtoCSV extends AbstractProcessor {
+volatile String delimiter;
+volatile String removeFields;
+volatile String emptyFields = "";
+
+public static final AllowableValue INCLUDE_HEADER_TRUE = new 
AllowableValue(
+"True", "True", "Creates headers for each JSON file.");
+public static final AllowableValue INCLUDE_HEADER_FALSE = new 
AllowableValue(
+"False", "False", "Only parses the JSON fields and does not 
include headers");
+
+
+public static final PropertyDescriptor DELIMITER = new 
PropertyDescriptor
+.Builder().name("CSV Delimiter")
+.description("Delimiter used for the generated CSV output 
(Example: , | -)")
+.required(true)
+.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+.build();
+
+public static final PropertyDescriptor REMOVE_FIELDS = new 
PropertyDescriptor
+.Builder().name("Remove JSON Fields/Columns")
+.description("Comma delimited list of columns that should be 
removed when parsing JSON and building the CSV. " +
+"This includes all top level and most granular nested 
fields/columns. By default with nothing specified every field " +
+   

[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2016-07-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

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

https://github.com/apache/nifi/pull/254#discussion_r71980929
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONtoCSV.java
 ---
@@ -0,0 +1,360 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.standard;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.io.StreamCallback;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+@Tags({"JSON, CSV, convert"})
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@WritesAttribute(attribute="mime.type", description="Sets the mime type to 
application/csv")
+@CapabilityDescription("Converts a JSON document to CSV. This processor 
reads the entire content " +
+"of incoming FlowFiles into memory in order to perform the 
conversion. The processor will parse JSON Arrays, JSON Objects " +
+"and the combination of the two regardless of the level of nesting 
in the JSON document.")
+public class ConvertJSONtoCSV extends AbstractProcessor {
+volatile String delimiter;
+volatile String removeFields;
+volatile String emptyFields = "";
+
+public static final AllowableValue INCLUDE_HEADER_TRUE = new 
AllowableValue(
+"True", "True", "Creates headers for each JSON file.");
+public static final AllowableValue INCLUDE_HEADER_FALSE = new 
AllowableValue(
+"False", "False", "Only parses the JSON fields and does not 
include headers");
+
+
+public static final PropertyDescriptor DELIMITER = new 
PropertyDescriptor
+.Builder().name("CSV Delimiter")
+.description("Delimiter used for the generated CSV output 
(Example: , | -)")
+.required(true)
+.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+.build();
+
+public static final PropertyDescriptor REMOVE_FIELDS = new 
PropertyDescriptor
+.Builder().name("Remove JSON Fields/Columns")
+.description("Comma delimited list of columns that should be 
removed when parsing JSON and building the CSV. " +
+"This includes all top level and most granular nested 
fields/columns. By default with nothing specified every field " +
+   

[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2016-07-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

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

https://github.com/apache/nifi/pull/254#discussion_r71980891
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONtoCSV.java
 ---
@@ -0,0 +1,360 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.standard;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.ProcessorInitializationContext;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.io.StreamCallback;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+@Tags({"JSON, CSV, convert"})
+@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
+@WritesAttribute(attribute="mime.type", description="Sets the mime type to 
application/csv")
+@CapabilityDescription("Converts a JSON document to CSV. This processor 
reads the entire content " +
+"of incoming FlowFiles into memory in order to perform the 
conversion. The processor will parse JSON Arrays, JSON Objects " +
+"and the combination of the two regardless of the level of nesting 
in the JSON document.")
+public class ConvertJSONtoCSV extends AbstractProcessor {
+volatile String delimiter;
+volatile String removeFields;
+volatile String emptyFields = "";
+
+public static final AllowableValue INCLUDE_HEADER_TRUE = new 
AllowableValue(
+"True", "True", "Creates headers for each JSON file.");
+public static final AllowableValue INCLUDE_HEADER_FALSE = new 
AllowableValue(
+"False", "False", "Only parses the JSON fields and does not 
include headers");
+
+
+public static final PropertyDescriptor DELIMITER = new 
PropertyDescriptor
+.Builder().name("CSV Delimiter")
--- End diff --

The latest convention is to include a name() that is language independent, 
with displayName() that can be more user-focusing. This is just a suggestion 
that will help with internationalization later.


> Convert JSON format to CSV
> --
>
> Key: NIFI-1583
> URL: https://issues.apache.org/jira/browse/NIFI-1583
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Core Framework
>Affects Versions: 0.4.1
>Reporter: Adis Cesir
>Priority: Minor
>
> Processor with the ability to flatten out multi nested JSON 

[jira] [Commented] (NIFI-1583) Convert JSON format to CSV

2016-07-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1583:
--

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

https://github.com/apache/nifi/pull/254#discussion_r71980828
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml ---
@@ -221,6 +221,11 @@ language governing permissions and limitations under 
the License. -->
 1.4.187
 test
 
+
+org.json
+json
--- End diff --

the standard bundle has jackson dependencies already, does this need 
org.json.json to accomplish the task?


> Convert JSON format to CSV
> --
>
> Key: NIFI-1583
> URL: https://issues.apache.org/jira/browse/NIFI-1583
> Project: Apache NiFi
>  Issue Type: Improvement
>  Components: Core Framework
>Affects Versions: 0.4.1
>Reporter: Adis Cesir
>Priority: Minor
>
> Processor with the ability to flatten out multi nested JSON Objects and 
> Arrays into tabular format / CSV. An example of a use for this is the common 
> server responses and log events producing JSON which can be converted into 
> fixed delimited structure to ingest into RDBMS,HDFS/Hive and any other system 
> preferring 2 dimensional tabular formats.



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