public class CSVMigrator extends AbstractMigrator
| Modifier and Type | Field and Description |
|---|---|
static String |
NULL_STRING |
static char |
QUOTE |
static char |
SEPARATOR |
BATCH_SIZE| Constructor and Description |
|---|
CSVMigrator(String template,
File file)
Construct a CSVMigrator to migrate data in the given file
|
CSVMigrator(String template,
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<InsertQuery> |
migrate()
Each String in the stream is a CSV file
|
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
|
registerMacro, stream, template, validValuepublic static final char SEPARATOR
public static final char QUOTE
public static final String NULL_STRING
public CSVMigrator(String template, File file)
template - parametrized graql insert queryfile - file with the data to be migratedpublic 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<InsertQuery> migrate()
public void close()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.