예제 #1
0
    def test_persist_rdd(self):
        # Arrange
        rdd = self.context.spark.sparkContext.parallelize([Row(column1='aa')])
        cardo_dataframe = CardoDataFrame(rdd, '')

        # Act
        cardo_dataframe.persist()

        # Assert
        self.assertTrue(rdd.is_cached)
예제 #2
0
    def test_persist_df(self):
        # Arrange
        df = self.context.spark.createDataFrame([['a']], 'column1: string')
        cardo_dataframe = CardoDataFrame(df, '')

        # Act
        cardo_dataframe.persist()

        # Assert
        self.assertTrue(df.is_cached)