@PublicEvolving public class DataFrame extends Object
Values in the same column must have the same data type: integer, float, string etc.
Constructor and Description |
---|
DataFrame(List<String> columnNames,
List<DataType> dataTypes,
List<Row> rows)
The given columnNames and dataTypes should be mutable in order for TransformerServable
classes to update DataFrame with the serving results.
|
Modifier and Type | Method and Description |
---|---|
DataFrame |
addColumn(String columnName,
DataType dataType,
List<?> values)
Adds to this DataFrame a column with the given name, data type, and values.
|
List<Row> |
collect()
Returns all rows of this table.
|
List<String> |
getColumnNames()
Returns a list of the names of all the columns in this DataFrame.
|
DataType |
getDataType(String name)
Returns the data type of the column with the given name.
|
int |
getIndex(String name)
Returns the index of the column with the given name.
|
public List<String> getColumnNames()
public int getIndex(String name)
IllegalArgumentException
- if the column is not present in this tablepublic DataType getDataType(String name)
IllegalArgumentException
- if the column is not present in this tablepublic DataFrame addColumn(String columnName, DataType dataType, List<?> values)
IllegalArgumentException
- if the number of values is different from the number of
rows.Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.