public static class JsonFileSystemFormatFactory.JsonInputFormat extends DelimitedInputFormat<RowData>
JsonFileSystemFormatFactory.JsonInputFormat
is responsible to read RowData
records from json format
files.FileInputFormat.FileBaseStatistics, FileInputFormat.InputSplitOpenThread
currBuffer, currLen, currOffset, RECORD_DELIMITER
currentSplit, ENUMERATE_NESTED_FILES_FLAG, enumerateNestedFiles, filePath, INFLATER_INPUT_STREAM_FACTORIES, minSplitSize, numSplits, openTimeout, READ_WHOLE_SPLIT_FLAG, splitLength, splitStart, stream, unsplittable
Constructor and Description |
---|
JsonInputFormat(Path[] filePaths,
DataType[] fieldTypes,
String[] fieldNames,
int[] selectFields,
List<String> partitionKeys,
String defaultPartValue,
long limit,
int[] jsonSelectFieldToProjectFieldMapping,
int[] jsonSelectFieldToJsonFieldMapping,
JsonRowDataDeserializationSchema deserializationSchema) |
Modifier and Type | Method and Description |
---|---|
RowData |
nextRecord(RowData record)
Reads the next record from the input.
|
void |
open(FileInputSplit split)
Opens the given input split.
|
boolean |
reachedEnd()
Checks whether the current split is at its end.
|
RowData |
readRecord(RowData reuse,
byte[] bytes,
int offset,
int numBytes)
This function parses the given byte array which represents a serialized record.
|
boolean |
supportsMultiPaths()
Override this method to supports multiple paths.
|
close, configure, getBufferSize, getCharset, getCurrentState, getDelimiter, getLineLengthLimit, getNumLineSamples, getStatistics, initializeSplit, loadConfigParameters, loadGlobalConfigParams, readLine, reopen, setBufferSize, setCharset, setDelimiter, setDelimiter, setDelimiter, setLineLengthLimit, setNumLineSamples
acceptFile, createInputSplits, decorateInputStream, extractFileExtension, getFilePath, getFilePaths, getFileStats, getFileStats, getInflaterInputStreamFactory, getInputSplitAssigner, getMinSplitSize, getNestedFileEnumeration, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, registerInflaterInputStreamFactory, setFilePath, setFilePath, setFilePaths, setFilePaths, setFilesFilter, setMinSplitSize, setNestedFileEnumeration, setNumSplits, setOpenTimeout, testForUnsplittable, toString
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
public JsonInputFormat(Path[] filePaths, DataType[] fieldTypes, String[] fieldNames, int[] selectFields, List<String> partitionKeys, String defaultPartValue, long limit, int[] jsonSelectFieldToProjectFieldMapping, int[] jsonSelectFieldToJsonFieldMapping, JsonRowDataDeserializationSchema deserializationSchema)
public boolean supportsMultiPaths()
FileInputFormat
supportsMultiPaths
in class FileInputFormat<RowData>
public void open(FileInputSplit split) throws IOException
DelimitedInputFormat
open
in interface InputFormat<RowData,FileInputSplit>
open
in class DelimitedInputFormat<RowData>
split
- The input split to open.IOException
- Thrown, if the spit could not be opened due to an I/O problem.FileInputFormat.open(org.apache.flink.core.fs.FileInputSplit)
public boolean reachedEnd()
DelimitedInputFormat
reachedEnd
in interface InputFormat<RowData,FileInputSplit>
reachedEnd
in class DelimitedInputFormat<RowData>
public RowData readRecord(RowData reuse, byte[] bytes, int offset, int numBytes) throws IOException
DelimitedInputFormat
readRecord
in class DelimitedInputFormat<RowData>
reuse
- An optionally reusable object.bytes
- Binary data of serialized records.offset
- The offset where to start to read the record data.numBytes
- The number of bytes that can be read starting at the offset position.IOException
- if the record could not be read.public RowData nextRecord(RowData record) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
nextRecord
in interface InputFormat<RowData,FileInputSplit>
nextRecord
in class DelimitedInputFormat<RowData>
record
- Object that may be reused.IOException
- Thrown, if an I/O error occurred.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.