Closed billjazz closed 1 year ago
$disk = Storage::disk('s3'); $file = 'test.parquet'; $schema = new Schema([ DataField::createFromType('id', 'integer'), DataField::createFromType('name', 'string'), ]); $handle = $disk->readStream($file); $dataWriter = new ParquetDataWriter($handle, $schema); // add two records at once $dataToWrite = [ [ 'id' => 1, 'name' => 'abc' ], [ 'id' => 2, 'name' => 'def' ], ]; $dataWriter->putBatch($dataToWrite); $dataWriter->finish(); // Don't forget to finish at some point.
the $handle is a file resource, but it can't write the data in the Stream.
Do you see any problem with this line? (Rhetorical question)
$handle = $disk->readStream($file);
the $handle is a file resource, but it can't write the data in the Stream.