Class CsvImport

java.lang.Object
com.illumon.iris.importers.util.ImportBase
com.illumon.iris.importers.util.CsvImport

public class CsvImport extends ImportBase
Tools for programmatically executing CSV batch imports.
  • Field Details

    • log

      public static final com.fishlib.io.logger.Logger log
  • Method Details

    • builder

      @Deprecated @ScriptApi public static CsvImportBuilder builder(@NotNull String namespace, @NotNull String table)
      Deprecated.
      Creates a new CsvImportBuilder to configure an CSV importer that pulls data from a set of files on disk.
      Parameters:
      namespace - The String name of the namespace into which data will be imported.
      table - The String name of the table into which data will be imported.
      Returns:
      A new CsvImportBuilder.
    • fromFiles

      @ScriptApi public static CsvImportBuilder fromFiles(@NotNull String namespace, @NotNull String table)
      Creates a new CsvImportBuilder to configure an CSV importer that pulls data from a set of files on disk.
      Parameters:
      namespace - The String name of the namespace into which data will be imported.
      table - The String name of the table into which data will be imported.
      Returns:
      A new CsvImportBuilder.
    • fromStream

      @ScriptApi public static CsvImportBuilder fromStream(@NotNull String namespace, @NotNull String table, @NotNull InputStream stream)
      Creates a new CsvImportBuilder to configure an CSV importer that pulls data from a specific InputStream.
      Parameters:
      namespace - The String name of the namespace into which data will be imported.
      table - The String name of the table into which data will be imported.
      Returns:
      A new CsvImportBuilder.
    • run

      public long run() throws IOException
      Executes a CSV batch import as configured for the CsvImport object.
      Specified by:
      run in class ImportBase
      Returns:
      A long of the number of rows imported.
      Throws:
      IOException - If the import cannot be executed or fails during processing.