All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.flink.api.java.io.CsvReader Maven / Gradle / Ivy

There is a newer version: 1.20.0
Show newest version
/*
 * 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.flink.api.java.io;

import java.util.ArrayList;
import java.util.Arrays;

import org.apache.commons.lang3.Validate;

import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.core.fs.Path;

//CHECKSTYLE.OFF: AvoidStarImport - Needed for TupleGenerator
import org.apache.flink.api.java.tuple.*;
//CHECKSTYLE.ON: AvoidStarImport

/**
 * A builder class to instantiate a CSV parsing data source. The CSV reader configures the field types,
 * the delimiters (row and field),  the fields that should be included or skipped, and other flags
 * such as whether to skip the initial line as the header.
 */
public class CsvReader {

	private final Path path;
	
	private final ExecutionEnvironment executionContext;
	
	
	protected boolean[] includedMask;
	
	protected String lineDelimiter = CsvInputFormat.DEFAULT_LINE_DELIMITER;
	
	protected char fieldDelimiter = CsvInputFormat.DEFAULT_FIELD_DELIMITER;

	protected boolean skipFirstLineAsHeader = false;
	
	// --------------------------------------------------------------------------------------------
	
	public CsvReader(Path filePath, ExecutionEnvironment executionContext) {
		Validate.notNull(filePath, "The file path may not be null.");
		Validate.notNull(executionContext, "The execution context may not be null.");
		
		this.path = filePath;
		this.executionContext = executionContext;
	}
	
	public CsvReader(String filePath, ExecutionEnvironment executionContext) {
		this(new Path(Validate.notNull(filePath, "The file path may not be null.")), executionContext);
	}
	
	public Path getFilePath() {
		return this.path;
	}
	
	// --------------------------------------------------------------------------------------------
	
	/**
	 * Configures the delimiter that separates the lines/rows. The linebreak character
	 * ({@code '\n'}) is used by default.
	 * 
	 * @param delimiter The delimiter that separates the rows.
	 * @return The CSV reader instance itself, to allow for fluent function chaining.
	 */
	public CsvReader lineDelimiter(String delimiter) {
		if (delimiter == null || delimiter.length() == 0) {
			throw new IllegalArgumentException("The delimiter must not be null or an empty string");
		}
		
		this.lineDelimiter = delimiter;
		return this;
	}
	
	/**
	 * Configures the delimiter that separates the fields within a row. The comma character
	 * ({@code ','}) is used by default.
	 * 
	 * @param delimiter The delimiter that separates the fields in one row.
	 * @return The CSV reader instance itself, to allow for fluent function chaining.
	 */
	public CsvReader fieldDelimiter(char delimiter) {
		this.fieldDelimiter = delimiter;
		return this;
	}
	
	/**
	 * Configures which fields of the CSV file should be included and which should be skipped. The
	 * parser will look at the first {@code n} fields, where {@code n} is the length of the boolean
	 * array. The parser will skip over all fields where the boolean value at the corresponding position
	 * in the array is {@code false}. The result contains the fields where the corresponding position in
	 * the boolean array is {@code true}.
	 * The number of fields in the result is consequently equal to the number of times that {@code true}
	 * occurs in the fields array.
	 * 
	 * @param fields The array of flags that describes which fields are to be included and which not.
	 * @return The CSV reader instance itself, to allow for fluent function chaining.
	 */
	public CsvReader includeFields(boolean ... fields) {
		if (fields == null || fields.length == 0) {
			throw new IllegalArgumentException("The set of included fields must not be null or empty.");
		}
		
		int lastTruePos = -1;
		for (int i = 0; i < fields.length; i++) {
			if (fields[i]) {
				lastTruePos = i;
			}
		}
		
		if (lastTruePos == -1) {
			throw new IllegalArgumentException("The description of fields to parse excluded all fields. At least one fields must be included.");
		}
		if (lastTruePos == fields.length - 1) {
			this.includedMask = fields;
		} else {
			this.includedMask = Arrays.copyOfRange(fields, 0, lastTruePos + 1);
		}
		return this;
	}

	/**
	 * Configures which fields of the CSV file should be included and which should be skipped. The
	 * positions in the string (read from position 0 to its length) define whether the field at
	 * the corresponding position in the CSV schema should be included.
	 * parser will look at the first {@code n} fields, where {@code n} is the length of the mask string
	 * The parser will skip over all fields where the character at the corresponding position
	 * in the string is {@code '0'}, {@code 'F'}, or {@code 'f'} (representing the value
	 * {@code false}). The result contains the fields where the corresponding position in
	 * the boolean array is {@code '1'}, {@code 'T'}, or {@code 't'} (representing the value {@code true}).
	 * 
	 * @param mask The string mask defining which fields to include and which to skip.
	 * @return The CSV reader instance itself, to allow for fluent function chaining.
	 */
	public CsvReader includeFields(String mask) {
		boolean[] includedMask = new boolean[mask.length()];
		
		for (int i = 0; i < mask.length(); i++) {
			char c = mask.charAt(i);
			if (c == '1' || c == 'T' || c == 't') {
				includedMask[i] = true;
			} else if (c != '0' && c != 'F' && c != 'f') {
				throw new IllegalArgumentException("Mask string may contain only '0' and '1'.");
			}
		}
		
		return includeFields(includedMask);
	}
	
	/**
	 * Configures which fields of the CSV file should be included and which should be skipped. The
	 * bits in the value (read from least significant to most significant) define whether the field at
	 * the corresponding position in the CSV schema should be included.
	 * parser will look at the first {@code n} fields, where {@code n} is the position of the most significant
	 * non-zero bit.
	 * The parser will skip over all fields where the character at the corresponding bit is zero, and
	 * include the fields where the corresponding bit is one.
	 * 

* Examples: *

    *
  • A mask of {@code 0x7} would include the first three fields.
  • *
  • A mask of {@code 0x26} (binary {@code 100110} would skip the first fields, include fields * two and three, skip fields four and five, and include field six.
  • *
* * @param mask The bit mask defining which fields to include and which to skip. * @return The CSV reader instance itself, to allow for fluent function chaining. */ public CsvReader includeFields(long mask) { if (mask == 0) { throw new IllegalArgumentException("The description of fields to parse excluded all fields. At least one fields must be included."); } ArrayList fields = new ArrayList(); while (mask != 0) { fields.add((mask & 0x1L) != 0); mask >>>= 1; } boolean[] fieldsArray = new boolean[fields.size()]; for (int i = 0; i < fieldsArray.length; i++) { fieldsArray[i] = fields.get(i); } return includeFields(fieldsArray); } /** * Sets the CSV reader to ignore the first line. This is useful for files that contain a header line. * * @return The CSV reader instance itself, to allow for fluent function chaining. */ public CsvReader ignoreFirstLine() { skipFirstLineAsHeader = true; return this; } /** * Configures the reader to read the CSV data and parse it to the given type. The type must be a subclass of * {@link Tuple}. The type information for the fields is obtained from the type class. The type * consequently needs to specify all generic field types of the tuple. * * @param targetType The class of the target type, needs to be a subclass of Tuple. * @return The DataSet representing the parsed CSV data. */ public DataSource tupleType(Class targetType) { Validate.notNull(targetType, "The target type class must not be null."); if (!Tuple.class.isAssignableFrom(targetType)) { throw new IllegalArgumentException("The target type must be a subclass of " + Tuple.class.getName()); } @SuppressWarnings("unchecked") TupleTypeInfo typeInfo = (TupleTypeInfo) TypeExtractor.createTypeInfo(targetType); CsvInputFormat inputFormat = new CsvInputFormat(path); Class[] classes = new Class[typeInfo.getArity()]; for (int i = 0; i < typeInfo.getArity(); i++) { classes[i] = typeInfo.getTypeAt(i).getTypeClass(); } configureInputFormat(inputFormat, classes); return new DataSource(executionContext, inputFormat, typeInfo); } // -------------------------------------------------------------------------------------------- // Miscellaneous // -------------------------------------------------------------------------------------------- private void configureInputFormat(CsvInputFormat format, Class... types) { format.setDelimiter(this.lineDelimiter); format.setFieldDelimiter(this.fieldDelimiter); format.setSkipFirstLineAsHeader(skipFirstLineAsHeader); if (this.includedMask == null) { format.setFieldTypes(types); } else { format.setFields(this.includedMask, types); } } // -------------------------------------------------------------------------------------------- // The following lines are generated. // -------------------------------------------------------------------------------------------- // BEGIN_OF_TUPLE_DEPENDENT_CODE // GENERATED FROM org.apache.flink.api.java.tuple.TupleGenerator. /** * Specifies the types for the CSV fields. This method parses the CSV data to a 1-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 2-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 3-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 4-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 5-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 6-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 7-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 8-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 9-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 10-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 11-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 12-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 13-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 14-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 15-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 16-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 17-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 18-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 19-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @param type18 The type of CSV field 18 and the type of field 18 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17, Class type18) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 20-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @param type18 The type of CSV field 18 and the type of field 18 in the returned tuple type. * @param type19 The type of CSV field 19 and the type of field 19 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17, Class type18, Class type19) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 21-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @param type18 The type of CSV field 18 and the type of field 18 in the returned tuple type. * @param type19 The type of CSV field 19 and the type of field 19 in the returned tuple type. * @param type20 The type of CSV field 20 and the type of field 20 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17, Class type18, Class type19, Class type20) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 22-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @param type18 The type of CSV field 18 and the type of field 18 in the returned tuple type. * @param type19 The type of CSV field 19 and the type of field 19 in the returned tuple type. * @param type20 The type of CSV field 20 and the type of field 20 in the returned tuple type. * @param type21 The type of CSV field 21 and the type of field 21 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17, Class type18, Class type19, Class type20, Class type21) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 23-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @param type18 The type of CSV field 18 and the type of field 18 in the returned tuple type. * @param type19 The type of CSV field 19 and the type of field 19 in the returned tuple type. * @param type20 The type of CSV field 20 and the type of field 20 in the returned tuple type. * @param type21 The type of CSV field 21 and the type of field 21 in the returned tuple type. * @param type22 The type of CSV field 22 and the type of field 22 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17, Class type18, Class type19, Class type20, Class type21, Class type22) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 24-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @param type18 The type of CSV field 18 and the type of field 18 in the returned tuple type. * @param type19 The type of CSV field 19 and the type of field 19 in the returned tuple type. * @param type20 The type of CSV field 20 and the type of field 20 in the returned tuple type. * @param type21 The type of CSV field 21 and the type of field 21 in the returned tuple type. * @param type22 The type of CSV field 22 and the type of field 22 in the returned tuple type. * @param type23 The type of CSV field 23 and the type of field 23 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17, Class type18, Class type19, Class type20, Class type21, Class type22, Class type23) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23); return new DataSource>(executionContext, inputFormat, types); } /** * Specifies the types for the CSV fields. This method parses the CSV data to a 25-tuple * which has fields of the specified types. * This method is overloaded for each possible length of the tuples to support type safe * creation of data sets through CSV parsing. * * @param type0 The type of CSV field 0 and the type of field 0 in the returned tuple type. * @param type1 The type of CSV field 1 and the type of field 1 in the returned tuple type. * @param type2 The type of CSV field 2 and the type of field 2 in the returned tuple type. * @param type3 The type of CSV field 3 and the type of field 3 in the returned tuple type. * @param type4 The type of CSV field 4 and the type of field 4 in the returned tuple type. * @param type5 The type of CSV field 5 and the type of field 5 in the returned tuple type. * @param type6 The type of CSV field 6 and the type of field 6 in the returned tuple type. * @param type7 The type of CSV field 7 and the type of field 7 in the returned tuple type. * @param type8 The type of CSV field 8 and the type of field 8 in the returned tuple type. * @param type9 The type of CSV field 9 and the type of field 9 in the returned tuple type. * @param type10 The type of CSV field 10 and the type of field 10 in the returned tuple type. * @param type11 The type of CSV field 11 and the type of field 11 in the returned tuple type. * @param type12 The type of CSV field 12 and the type of field 12 in the returned tuple type. * @param type13 The type of CSV field 13 and the type of field 13 in the returned tuple type. * @param type14 The type of CSV field 14 and the type of field 14 in the returned tuple type. * @param type15 The type of CSV field 15 and the type of field 15 in the returned tuple type. * @param type16 The type of CSV field 16 and the type of field 16 in the returned tuple type. * @param type17 The type of CSV field 17 and the type of field 17 in the returned tuple type. * @param type18 The type of CSV field 18 and the type of field 18 in the returned tuple type. * @param type19 The type of CSV field 19 and the type of field 19 in the returned tuple type. * @param type20 The type of CSV field 20 and the type of field 20 in the returned tuple type. * @param type21 The type of CSV field 21 and the type of field 21 in the returned tuple type. * @param type22 The type of CSV field 22 and the type of field 22 in the returned tuple type. * @param type23 The type of CSV field 23 and the type of field 23 in the returned tuple type. * @param type24 The type of CSV field 24 and the type of field 24 in the returned tuple type. * @return The {@link org.apache.flink.api.java.DataSet} representing the parsed CSV data. */ public DataSource> types(Class type0, Class type1, Class type2, Class type3, Class type4, Class type5, Class type6, Class type7, Class type8, Class type9, Class type10, Class type11, Class type12, Class type13, Class type14, Class type15, Class type16, Class type17, Class type18, Class type19, Class type20, Class type21, Class type22, Class type23, Class type24) { TupleTypeInfo> types = TupleTypeInfo.getBasicTupleTypeInfo(type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24); CsvInputFormat> inputFormat = new CsvInputFormat>(path); configureInputFormat(inputFormat, type0, type1, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24); return new DataSource>(executionContext, inputFormat, types); } // END_OF_TUPLE_DEPENDENT_CODE }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy