Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/duckdb/src/common/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ bool LogicalType::SupportsRegularUpdate() const {
case LogicalTypeId::MAP:
case LogicalTypeId::UNION:
case LogicalTypeId::VARIANT:
case LogicalTypeId::GEOMETRY: // If geometry is shredded, its parts (lists/structs) can't be regularly updated.
return false;
case LogicalTypeId::STRUCT: {
auto &child_types = StructType::GetChildTypes(*this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void CRSFunction(DataChunk &args, ExpressionState &state, Vector &result)

static unique_ptr<Expression> BindCRSFunctionExpression(FunctionBindExpressionInput &input) {
const auto &return_type = input.children[0]->return_type;
if (return_type.id() == LogicalTypeId::UNKNOWN || return_type.id() == LogicalTypeId::SQLNULL) {
if (return_type.id() != LogicalTypeId::GEOMETRY) {
// parameter - unknown return type
return nullptr;
}
Expand All @@ -91,12 +91,11 @@ static unique_ptr<Expression> BindCRSFunctionExpression(FunctionBindExpressionIn

static unique_ptr<FunctionData> BindCRSFunction(ClientContext &context, ScalarFunction &bound_function,
vector<unique_ptr<Expression>> &arguments) {
if (arguments[0]->HasParameter() || arguments[0]->return_type.id() == LogicalTypeId::SQLNULL) {
// parameter - unknown return type
if (arguments[0]->return_type.id() != LogicalTypeId::GEOMETRY) {
return nullptr;
}

// Check if the CRS is set in the first argument
// Propagate the CRS from the input argument to the parameter type
bound_function.arguments[0] = arguments[0]->return_type;
return nullptr;
}
Expand Down
12 changes: 10 additions & 2 deletions src/duckdb/src/function/table/arrow/arrow_duck_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ unique_ptr<ArrowType> ArrowType::GetTypeFromFormat(string &format) {
auto type_info = make_uniq<ArrowStringInfo>(ArrowVariableSizeType::VIEW);
return make_uniq<ArrowType>(LogicalType::BLOB, std::move(type_info));
} else if (format[0] == 'w') {
string parameters = format.substr(format.find(':') + 1);
// Arrow C Data Interface spec: fixed-size binary is "w:NN", colon always at position 1
if (format.size() <= 2 || format[1] != ':') {
throw InvalidInputException("Invalid Arrow fixed-size binary format string: \"%s\"", format);
}
string parameters = format.substr(2);
auto fixed_size = NumericCast<idx_t>(std::stoi(parameters));
auto type_info = make_uniq<ArrowStringInfo>(fixed_size);
return make_uniq<ArrowType>(LogicalType::BLOB, std::move(type_info));
Expand Down Expand Up @@ -227,7 +231,11 @@ unique_ptr<ArrowType> ArrowType::GetTypeFromFormat(ClientContext &context, Arrow
} else if (format == "+vL") {
return CreateListType(context, *schema.children[0], ArrowVariableSizeType::SUPER_SIZE, true);
} else if (format[0] == '+' && format[1] == 'w') {
std::string parameters = format.substr(format.find(':') + 1);
// Arrow C Data Interface spec: fixed-size list is "+w:NN", colon always at position 2
if (format.size() <= 3 || format[2] != ':') {
throw InvalidInputException("Invalid Arrow fixed-size list format string: \"%s\"", format);
}
std::string parameters = format.substr(3);
auto fixed_size = NumericCast<idx_t>(std::stoi(parameters));
auto child_type = GetArrowLogicalType(context, *schema.children[0]);

Expand Down
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "2-dev291"
#define DUCKDB_PATCH_VERSION "2-dev302"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 5
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.5.2-dev291"
#define DUCKDB_VERSION "v1.5.2-dev302"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "4b7b860448"
#define DUCKDB_SOURCE_ID "ddba343762"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
9 changes: 4 additions & 5 deletions src/duckdb/src/storage/table/geo_column_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,17 @@ void GeoColumnData::FetchRow(TransactionData transaction, ColumnFetchState &stat

void GeoColumnData::Update(TransactionData transaction, DataTable &data_table, idx_t column_index,
Vector &update_vector, row_t *row_ids, idx_t update_count, idx_t row_group_start) {
return base_column->Update(transaction, data_table, column_index, update_vector, row_ids, update_count,
row_group_start);
throw NotImplementedException("GEOMETRY Update is not supported");
}

void GeoColumnData::UpdateColumn(TransactionData transaction, DataTable &data_table,
const vector<column_t> &column_path, Vector &update_vector, row_t *row_ids,
idx_t update_count, idx_t depth, idx_t row_group_start) {
return base_column->UpdateColumn(transaction, data_table, column_path, update_vector, row_ids, update_count, depth,
row_group_start);
throw NotImplementedException("GEOMETRY Update is not supported");
}

unique_ptr<BaseStatistics> GeoColumnData::GetUpdateStatistics() {
return base_column->GetUpdateStatistics();
return nullptr;
}

//----------------------------------------------------------------------------------------------------------------------
Expand Down
Loading