-
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
1 parent
baf9e56
commit 072b545
Showing
31 changed files
with
50,848 additions
and
50,278 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
create node table tableOfTypes (id INT64, int64Column INT64, doubleColumn DOUBLE, booleanColumn BOOLEAN, dateColumn DATE, timestampColumn TIMESTAMP, stringColumn STRING, PRIMARY KEY (id)); | ||
create node table tableOfTypes (id INT64, int64Column INT64, doubleColumn DOUBLE, booleanColumn BOOLEAN, dateColumn DATE, timestampColumn TIMESTAMP, stringColumn STRING, listOfInt INT64[], PRIMARY KEY (id)); |
100,000 changes: 50,000 additions & 50,000 deletions
100,000
dataset/copy-test/node/csv/types_50k.csv
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
create node table tensor (ID INT64, boolTensor BOOLEAN[], doubleTensor DOUBLE[][], intTensor INT64[][][], oneDimInt INT64, PRIMARY KEY (ID)); | ||
create node table tensor (ID INT64, boolTensor BOOLEAN[], doubleTensor DOUBLE[2][], intTensor INT64[2][][], oneDimInt INT64, PRIMARY KEY (ID)); |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
|
||
#include "storage/copier/column_chunk.h" | ||
|
||
using namespace kuzu::common; | ||
|
||
namespace kuzu { | ||
namespace storage { | ||
|
||
class ListColumnChunk : public ColumnChunk { | ||
public: | ||
ListColumnChunk(LogicalType dataType, CopyDescription* copyDescription); | ||
|
||
inline ColumnChunk* getDataColumnChunk() const { return dataChunk.get(); } | ||
|
||
void setValueFromString(const char* value, uint64_t length, uint64_t pos); | ||
|
||
private: | ||
inline common::page_idx_t getNumPages() const final { | ||
return dataChunk->getNumPages() + ColumnChunk::getNumPages(); | ||
} | ||
|
||
void append(arrow::Array* array, offset_t startPosInChunk, uint32_t numValuesToAppend) override; | ||
|
||
void copyListFromArrowString( | ||
arrow::Array* array, offset_t startPosInChunk, uint32_t numValuesToAppend); | ||
|
||
void copyListFromArrowList( | ||
arrow::Array* array, offset_t startPosInChunk, uint32_t numValuesToAppend); | ||
|
||
void writeVal(const common::Value& listVal, uint64_t posToWrite) override; | ||
|
||
void resizeDataChunk(uint64_t numValues); | ||
|
||
private: | ||
std::unique_ptr<ColumnChunk> dataChunk; | ||
uint64_t numValuesInDataChunk; | ||
uint64_t capacityInDataChunk; | ||
}; | ||
|
||
} // namespace storage | ||
} // 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#pragma once | ||
|
||
#include "node_column.h" | ||
|
||
namespace kuzu { | ||
namespace storage { | ||
|
||
class ListNodeColumn : public NodeColumn { | ||
public: | ||
ListNodeColumn(common::LogicalType dataType, const catalog::MetadataDAHInfo& metaDAHeaderInfo, | ||
BMFileHandle* dataFH, BMFileHandle* metadataFH, BufferManager* bufferManager, WAL* wal) | ||
: NodeColumn{std::move(dataType), metaDAHeaderInfo, dataFH, metadataFH, bufferManager, wal, | ||
true /* requireNullColumn */} { | ||
dataNodeColumn = | ||
NodeColumnFactory::createNodeColumn(*common::VarListType::getChildType(&this->dataType), | ||
*metaDAHeaderInfo.childrenInfos[0], dataFH, metadataFH, bufferManager, wal); | ||
} | ||
|
||
protected: | ||
void scanInternal(transaction::Transaction* transaction, common::ValueVector* nodeIDVector, | ||
common::ValueVector* resultVector) final; | ||
|
||
void lookupValue(transaction::Transaction* transaction, common::offset_t nodeOffset, | ||
common::ValueVector* resultVector, uint32_t posInVector) final; | ||
|
||
common::page_idx_t append( | ||
ColumnChunk* columnChunk, common::page_idx_t startPageIdx, uint64_t nodeGroupIdx) override; | ||
|
||
private: | ||
void scanUnfiltered(transaction::Transaction* transaction, common::ValueVector* nodeIDVector, | ||
common::ValueVector* offsetVector, common::ValueVector* resultVector); | ||
|
||
void scanFiltered(transaction::Transaction* transaction, common::ValueVector* nodeIDVector, | ||
common::ValueVector* offsetVector, common::ValueVector* resultVector); | ||
|
||
void checkpointInMemory() final; | ||
|
||
void rollbackInMemory() final; | ||
|
||
void scanWithOffsets(transaction::Transaction* transaction, | ||
common::node_group_idx_t nodeGroupIdx, common::offset_t startOffsetInGroup, | ||
common::offset_t endOffsetInGroup, common::ValueVector* resultVector, | ||
uint64_t posToWriteListEntry) final; | ||
|
||
common::offset_t readOffset(transaction::Transaction* transaction, common::offset_t valuePos); | ||
|
||
void scanListOffset(transaction::Transaction* transaction, common::offset_t startNodeOffset, | ||
common::node_group_idx_t nodeGroupIdx, common::ValueVector* offsetVector); | ||
|
||
inline common::offset_t readListOffsetInStorage( | ||
transaction::Transaction* transaction, common::offset_t nodeOffset) { | ||
return nodeOffset == 0 ? 0 : readOffset(transaction, nodeOffset - 1); | ||
} | ||
|
||
inline common::offset_t getListOffsetInStorage(transaction::Transaction* transaction, | ||
common::ValueVector* offsetVector, common::offset_t nodeOffset, uint64_t nodePos) { | ||
return nodePos == 0 ? readListOffsetInStorage(transaction, nodeOffset) : | ||
offsetVector->getValue<common::offset_t>(nodePos - 1); | ||
} | ||
|
||
inline uint64_t getListLength(transaction::Transaction* transaction, | ||
common::ValueVector* offsetVector, common::offset_t nodeOffset, uint64_t nodePos) { | ||
return getListOffsetInStorage(transaction, offsetVector, nodeOffset + 1, nodePos + 1) - | ||
getListOffsetInStorage(transaction, offsetVector, nodeOffset, nodePos); | ||
} | ||
|
||
private: | ||
std::unique_ptr<NodeColumn> dataNodeColumn; | ||
}; | ||
|
||
} // namespace storage | ||
} // 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
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
Oops, something went wrong.