예제 #1
0
 /**
  * @description Create table and aggregate it
  */
 public function benchAggregate()
 {
     $table = Table::create();
     $table->createAndAddRow()->set('key', 'a')->set('num', 10);
     $table->createAndAddRow()->set('key', 'a')->set('num', 10);
     $table->createAndAddRow()->set('key', 'b')->set('num', 10);
     $table->partition(function ($row) {
         return $row['num'];
     })->fork(function ($table, $newTable) {
         $row = $newTable->createAndAddRow();
         $row->set('num', $table->getColumn('num')->sum());
     });
 }
예제 #2
0
 /**
  * Its should be able to have a description.
  */
 public function testDescription()
 {
     $table = Table::create()->setDescription('Hai')->setDescription('Hai');
     $this->assertEquals('Hai', $table->getDescription());
 }