nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] nifi pull request: NIFI-1280 Create FilterCSVColumns Processor.
Date Wed, 11 May 2016 14:33:52 GMT
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/420#discussion_r62859193
  
    --- 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 <E> Row type
    + */
    +class CsvEnumerator2<E> implements Enumerator<E> {
    --- End diff --
    
    > Yes, It’s modified Calcite CSV adapter. Current Calcite adapter supports only reading
from java.io.File So CSV adapter is modified to support reading from java.io.InputStream
    
    A name that represents what this does and a class-level javadoc is always great to capture
this information :).
    
    I reread Julian's comments, trying to reconcile what he suggested with what you have here.
I think the context in which you're using calcite is probably safe (the processor driving
things). Neat approach.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message