Skip to content

Commit 2a8739c

Browse files
Merge v1.2.1 into main (#157)
* changes to use 1.2.1 version of duckdb and extension-ci-tools. (#154) * fix zero column virtual_table handling to check expressions also (#155) --------- Co-authored-by: Chandra Sanapala <chandra@sundeck.io>
1 parent 611d92b commit 2a8739c

File tree

7 files changed

+27
-14
lines changed

7 files changed

+27
-14
lines changed

.github/workflows/distribution.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
name: Build extension binaries
2727
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
2828
with:
29-
duckdb_version: main
30-
ci_tools_version: 8262e6fafa6b62a82f9d671d33d311b9b578127e
29+
duckdb_version: 8e52ec43959ab363643d63cb78ee214577111da4
30+
ci_tools_version: 58970c538d35919db875096460c05806056f4de0
3131
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;windows_amd64;windows_amd64_mingw"
3232
extension_name: substrait
3333

@@ -37,8 +37,8 @@ jobs:
3737
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@main
3838
secrets: inherit
3939
with:
40-
duckdb_version: main
41-
ci_tools_version: 8262e6fafa6b62a82f9d671d33d311b9b578127e
40+
duckdb_version: 8e52ec43959ab363643d63cb78ee214577111da4
41+
ci_tools_version: 58970c538d35919db875096460c05806056f4de0
4242
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;windows_amd64;windows_amd64_mingw"
4343
extension_name: substrait
4444
deploy_latest: true

.github/workflows/main_distribution.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
name: Build extension binaries
2222
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
2323
with:
24-
duckdb_version: c009b4ea62f9fcf6ffed6aad51c8f1833121bbfb
25-
ci_tools_version: 8262e6fafa6b62a82f9d671d33d311b9b578127e
24+
duckdb_version: 8e52ec43959ab363643d63cb78ee214577111da4
25+
ci_tools_version: 58970c538d35919db875096460c05806056f4de0
2626
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;windows_amd64;windows_amd64_mingw;windows_amd64_rtools"
2727
extension_name: substrait
2828

duckdb

Submodule duckdb updated 624 files

src/from_substrait.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,13 @@ SubstraitToDuckDB::TransformProjectOp(const substrait::Rel &sop,
575575
size_t num_input_columns = 0;
576576
if (sop.project().input().rel_type_case() == substrait::Rel::RelTypeCase::kRead) {
577577
auto &sget = sop.project().input().read();
578-
if (sget.has_virtual_table() && sget.virtual_table().values().empty()) {
579-
hasZeroColumnVirtualTable = true;
580-
input_rel = GetValueRelationWithSingleBoolColumn();
578+
if (sget.has_virtual_table()) {
579+
auto virtual_table = sget.virtual_table();
580+
if ((virtual_table.values().empty() && virtual_table.expressions().empty()) ||
581+
(virtual_table.expressions().size() > 0 && virtual_table.expressions(0).fields().empty())) {
582+
hasZeroColumnVirtualTable = true;
583+
input_rel = GetValueRelationWithSingleBoolColumn();
584+
}
581585
}
582586
}
583587
if (!hasZeroColumnVirtualTable) {
@@ -900,11 +904,11 @@ shared_ptr<Relation> SubstraitToDuckDB::TransformWriteOp(const substrait::Rel &s
900904
case RelationType::PROJECTION_RELATION: {
901905
auto project = std::move(input.get()->Cast<ProjectionRelation>());
902906
auto filter = std::move(project.child->Cast<FilterRelation>());
903-
return make_shared_ptr<DeleteRelation>(filter.context, std::move(filter.condition), catalog_name, schema_name, table_name);
907+
return make_shared_ptr<DeleteRelation>(filter.context, std::move(filter.condition), schema_name, table_name);
904908
}
905909
case RelationType::FILTER_RELATION: {
906910
auto filter = std::move(input.get()->Cast<FilterRelation>());
907-
return make_shared_ptr<DeleteRelation>(filter.context, std::move(filter.condition), catalog_name, schema_name, table_name);
911+
return make_shared_ptr<DeleteRelation>(filter.context, std::move(filter.condition), schema_name, table_name);
908912
}
909913
default:
910914
throw NotImplementedException("Unsupported relation type for delete operation");

substrait

Submodule substrait updated 53 files

test/c/test_substrait_c_api.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,4 +658,13 @@ TEST_CASE("Test C VirtualTable with bad input Literal", "[substrait-api]") {
658658

659659
auto json_plan = R"({"version":{"minorNumber":29, "producer":"substrait-go"}, "relations":[{"root":{"input":{"project":{"common":{"direct":{}}, "input":{"read":{"common":{"direct":{}}, "baseSchema":{"struct":{"nullability":"NULLABILITY_REQUIRED"}}, "virtualTable":{"expressions":[{}]}}}, "expressions":[{"literal":{"decimal":{"value":"AQ==", "precision":1}, "nullable":true}}]}}, "names":["?column?"]}}]})";
660660
REQUIRE_THROWS(FromSubstraitJSON(con,json_plan));
661+
}
662+
663+
TEST_CASE("Test C Project with VirtualTable", "[substrait-api]") {
664+
DuckDB db(nullptr);
665+
Connection con(db);
666+
667+
auto json_plan = R"({"version":{"minorNumber":29, "producer":"substrait-go darwin/arm64"}, "relations":[{"root":{"input":{"project":{"common":{"emit":{"outputMapping":[2]}}, "input":{"read":{"common":{"direct":{}}, "baseSchema":{"names":["c1", "c2"], "struct":{"types":[{"fp64":{"nullability":"NULLABILITY_NULLABLE"}}, {"fp64":{"nullability":"NULLABILITY_NULLABLE"}}], "nullability":"NULLABILITY_REQUIRED"}}, "virtualTable":{"expressions":[{"fields":[{"literal":{"fp64":1, "nullable":true}}, {"literal":{"fp64":2, "nullable":true}}]}]}}}, "expressions":[{"literal":{"fp64":42}}]}}, "names":["p1"]}}]})";
668+
auto result = FromSubstraitJSON(con,json_plan);
669+
REQUIRE(CHECK_COLUMN(result, 0, {42}));
661670
}

0 commit comments

Comments
 (0)