public class CSVMigrator extends Object implements AutoCloseable
| Constructor and Description |
|---|
CSVMigrator(File file)
Construct a CSVMigrator to migrate data in the given file
|
CSVMigrator(Reader reader)
Construct a CSVMigrator to migrate data in the given Reader
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader
|
java.util.stream.Stream<Map<String,Object>> |
convert()
Each String in the stream is a CSV file
|
static void |
main(String[] args) |
CSVMigrator |
setNullString(String nullString)
Set string that will be evaluated as null
|
CSVMigrator |
setQuoteChar(char quote)
Set character used to encapsulate values containing special characters.
|
CSVMigrator |
setSeparator(char separator)
Set separator the input file will be split on
|
protected <T> java.util.stream.Stream<T> |
stream(Iterator<T> iterator)
Partition a stream into a stream of collections, each with batchSize elements.
|
public CSVMigrator(File file)
file - file with the data to be migratedpublic CSVMigrator(Reader reader)
reader - reader over the data to be migratedpublic static void main(String[] args)
public CSVMigrator setSeparator(char separator)
separator - character separating columns in inputpublic CSVMigrator setQuoteChar(char quote)
quote - the quote characterpublic CSVMigrator setNullString(String nullString)
nullString - string that will be evaluated as null, if null, everything will be
evaluated as a stringpublic java.util.stream.Stream<Map<String,Object>> convert()
public void close()
close in interface AutoCloseableprotected <T> java.util.stream.Stream<T> stream(Iterator<T> iterator)
T - Type of values of iteratoriterator - Iterator to partitionCopyright © 2017 Grakn Labs Ltd. All rights reserved.