-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
905 additions
and
822 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/processor/operator/copy_from/copy_rel.h → .../processor/operator/persistent/copy_rel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#pragma once | ||
|
||
#include "processor/operator/physical_operator.h" | ||
#include "storage/copier/reader_state.h" | ||
|
||
namespace kuzu { | ||
namespace processor { | ||
|
||
struct ReaderInfo { | ||
DataPos nodeOffsetPos; | ||
std::vector<DataPos> dataColumnPoses; | ||
bool isOrderPreserving; | ||
storage::read_rows_func_t readFunc; | ||
storage::init_reader_data_func_t initFunc; | ||
}; | ||
|
||
class Reader : public PhysicalOperator { | ||
public: | ||
Reader(ReaderInfo readerInfo, std::shared_ptr<storage::ReaderSharedState> sharedState, | ||
uint32_t id, const std::string& paramsString) | ||
: PhysicalOperator{PhysicalOperatorType::READER, id, paramsString}, | ||
readerInfo{std::move(readerInfo)}, sharedState{std::move(sharedState)}, leftNumRows{0}, | ||
currFileIdx{common::INVALID_VECTOR_IDX}, readFuncData{nullptr} {} | ||
|
||
inline void initGlobalStateInternal(ExecutionContext* context) final { | ||
sharedState->validate(); | ||
sharedState->countBlocks(); | ||
} | ||
inline bool isSource() const final { return true; } | ||
|
||
inline std::unique_ptr<PhysicalOperator> clone() final { | ||
return make_unique<Reader>(readerInfo, sharedState, getOperatorID(), paramsString); | ||
} | ||
|
||
protected: | ||
bool getNextTuplesInternal(ExecutionContext* context) final; | ||
|
||
private: | ||
void getNextNodeGroupInSerial(std::shared_ptr<arrow::Table>& table); | ||
void getNextNodeGroupInParallel(std::shared_ptr<arrow::Table>& table); | ||
|
||
private: | ||
ReaderInfo readerInfo; | ||
std::shared_ptr<storage::ReaderSharedState> sharedState; | ||
std::vector<std::shared_ptr<arrow::RecordBatch>> leftRecordBatches; | ||
common::row_idx_t leftNumRows; | ||
|
||
// For parallel reading. | ||
common::vector_idx_t currFileIdx; | ||
std::unique_ptr<storage::ReaderFunctionData> readFuncData; | ||
}; | ||
|
||
} // namespace processor | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.