Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A0252200AE4 for ; Wed, 11 May 2016 03:24:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9EC82160A11; Wed, 11 May 2016 01:24:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E8E3616098A for ; Wed, 11 May 2016 03:24:13 +0200 (CEST) Received: (qmail 14923 invoked by uid 500); 11 May 2016 01:24:13 -0000 Mailing-List: contact commits-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list commits@nifi.apache.org Received: (qmail 14909 invoked by uid 99); 11 May 2016 01:24:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2016 01:24:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E939D2C033A for ; Wed, 11 May 2016 01:24:12 +0000 (UTC) Date: Wed, 11 May 2016 01:24:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@nifi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NIFI-1280) Create FilterCSVColumns Processor MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 11 May 2016 01:24:14 -0000 [ https://issues.apache.org/jira/browse/NIFI-1280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15279350#comment-15279350 ] ASF GitHub Bot commented on NIFI-1280: -------------------------------------- Github user zinking commented on a diff in the pull request: https://github.com/apache/nifi/pull/420#discussion_r62780338 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/calcite/adapter/csv/CsvEnumerator2.java --- @@ -0,0 +1,303 @@ +/* + * 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.calcite.adapter.csv; + +import java.io.IOException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; + +import org.apache.calcite.adapter.java.JavaTypeFactory; +import org.apache.calcite.linq4j.Enumerator; +import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.util.Pair; +import org.apache.commons.lang3.time.FastDateFormat; + +import au.com.bytecode.opencsv.CSVReader; + + +/** Enumerator that reads from a CSV stream. + * + * @param Row type + */ +class CsvEnumerator2 implements Enumerator { --- End diff -- why CsvEnumerator2, isn't there a better name? > Create FilterCSVColumns Processor > --------------------------------- > > Key: NIFI-1280 > URL: https://issues.apache.org/jira/browse/NIFI-1280 > Project: Apache NiFi > Issue Type: Task > Components: Extensions > Reporter: Mark Payne > Assignee: Toivo Adams > > We should have a Processor that allows users to easily filter out specific columns from CSV data. For instance, a user would configure two different properties: "Columns of Interest" (a comma-separated list of column indexes) and "Filtering Strategy" (Keep Only These Columns, Remove Only These Columns). > We can do this today with ReplaceText, but it is far more difficult than it would be with this Processor, as the user has to use Regular Expressions, etc. with ReplaceText. > Eventually a Custom UI could even be built that allows a user to upload a Sample CSV and choose which columns from there, similar to the way that Excel works when importing CSV by dragging and selecting the desired columns? That would certainly be a larger undertaking and would not need to be done for an initial implementation. -- This message was sent by Atlassian JIRA (v6.3.4#6332)