Package org.rcsb.mmtf.spark.data
Class AtomDataset
- java.lang.Object
-
- org.rcsb.mmtf.spark.data.AtomDataset
-
public class AtomDataset extends java.lang.Object- Author:
- Anthony Bradley
-
-
Constructor Summary
Constructors Constructor Description AtomDataset(org.apache.spark.api.java.JavaRDD<Atom> inputRdd)Public constructor from aJavaRDDofAtomAtomDataset(org.apache.spark.api.java.JavaRDD<Atom> inputRdd, java.lang.String tableName)Construct a table with a given table name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcache()Cache the data.org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>getDataframe()org.apache.spark.api.java.JavaRDD<Atom>getRdd()java.lang.StringgetTableName()voidsetDataframe(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataframe)voidsetRdd(org.apache.spark.api.java.JavaRDD<Atom> rdd)voidsetTableName(java.lang.String tableName)voidshow()Show the first few lines of the data.voidshow(int numLines)Show the first few X lines of the data.ResultsSetsql(java.lang.String sqlString)Perform SQL on the underlying data.ResultsSetsql(java.lang.String sqlString, java.lang.String viewName)Perform SQL on the underlying data.
-
-
-
Method Detail
-
setRdd
public void setRdd(org.apache.spark.api.java.JavaRDD<Atom> rdd)
- Parameters:
rdd- the rdd to set
-
getRdd
public org.apache.spark.api.java.JavaRDD<Atom> getRdd()
- Returns:
- rdd the rdd to set
-
getDataframe
public org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> getDataframe()
- Returns:
- the dataframe
-
setDataframe
public void setDataframe(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataframe)
- Parameters:
dataframe- the dataframe to set
-
getTableName
public java.lang.String getTableName()
- Returns:
- the tableName
-
setTableName
public void setTableName(java.lang.String tableName)
- Parameters:
tableName- the tableName to set
-
show
public void show()
Show the first few lines of the data.
-
show
public void show(int numLines)
Show the first few X lines of the data.- Parameters:
numLines- the number of lines to show
-
sql
public ResultsSet sql(java.lang.String sqlString, java.lang.String viewName)
Perform SQL on the underlying data.- Parameters:
sqlString- the string to queryviewName- the name of the table- Returns:
- the
ResultsSetfrom the query
-
sql
public ResultsSet sql(java.lang.String sqlString)
Perform SQL on the underlying data.- Parameters:
sqlString- the string to query- Returns:
- the
ResultsSetfrom the query
-
cache
public void cache()
Cache the data.
-
-