Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT FOR MERGING: Isolate hang in Arrow test #86

Closed
wants to merge 3 commits into from
Closed
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
10 changes: 1 addition & 9 deletions src/duckdb/extension/parquet/column_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,18 +1469,11 @@ unique_ptr<ColumnReader> ColumnReader::CreateReader(ParquetReader &reader, const
break;
}
}
throw NotImplementedException("Unsupported time encoding in Parquet file");
case LogicalTypeId::TIME_TZ:
if (schema_p.__isset.logicalType && schema_p.logicalType.__isset.TIME) {
if (schema_p.logicalType.TIME.unit.__isset.MILLIS) {
return make_uniq<CallbackColumnReader<int32_t, dtime_tz_t, ParquetIntToTimeMsTZ>>(
reader, type_p, schema_p, file_idx_p, max_define, max_repeat);
} else if (schema_p.logicalType.TIME.unit.__isset.MICROS) {
if (schema_p.logicalType.TIME.unit.__isset.MICROS) {
return make_uniq<CallbackColumnReader<int64_t, dtime_tz_t, ParquetIntToTimeTZ>>(
reader, type_p, schema_p, file_idx_p, max_define, max_repeat);
} else if (schema_p.logicalType.TIME.unit.__isset.NANOS) {
return make_uniq<CallbackColumnReader<int64_t, dtime_tz_t, ParquetIntToTimeNsTZ>>(
reader, type_p, schema_p, file_idx_p, max_define, max_repeat);
}
} else if (schema_p.__isset.converted_type) {
switch (schema_p.converted_type) {
Expand All @@ -1491,7 +1484,6 @@ unique_ptr<ColumnReader> ColumnReader::CreateReader(ParquetReader &reader, const
break;
}
}
throw NotImplementedException("Unsupported time encoding in Parquet file");
case LogicalTypeId::BLOB:
case LogicalTypeId::VARCHAR:
return make_uniq<StringColumnReader>(reader, type_p, schema_p, file_idx_p, max_define, max_repeat);
Expand Down
2 changes: 0 additions & 2 deletions src/duckdb/extension/parquet/include/parquet_timestamp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ date_t ParquetIntToDate(const int32_t &raw_date);
dtime_t ParquetIntToTimeMs(const int32_t &raw_time);
dtime_t ParquetIntToTime(const int64_t &raw_time);
dtime_t ParquetIntToTimeNs(const int64_t &raw_time);
dtime_tz_t ParquetIntToTimeMsTZ(const int32_t &raw_time);
dtime_tz_t ParquetIntToTimeTZ(const int64_t &raw_time);
dtime_tz_t ParquetIntToTimeNsTZ(const int64_t &raw_time);

} // namespace duckdb
4 changes: 2 additions & 2 deletions src/duckdb/extension/parquet/parquet_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct ParquetWriteLocalState : public LocalFunctionData {
ColumnDataAppendState append_state;
};

BindInfo ParquetGetBindInfo(const optional_ptr<FunctionData> bind_data) {
BindInfo ParquetGetBatchInfo(const FunctionData *bind_data) {
auto bind_info = BindInfo(ScanType::PARQUET);
auto &parquet_bind = bind_data->Cast<ParquetReadBindData>();
vector<Value> file_path;
Expand Down Expand Up @@ -317,7 +317,7 @@ class ParquetScanFunction {
table_function.get_batch_index = ParquetScanGetBatchIndex;
table_function.serialize = ParquetScanSerialize;
table_function.deserialize = ParquetScanDeserialize;
table_function.get_bind_info = ParquetGetBindInfo;
table_function.get_batch_info = ParquetGetBatchInfo;
table_function.projection_pushdown = true;
table_function.filter_pushdown = true;
table_function.filter_prune = true;
Expand Down
23 changes: 8 additions & 15 deletions src/duckdb/extension/parquet/parquet_timestamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,21 @@ date_t ParquetIntToDate(const int32_t &raw_date) {
return date_t(raw_date);
}

dtime_t ParquetIntToTimeMs(const int32_t &raw_millis) {
return Time::FromTimeMs(raw_millis);
dtime_t ParquetIntToTimeMs(const int32_t &raw_time) {
return Time::FromTimeMs(raw_time);
}

dtime_t ParquetIntToTime(const int64_t &raw_micros) {
return dtime_t(raw_micros);
dtime_t ParquetIntToTime(const int64_t &raw_time) {
return dtime_t(raw_time);
}

dtime_t ParquetIntToTimeNs(const int64_t &raw_nanos) {
return Time::FromTimeNs(raw_nanos);
}

dtime_tz_t ParquetIntToTimeMsTZ(const int32_t &raw_millis) {
return dtime_tz_t(Time::FromTimeMs(raw_millis), 0);
dtime_t ParquetIntToTimeNs(const int64_t &raw_time) {
return Time::FromTimeNs(raw_time);
}

dtime_tz_t ParquetIntToTimeTZ(const int64_t &raw_micros) {
return dtime_tz_t(dtime_t(raw_micros), 0);
}

dtime_tz_t ParquetIntToTimeNsTZ(const int64_t &raw_nanos) {
return dtime_tz_t(Time::FromTimeNs(raw_nanos), 0);
dtime_t t(raw_micros);
return dtime_tz_t(t, 0);
}

} // namespace duckdb
29 changes: 0 additions & 29 deletions src/duckdb/src/catalog/catalog_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,6 @@ string CatalogEntry::ToSQL() const {
throw InternalException("Unsupported catalog type for ToSQL()");
}

void CatalogEntry::SetChild(unique_ptr<CatalogEntry> child_p) {
child = std::move(child_p);
if (child) {
child->parent = this;
}
}

unique_ptr<CatalogEntry> CatalogEntry::TakeChild() {
if (child) {
child->parent = nullptr;
}
return std::move(child);
}

bool CatalogEntry::HasChild() const {
return child != nullptr;
}
bool CatalogEntry::HasParent() const {
return parent != nullptr;
}

CatalogEntry &CatalogEntry::Child() {
return *child;
}

CatalogEntry &CatalogEntry::Parent() {
return *parent;
}

Catalog &CatalogEntry::ParentCatalog() {
throw InternalException("CatalogEntry::ParentCatalog called on catalog entry without catalog");
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 10 additions & 10 deletions src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::RenameColumn(ClientContext &context, Re
create_info->constraints.push_back(std::move(copy));
}
auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down Expand Up @@ -331,7 +331,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::AddColumn(ClientContext &context, AddCo
create_info->columns.AddColumn(std::move(col));

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
auto new_storage =
make_shared<DataTable>(context, *storage, info.new_column, *bound_create_info->bound_defaults.back());
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, new_storage);
Expand Down Expand Up @@ -463,7 +463,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::RemoveColumn(ClientContext &context, Re
UpdateConstraintsOnColumnDrop(removed_index, adjusted_indices, info, *create_info, dropped_column_is_generated);

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
if (columns.GetColumn(LogicalIndex(removed_index)).Generated()) {
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}
Expand Down Expand Up @@ -498,7 +498,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::SetDefault(ClientContext &context, SetD
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down Expand Up @@ -526,7 +526,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::SetNotNull(ClientContext &context, SetN
create_info->constraints.push_back(make_uniq<NotNullConstraint>(not_null_idx));
}
auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));

// Early return
if (has_not_null) {
Expand Down Expand Up @@ -557,7 +557,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::DropNotNull(ClientContext &context, Dro
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down Expand Up @@ -633,7 +633,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::ChangeColumnType(ClientContext &context
AlterBinder expr_binder(*binder, context, *this, bound_columns, info.target_type);
auto expression = info.expression->Copy();
auto bound_expression = expr_binder.Bind(expression);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
vector<column_t> storage_oids;
for (idx_t i = 0; i < bound_columns.size(); i++) {
storage_oids.push_back(columns.LogicalToPhysical(bound_columns[i]).index);
Expand Down Expand Up @@ -668,7 +668,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::AddForeignKeyConstraint(ClientContext &
make_uniq<ForeignKeyConstraint>(info.pk_columns, info.fk_columns, std::move(fk_info)));

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));

return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}
Expand All @@ -691,7 +691,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::DropForeignKeyConstraint(ClientContext
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));

return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}
Expand All @@ -706,7 +706,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::Copy(ClientContext &context) const {
}

auto binder = Binder::CreateBinder(context);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
auto bound_create_info = binder->BindCreateTableInfo(std::move(create_info));
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
}

Expand Down
4 changes: 2 additions & 2 deletions src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector<u
}
if (column.Generated()) {
ss << " GENERATED ALWAYS AS(" << column.GeneratedExpression().ToString() << ")";
} else if (column.HasDefaultValue()) {
ss << " DEFAULT(" << column.DefaultValue().ToString() << ")";
} else if (column.DefaultValue()) {
ss << " DEFAULT(" << column.DefaultValue()->ToString() << ")";
}
}
// print any extra constraints that still need to be printed
Expand Down
Loading
Loading