public enum DataFrameFactory extends Enum<DataFrameFactory>
DataFrames.| Modifier and Type | Method and Description |
|---|---|
static DataFrame |
create(Column<?>[] columns,
String[] columnNames)
|
static DataFrame |
create(Column<?>[] columns,
String[] columnNames,
String keyColumnName)
|
static DataFrame |
create(LinkedHashMap<String,Column<?>> columnMap)
|
static DataFrame |
create(LinkedHashMap<String,Column<?>> columnMap,
String keyColumnName)
|
static DataFrame |
create(List<Column<?>> columns,
List<String> columnNames)
|
static DataFrame |
create(List<Column<?>> columns,
List<String> columnNames,
String keyColumnName)
|
static DataFrame |
readCsvFrom(File file,
ReadCsvConfig config)
Read a dataframe from a CSV file.
|
static DataFrame |
readCsvFrom(InputStream is,
ReadCsvConfig config)
Read a dataframe in CSV format from the specified
InputStream. |
static DataFrame |
readFrom(File file)
Load a dataframe from a file created via
DataFrame.writeTo(File). |
static DataFrame |
readFrom(ReadableByteChannel channel)
Read a dataframe from the specified
ReadableByteChannel. |
static DataFrame |
readFrom(ResultSet rs,
ReadFromDbConfig config)
Read a dataframe from the specified
ResultSet according to the
specified configuration. |
static DataFrameFactory |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataFrameFactory[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static DataFrameFactory[] values()
for (DataFrameFactory c : DataFrameFactory.values()) System.out.println(c);
public static DataFrameFactory valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static DataFrame create(LinkedHashMap<String,Column<?>> columnMap, String keyColumnName)
DataFrame where the column names and columns
are provided as ordered entries in columnMap, and with the specified
key column name.columnMap - - specifies the columns and column nameskeyColumnName - - the key column name, must be present in as a key in
columnMap. Can be null.DataFrame where the column names and columns are
provided as ordered entries in columnMap.IllegalArgumentException - if:
columnMap is empty
columnMap contains any null keys
or values
keyColumnName is not null and is
either not present as a key in
columnMap, or refers to a column
which is not a unique index
public static DataFrame create(LinkedHashMap<String,Column<?>> columnMap)
DataFrame where the column names and columns
are provided as ordered entries in columnMap.columnMap - - specifies the columns and column namesDataFrame where the column names and columns are
provided as ordered entries in columnMap.IllegalArgumentException - if:
columnMap is empty
columnMap contains any null keys
or values
public static DataFrame create(Column<?>[] columns, String[] columnNames, String keyColumnName)
columns - - the columnscolumnNames - - the column nameskeyColumnName - - the key column name, must be present in
columnNames. Can be null.DataFrame with the specified columns and column
names.IllegalArgumentException - if:
keyColumnName is not null and is
either not present in columnNames,
or refers to a column which is not a unique
index
public static DataFrame create(Column<?>[] columns, String[] columnNames)
columns - - the columnscolumnNames - - the column namesDataFrame with the specified columns and column
names.IllegalArgumentException - if:
public static DataFrame create(List<Column<?>> columns, List<String> columnNames, String keyColumnName)
columns - - the columnscolumnNames - - the column nameskeyColumnName - - the key column name, must be present in
columnNames. Can be null.DataFrame with the specified columns and column
names.IllegalArgumentException - if:
keyColumnName is not null and is
either not present in columnNames,
or refers to a column which is not a unique
index
public static DataFrame create(List<Column<?>> columns, List<String> columnNames)
columns - - the columnscolumnNames - - the column namesDataFrame with the specified columns and column
names.IllegalArgumentException - if:
public static DataFrame readFrom(File file) throws IOException
DataFrame.writeTo(File).file - - the file to read fromIOException - if some I/O error occurspublic static DataFrame readFrom(ReadableByteChannel channel) throws IOException
ReadableByteChannel.channel - - the channel to read fromIOException - if some I/O error occurspublic static DataFrame readCsvFrom(File file, ReadCsvConfig config) throws IOException
file - - the file containing the CVS dataconfig - - configuration for parsing the CSV file. See
ReadCsvConfig.IOException - if some I/O error occursRuntimeException - if there is any other error parsing the CVS fileReadCsvConfigpublic static DataFrame readCsvFrom(InputStream is, ReadCsvConfig config) throws IOException
InputStream. The
CSV must adhere to RFC
4180, with the following exceptions:
is - - the InputStream containing the CSV dataconfig - - configuration for parsing the CSV file. See
ReadCsvConfig.IOException - if some I/O error occursRuntimeException - if there is any other error parsing the CVS fileReadCsvConfigpublic static DataFrame readFrom(ResultSet rs, ReadFromDbConfig config) throws SQLException
ResultSet according to the
specified configuration.rs - - a ResultSetconfig - - a configuration containing
per-column logic for getting fields from the ResultSet.
The number of columns in the configuration must match the
number in the ResultSet. Configurations can be reused
for multiple ResultSets.ResultSetSQLException - if some SQL or database error occursIllegalStateException - if the number of columns in the configuration
does not match the number in the
ResultSetCopyright © 2020. All rights reserved.