Skip to content

Commit

Permalink
- Merge with v0.10.3
Browse files Browse the repository at this point in the history
- Disable enable_verification in tests because of ToString()
- Make DropPropertyGraphInfo inherit from DropInfo
  • Loading branch information
Dtenwolde committed Jun 4, 2024
2 parents d88b7f9 + a86093f commit 460be19
Show file tree
Hide file tree
Showing 22 changed files with 48 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ concurrency:
jobs:
duckdb-stable-build:
name: Build extension binaries
uses: cwida/extension-ci-tools/.github/workflows/[email protected].2
uses: cwida/extension-ci-tools/.github/workflows/[email protected].3
with:
duckdb_version: v0.10.2
duckdb_version: v0.10.3
extension_name: duckpgq

duckdb-stable-deploy:
Expand All @@ -25,6 +25,6 @@ jobs:
uses: ./.github/workflows/_extension_deploy.yml
secrets: inherit
with:
duckdb_version: v0.10.2
duckdb_version: v0.10.3
extension_name: duckpgq
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.5)

# Set extension name here <<<<<<< HEAD set(TARGET_NAME duckpgq)
#
Expand Down
2 changes: 1 addition & 1 deletion duckdb
2 changes: 1 addition & 1 deletion duckdb-pgq
Submodule duckdb-pgq updated 1440 files
2 changes: 1 addition & 1 deletion extension-ci-tools
6 changes: 2 additions & 4 deletions src/duckpgq_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,12 @@ duckpgq_handle_statement(SQLStatement *statement, DuckPGQState &duckpgq_state) {
}
if (statement->type == StatementType::EXPLAIN_STATEMENT) {
auto &explain_statement = statement->Cast<ExplainStatement>();
// auto select_statement =
// dynamic_cast<SelectStatement*>(explain_statement.stmt.get());
duckpgq_handle_statement(explain_statement.stmt.get(), duckpgq_state);
}
if (statement->type == StatementType::COPY_STATEMENT) {
const auto &copy_statement = statement->Cast<CopyStatement>();
const auto select_node =
dynamic_cast<SelectNode *>(copy_statement.select_statement.get());
dynamic_cast<SelectNode *>(copy_statement.info->select_statement.get());
duckpgq_find_match_function(select_node->from_table.get(), duckpgq_state);
throw Exception(ExceptionType::BINDER, "use duckpgq_bind instead");
}
Expand All @@ -199,7 +197,7 @@ duckpgq_plan(ParserExtensionInfo *, ClientContext &context,
auto duckpgq_state_entry = context.registered_state.find("duckpgq");
DuckPGQState *duckpgq_state;
if (duckpgq_state_entry == context.registered_state.end()) {
auto state = make_shared<DuckPGQState>(std::move(parse_data));
auto state = make_shared_ptr<DuckPGQState>(std::move(parse_data));
context.registered_state["duckpgq"] = state;
duckpgq_state = state.get();
} else {
Expand Down
7 changes: 4 additions & 3 deletions src/functions/tablefunctions/drop_property_graph.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "duckpgq/functions/tablefunctions/drop_property_graph.hpp"

#include "duckdb/parser/parsed_data/drop_property_graph_info.hpp"
#include <duckpgq_extension.hpp>

namespace duckdb {
Expand All @@ -22,7 +23,7 @@ DropPropertyGraphFunction::DropPropertyGraphBind(
}
auto statement =
dynamic_cast<DropStatement *>(duckpgq_parse_data->statement.get());
auto info = dynamic_cast<DropInfo *>(statement->info.get());
auto info = dynamic_cast<DropPropertyGraphInfo *>(statement->info.get());
return make_uniq<DropPropertyGraphBindData>(info);
}

Expand All @@ -43,9 +44,9 @@ void DropPropertyGraphFunction::DropPropertyGraphFunc(
}
auto duckpgq_state = (DuckPGQState *)lookup->second.get();
auto registered_pg =
duckpgq_state->registered_property_graphs.find(pg_info->name);
duckpgq_state->registered_property_graphs.find(pg_info->property_graph_name);
if (registered_pg == duckpgq_state->registered_property_graphs.end()) {
throw BinderException("Property graph %s does not exist.", pg_info->name);
throw BinderException("Property graph %s does not exist.", pg_info->property_graph_name);
}
duckpgq_state->registered_property_graphs.erase(registered_pg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "duckdb/function/table_function.hpp"
#include "duckdb/parser/statement/drop_statement.hpp"

#include <duckdb/parser/parsed_data/drop_property_graph_info.hpp>

namespace duckdb {

class DropPropertyGraphFunction : public TableFunction {
Expand All @@ -22,10 +24,10 @@ class DropPropertyGraphFunction : public TableFunction {
}

struct DropPropertyGraphBindData : public TableFunctionData {
explicit DropPropertyGraphBindData(DropInfo *pg_info)
explicit DropPropertyGraphBindData(DropPropertyGraphInfo *pg_info)
: drop_pg_info(pg_info) {}

DropInfo *drop_pg_info;
DropPropertyGraphInfo *drop_pg_info;
};

struct DropPropertyGraphGlobalData : public GlobalTableFunctionState {
Expand Down
6 changes: 5 additions & 1 deletion src/include/duckpgq_extension.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct DuckPGQParserExtension : public ParserExtension {
DuckPGQParserExtension() : ParserExtension() {
parse_function = duckpgq_parse;
plan_function = duckpgq_plan;
parser_info = make_shared<DuckPGQParserExtensionInfo>();
parser_info = make_shared_ptr<DuckPGQParserExtensionInfo>();
}
};

Expand All @@ -64,6 +64,10 @@ struct DuckPGQParseData : ParserExtensionParseData {
statement->Copy());
}

string ToString() const override {
return statement->ToString();
};

explicit DuckPGQParseData(unique_ptr<SQLStatement> statement)
: statement(std::move(statement)) {}
};
Expand Down
4 changes: 2 additions & 2 deletions test/sql/altering_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# group: [sql]
# issue: https://github.com/cwida/duckpgq-extension/issues/44

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/create_pg/all_properties.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/all_properties.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/create_pg/create_property_graph.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

require duckpgq

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

statement error
-CREATE PROPERTY GRAPH pg4
Expand Down
4 changes: 2 additions & 2 deletions test/sql/create_pg/drop_property_graph.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

require duckpgq

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

statement ok
CREATE TABLE Student(id BIGINT, name VARCHAR);
Expand Down
4 changes: 2 additions & 2 deletions test/sql/create_pg/except_properties.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/except_properties.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/create_pg/no_properties.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/no_properties.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/path_finding/shortest_path.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/shortest_path.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/path_finding/subpath_match.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/subpath_match.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/pattern_matching/basic_match.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/basic_match.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/pattern_matching/inheritance_support.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/inheritance_support.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/pattern_matching/path_modes.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/shortest_path.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/pattern_matching/undirected_edges.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/undirected_edges.test
# group: [duckpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down
4 changes: 2 additions & 2 deletions test/sql/pgq_keywords.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# name: test/sql/sqlpgq/pgq_keywords.test
# group: [sqlpgq]

statement ok
pragma enable_verification
#statement ok
#pragma enable_verification

require duckpgq

Expand Down

0 comments on commit 460be19

Please sign in to comment.