Skip to content

Commit 4645a22

Browse files
fix[duckdb]: vortex write nullability from view (#3344)
1 parent 40d7af2 commit 4645a22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

duckdb-vortex/src/vortex_write.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ std::vector<idx_t> TableNullability(ClientContext &context, const string &catalo
5252
auto entry = catalog.GetEntry(context, CatalogType::TABLE_ENTRY, schema_name, table, OnEntryNotFound::RETURN_NULL,
5353
error_context);
5454
auto vec = std::vector<idx_t>();
55-
if (!entry) {
55+
// entry can non-null and not a table entry
56+
if (!entry || entry->type != CatalogType::TABLE_ENTRY) {
5657
// If there is no entry, it is okay to return all nullable columns.
5758
return vec;
5859
}
5960

6061
auto &table_entry = entry->Cast<TableCatalogEntry>();
6162
for (auto &constraint : table_entry.GetConstraints()) {
62-
if (constraint->type == ConstraintType::NOT_NULL) {
63+
if (constraint && constraint->type == ConstraintType::NOT_NULL) {
6364
auto &null_constraint = constraint->Cast<NotNullConstraint>();
6465
vec.push_back(null_constraint.index.index);
6566
}

0 commit comments

Comments
 (0)