Class AtomDataset


  • public class AtomDataset
    extends java.lang.Object
    Wrapper using JavaRDD and Dataset of Atom
    Author:
    Anthony Bradley
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomDataset​(org.apache.spark.api.java.JavaRDD<Atom> inputRdd)
      Public constructor from a JavaRDD of Atom
      AtomDataset​(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
      void cache()
      Cache the data.
      org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> getDataframe()  
      org.apache.spark.api.java.JavaRDD<Atom> getRdd()  
      java.lang.String getTableName()  
      void setDataframe​(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> dataframe)  
      void setRdd​(org.apache.spark.api.java.JavaRDD<Atom> rdd)  
      void setTableName​(java.lang.String tableName)  
      void show()
      Show the first few lines of the data.
      void show​(int numLines)
      Show the first few X lines of the data.
      ResultsSet sql​(java.lang.String sqlString)
      Perform SQL on the underlying data.
      ResultsSet sql​(java.lang.String sqlString, java.lang.String viewName)
      Perform SQL on the underlying data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AtomDataset

        public AtomDataset​(org.apache.spark.api.java.JavaRDD<Atom> inputRdd)
        Public constructor from a JavaRDD of Atom
        Parameters:
        inputRdd - the input JavaRDD of Atom
      • AtomDataset

        public AtomDataset​(org.apache.spark.api.java.JavaRDD<Atom> inputRdd,
                           java.lang.String tableName)
        Construct a table with a given table name.
        Parameters:
        inputRdd - the input JavaRDD of Atom.
        tableName - the table name to be used
    • 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 query
        viewName - the name of the table
        Returns:
        the ResultsSet from the query
      • sql

        public ResultsSet sql​(java.lang.String sqlString)
        Perform SQL on the underlying data.
        Parameters:
        sqlString - the string to query
        Returns:
        the ResultsSet from the query
      • cache

        public void cache()
        Cache the data.