Class UnivocityUtils
java.lang.Object
org.aksw.commons.model.csvw.univocity.UnivocityUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.univocity.parsers.csv.CsvFormatdetectFormat(com.univocity.parsers.csv.CsvParser parser, Supplier<Reader> readerSupp) static booleanisDetectionNeeded(com.univocity.parsers.common.CommonParserSettings<?> settings) static booleanisDetectionNeeded(com.univocity.parsers.csv.CsvParserSettings settings) static <T> Stream<T> readCsvElements(Callable<? extends InputStream> inSupp, UnivocityParserFactory parserFactory, Function<com.univocity.parsers.common.AbstractParser<?>, T> extractElement) Create a stream to a CSV file from a supplier of input streamsstatic Stream<com.univocity.parsers.common.record.Record> readCsvRecords(Callable<? extends InputStream> inputStreamFactory, UnivocityParserFactory parserFactory) Create a flowable to a CSV file via hadoop.readCsvRows(Callable<? extends InputStream> inputStreamFactory, UnivocityParserFactory parserFactory)
-
Constructor Details
-
UnivocityUtils
public UnivocityUtils()
-
-
Method Details
-
isDetectionNeeded
public static boolean isDetectionNeeded(com.univocity.parsers.csv.CsvParserSettings settings) -
isDetectionNeeded
public static boolean isDetectionNeeded(com.univocity.parsers.common.CommonParserSettings<?> settings) -
detectFormat
public static com.univocity.parsers.csv.CsvFormat detectFormat(com.univocity.parsers.csv.CsvParser parser, Supplier<Reader> readerSupp) throws IOException - Throws:
IOException
-
readCsvRecords
public static Stream<com.univocity.parsers.common.record.Record> readCsvRecords(Callable<? extends InputStream> inputStreamFactory, UnivocityParserFactory parserFactory) Create a flowable to a CSV file via hadoop. Allows for retrieval of headers.- Parameters:
parserFactory- A factory for creating parsers over an input streampath- A path to a csv filefileSystem- The hadoop filesystem- Returns:
- A cold flowable over the csv data
-
readCsvRows
public static Stream<String[]> readCsvRows(Callable<? extends InputStream> inputStreamFactory, UnivocityParserFactory parserFactory) -
readCsvElements
public static <T> Stream<T> readCsvElements(Callable<? extends InputStream> inSupp, UnivocityParserFactory parserFactory, Function<com.univocity.parsers.common.AbstractParser<?>, T> extractElement) Create a stream to a CSV file from a supplier of input streams- Parameters:
inSupp- A supplier of input streamsparserFactory- A factory for creating parsers over an input stream- Returns:
- A cold flowable over the csv data
-