Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F1F8310E06 for ; Sat, 22 Nov 2014 23:29:33 +0000 (UTC) Received: (qmail 14037 invoked by uid 500); 22 Nov 2014 23:29:33 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 13996 invoked by uid 500); 22 Nov 2014 23:29:33 -0000 Mailing-List: contact issues-help@flink.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.incubator.apache.org Delivered-To: mailing list issues@flink.incubator.apache.org Received: (qmail 13987 invoked by uid 99); 22 Nov 2014 23:29:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Nov 2014 23:29:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 22 Nov 2014 23:29:32 +0000 Received: (qmail 13960 invoked by uid 99); 22 Nov 2014 23:29:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Nov 2014 23:29:12 +0000 Date: Sat, 22 Nov 2014 23:29:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-1208) Skip comment lines in CSV input format. Allow user to specify comment character. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/FLINK-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14222248#comment-14222248 ] ASF GitHub Bot commented on FLINK-1208: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/incubator-flink/pull/201#discussion_r20760689 --- Diff: flink-java/src/main/java/org/apache/flink/api/java/io/CsvInputFormat.java --- @@ -130,6 +216,21 @@ public OUT readRecord(OUT reuse, byte[] bytes, int offset, int numBytes) { numBytes--; } + if (commentPrefix != null && commentPrefix.length <= numBytes) { + //check record for comments + Boolean isComment = true; + for (int i = 0; i < commentPrefix.length; i++) { + if (commentPrefix[i] != bytes[offset + i]) { + isComment = false; + break; + } + } + if (isComment) { + this.commentCount++; + return nextRecord(reuse); --- End diff -- My intention was to capture the null in the DelimitedInputFormat before it is given to the DataSourceTask. > Skip comment lines in CSV input format. Allow user to specify comment character. > -------------------------------------------------------------------------------- > > Key: FLINK-1208 > URL: https://issues.apache.org/jira/browse/FLINK-1208 > Project: Flink > Issue Type: Improvement > Components: Java API, Scala API > Affects Versions: 0.8-incubating > Reporter: Aljoscha Krettek > Assignee: Felix Neutatz > Priority: Minor > Labels: starter > > The current skipFirstLine is limited. Skipping arbitrary lines that start with a certain character would be much more flexible while still easy to implement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)