@Deprecated @PublicEvolving public class ScalaCsvOutputFormat<T extends scala.Product> extends FileOutputFormat<T> implements InputTypeConfigurable
FileOutputFormat.OutputDirectoryMode
OutputFormat.InitializationContext
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FIELD_DELIMITER
Deprecated.
|
static String |
DEFAULT_LINE_DELIMITER
Deprecated.
|
FILE_PARAMETER_KEY, outputFilePath, stream
Constructor and Description |
---|
ScalaCsvOutputFormat(Path outputPath)
Deprecated.
Creates an instance of CsvOutputFormat.
|
ScalaCsvOutputFormat(Path outputPath,
String fieldDelimiter)
Deprecated.
Creates an instance of CsvOutputFormat.
|
ScalaCsvOutputFormat(Path outputPath,
String recordDelimiter,
String fieldDelimiter)
Deprecated.
Creates an instance of CsvOutputFormat.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
Method that marks the end of the life-cycle of parallel output instance.
|
void |
open(int taskNumber,
int numTasks)
Deprecated.
Opens a parallel instance of the output format to store the result of its parallel instance.
|
void |
setAllowNullValues(boolean allowNulls)
Deprecated.
Configures the format to either allow null values (writing an empty field), or to throw an
exception when encountering a null field.
|
void |
setCharsetName(String charsetName)
Deprecated.
Sets the charset with which the CSV strings are written to the file.
|
void |
setInputType(TypeInformation<?> type,
ExecutionConfig executionConfig)
Deprecated.
The purpose of this method is solely to check whether the data type to be processed is in
fact a tuple type.
|
void |
setQuoteStrings(boolean quoteStrings)
Deprecated.
Configures whether the output format should quote string values.
|
String |
toString()
Deprecated.
|
void |
writeRecord(T element)
Deprecated.
Adds a record to the output.
|
configure, getDirectoryFileName, getOutputDirectoryMode, getOutputFilePath, getWriteMode, initDefaultsFromConfiguration, initializeGlobal, setOutputDirectoryMode, setOutputFilePath, setWriteMode, tryCleanupOnError
getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
open
public static final String DEFAULT_LINE_DELIMITER
public static final String DEFAULT_FIELD_DELIMITER
public ScalaCsvOutputFormat(Path outputPath)
outputPath
- The path where the CSV file is written.public ScalaCsvOutputFormat(Path outputPath, String fieldDelimiter)
outputPath
- The path where the CSV file is written.fieldDelimiter
- The delimiter that is used to separate fields in a tuple.public ScalaCsvOutputFormat(Path outputPath, String recordDelimiter, String fieldDelimiter)
outputPath
- The path where the CSV file is written.recordDelimiter
- The delimiter that is used to separate the tuples.fieldDelimiter
- The delimiter that is used to separate fields in a tuple.public void setAllowNullValues(boolean allowNulls)
By default, null values are allowed.
allowNulls
- Flag to indicate whether the output format should accept null values.public void setCharsetName(String charsetName)
charsetName
- The name of charset to use for encoding the output.public void setQuoteStrings(boolean quoteStrings)
String
and StringValue
, as well as all subclasses
of the latter.
By default, strings are not quoted.
quoteStrings
- Flag indicating whether string fields should be quoted.public void open(int taskNumber, int numTasks) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be configured.
open
in interface OutputFormat<T extends scala.Product>
open
in class FileOutputFormat<T extends scala.Product>
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.IOException
- Thrown, if the output could not be opened due to an I/O problem.public void close() throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
close
in interface OutputFormat<T extends scala.Product>
close
in class FileOutputFormat<T extends scala.Product>
IOException
- Thrown, if the input could not be closed properly.public void writeRecord(T element) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
writeRecord
in interface OutputFormat<T extends scala.Product>
element
- The records to add to the output.IOException
- Thrown, if the records could not be added due to an I/O problem.public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig)
setInputType
in interface InputTypeConfigurable
type
- The data type of the input.executionConfig
- The execution config for this parallel execution.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.