Index and combine datastores tables
조회 수: 4 (최근 30일)
이전 댓글 표시
I have two datastores, ds1 and ds2 consisting of large CSV files. ds1 has some bad lines and ds2 has the corrections. I need to combine the two tables, but delete the bad lines from ds1 and save in a single datastore. This simple code seems like it should work.
t1 = tall(ds1);
t2 = tall(ds2);
t3 = [t1(idx,:); t2];
write('test/out_*.csv',t3);
However, I get an error saying that write does not work with column indexing.
Evaluating tall expression using the Local MATLAB Session:
- Pass 1 of 2: 48% complete
Evaluation 21% complete
Error using tall/write (line 222)
Unable to access intermediate data in the temporary folder, most likely because it ran out of space. Clear space on the local drive, or avoid operations that reorder
tall arrays (such as SORT or indexing with a tall numeric column vector).
Caused by:
Error in adding keys and values.
Error during serialization
Any ideas on how I can get around this error?
댓글 수: 0
답변 (1개)
Salman Ahmed
2021년 11월 19일
Hi Russell,
To combine tall arrays with different underlying datastores, it is recommended that you write the arrays (or indexing results) to disk and then create a single new datastore referencing those locations:
files = {'folder/path/to/file1','folder/path/to/file2'};
ds = datastore(files);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tall Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!