Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Nov 8, 2023
1 parent 4fd709e commit 9d4eb06
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 75 deletions.
3 changes: 2 additions & 1 deletion src/binder/bind/bind_graph_pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ std::shared_ptr<RelExpression> Binder::createNonRecursiveQueryRel(const std::str
std::vector<common::table_id_t> resourceTableIDs;
std::vector<TableSchema*> resourceTableSchemas;
for (auto& tableID : tableIDs) {
auto rdfGraphSchema = reinterpret_cast<RdfGraphSchema*>(readVersion->getTableSchema(tableID));
auto rdfGraphSchema =
reinterpret_cast<RdfGraphSchema*>(readVersion->getTableSchema(tableID));
auto resourceTableID = rdfGraphSchema->getResourceTableID();
resourceTableIDs.push_back(resourceTableID);
resourceTableSchemas.push_back(readVersion->getTableSchema(resourceTableID));
Expand Down
5 changes: 3 additions & 2 deletions src/binder/bind/copy/bind_copy_rdf_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ std::unique_ptr<BoundStatement> Binder::bindCopyRdfRelFrom(
std::move(readerConfig), columns, relID, TableType::REL);
auto extraInfo = std::make_unique<ExtraBoundCopyRdfRelInfo>(columns[0], columns[2]);
expression_vector columnsToCopy = {columns[0], columns[2], relID, columns[1]};
auto boundCopyFromInfo = std::make_unique<BoundCopyFromInfo>(tableSchema,
std::move(boundFileScanInfo), containsSerial, std::move(columnsToCopy), std::move(extraInfo));
auto boundCopyFromInfo =
std::make_unique<BoundCopyFromInfo>(tableSchema, std::move(boundFileScanInfo),
containsSerial, std::move(columnsToCopy), std::move(extraInfo));
return std::make_unique<BoundCopyFrom>(std::move(boundCopyFromInfo));
}

Expand Down
10 changes: 4 additions & 6 deletions src/include/binder/copy/bound_copy_from.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@ struct ExtraBoundCopyRdfRelInfo : public ExtraBoundCopyFromInfo {
std::shared_ptr<Expression> subjectOffset;
std::shared_ptr<Expression> objectOffset;

ExtraBoundCopyRdfRelInfo(std::shared_ptr<Expression> subjectOffset,
std::shared_ptr<Expression> objectOffset)
: subjectOffset{std::move(subjectOffset)},
objectOffset{std::move(objectOffset)} {}
ExtraBoundCopyRdfRelInfo(
std::shared_ptr<Expression> subjectOffset, std::shared_ptr<Expression> objectOffset)
: subjectOffset{std::move(subjectOffset)}, objectOffset{std::move(objectOffset)} {}
ExtraBoundCopyRdfRelInfo(const ExtraBoundCopyRdfRelInfo& other)
: subjectOffset{other.subjectOffset},
objectOffset{other.objectOffset} {}
: subjectOffset{other.subjectOffset}, objectOffset{other.objectOffset} {}

inline std::unique_ptr<ExtraBoundCopyFromInfo> copy() final {
return std::make_unique<ExtraBoundCopyRdfRelInfo>(*this);
Expand Down
1 change: 1 addition & 0 deletions src/include/processor/operator/persistent/copy_rel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct CopyRelInfo {
common::vector_idx_t partitioningIdx;
common::RelDataDirection dataDirection;
common::ColumnDataFormat dataFormat;
// TODO(Guodong): the following 3 fields are not being used.
std::vector<DataPos> dataPoses;
DataPos srcOffsetPos;
DataPos relIDPos;
Expand Down
7 changes: 0 additions & 7 deletions src/processor/operator/persistent/copy_rel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ void CopyRel::executeInternal(ExecutionContext* /*context*/) {
auto offsetVectorIdx = info->dataDirection == FWD ? 0 : 1;
row_idx_t numRows = 0;
for (auto& dataChunk : *partitioningBuffer) {
for (auto i = 0; i < dataChunk->state->selVector->selectedSize; ++i) {
auto a = dataChunk->getValueVector(0)->getValue<int64_t>(i);
auto b = dataChunk->getValueVector(1)->getValue<int64_t>(i);
auto c = dataChunk->getValueVector(2)->getValue<int64_t>(i);
auto d = 0;
}

auto offsetVector = dataChunk->getValueVector(offsetVectorIdx).get();
setOffsetToWithinNodeGroup(offsetVector, startOffset);
numRows += offsetVector->state->selVector->selectedSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ offset_t RDFReader::read(DataChunk* dataChunk) {
switch (config->mode) {
case common::RdfReaderMode::RESOURCE_TRIPLE:
case common::RdfReaderMode::LITERAL_TRIPLE: {
// TODO(Xiyang): Upstream copy rel hard code FROM at index 0 and TO at index 1. So we need to flip
sVector = dataChunk->getValueVector(0).get();
pVector = dataChunk->getValueVector(1).get();
oVector = dataChunk->getValueVector(2).get();
Expand Down
7 changes: 3 additions & 4 deletions test/test_files/copy/copy_rdf.test
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
-GROUP CopyRDFTest
-DATASET CSV copy-test/rdf
-BUFFER_POOL_SIZE 536870912
-SKIP

--

-CASE CopyRDFTest

-LOG CountRDFNodeTable
-STATEMENT MATCH (s:taxonomy) RETURN COUNT(s.IRI)
-STATEMENT MATCH (s:taxonomy_resource_t) RETURN COUNT(s.iri)
---- 1
1138441

-LOG QueryRDFNodeTable
-STATEMENT MATCH (s:taxonomy) RETURN s.IRI ORDER BY s.IRI LIMIT 5
-STATEMENT MATCH (s:taxonomy_resource_t) RETURN s.iri ORDER BY s.iri LIMIT 5
---- 5
http://dbpedia.org/class/yago/'hood108641944
http://dbpedia.org/class/yago/14July115200493
Expand All @@ -22,7 +21,7 @@ http://dbpedia.org/class/yago/16PF106475933
http://dbpedia.org/class/yago/1750s115149933

-LOG QueryRDFRelTable
-STATEMENT MATCH (s:taxonomy)-[p:taxonomy]->(o:taxonomy) RETURN s.IRI, o.IRI ORDER BY s.IRI LIMIT 2
-STATEMENT MATCH (s:taxonomy_resource_t)-[p:taxonomy]->(o:taxonomy_resource_t) RETURN s.iri, o.iri ORDER BY s.iri LIMIT 2
---- 2
http://dbpedia.org/class/yago/'hood108641944|http://dbpedia.org/class/yago/Vicinity108641113
http://dbpedia.org/class/yago/14July115200493|http://dbpedia.org/class/yago/LegalHoliday115199592
54 changes: 0 additions & 54 deletions test/test_files/rdf/tiny.test

This file was deleted.

0 comments on commit 9d4eb06

Please sign in to comment.