Class UnivocityUtils

java.lang.Object
org.aksw.commons.model.csvw.univocity.UnivocityUtils

public class UnivocityUtils extends Object
  • 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:
      path - A path to a csv file
      fileSystem - The hadoop filesystem
      parserFactory - A factory for creating parsers over an input stream
      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 streams
      parserFactory - A factory for creating parsers over an input stream
      Returns:
      A cold flowable over the csv data