Skip to content

Commit

Permalink
Remove unused attribute and instead don't name unused input argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaruza committed Dec 16, 2024
1 parent ea2e64a commit 731faad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
8 changes: 3 additions & 5 deletions src/catalog/pgduckdb_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,18 @@ PostgresTable::GetTableCardinality(Relation rel) {
}

duckdb::unique_ptr<duckdb::BaseStatistics>
PostgresTable::GetStatistics(__attribute__((unused)) duckdb::ClientContext &context,
__attribute__((unused)) duckdb::column_t column_id) {
PostgresTable::GetStatistics(duckdb::ClientContext &, duckdb::column_t) {
throw duckdb::NotImplementedException("GetStatistics not supported yet");
}

duckdb::TableFunction
PostgresTable::GetScanFunction(__attribute__((unused)) duckdb::ClientContext &context,
duckdb::unique_ptr<duckdb::FunctionData> &bind_data) {
PostgresTable::GetScanFunction(duckdb::ClientContext &, duckdb::unique_ptr<duckdb::FunctionData> &bind_data) {
bind_data = duckdb::make_uniq<PostgresScanFunctionData>(rel, cardinality, snapshot);
return PostgresScanTableFunction();
}

duckdb::TableStorageInfo
PostgresTable::GetStorageInfo(__attribute__((unused)) duckdb::ClientContext &context) {
PostgresTable::GetStorageInfo(duckdb::ClientContext &) {
throw duckdb::NotImplementedException("GetStorageInfo not supported yet");
}

Expand Down
16 changes: 7 additions & 9 deletions src/scan/postgres_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ PostgresScanGlobalState::ConstructFullyQualifiedTableName() {
quote_identifier(get_rel_name(rel->rd_rel->oid)));
}

PostgresScanGlobalState::PostgresScanGlobalState(Snapshot _snapshot, Relation _rel, duckdb::TableFunctionInitInput &input)
PostgresScanGlobalState::PostgresScanGlobalState(Snapshot _snapshot, Relation _rel,
duckdb::TableFunctionInitInput &input)
: snapshot(_snapshot), rel(_rel), table_tuple_desc(RelationGetDescr(rel)), count_tuples_only(false),
total_row_count(0) {
ConstructTableScanQuery(input);
Expand Down Expand Up @@ -166,16 +167,14 @@ PostgresScanTableFunction::PostgresScanTableFunction()
}

duckdb::unique_ptr<duckdb::GlobalTableFunctionState>
PostgresScanTableFunction::PostgresScanInitGlobal(__attribute__((unused)) duckdb::ClientContext &context,
duckdb::TableFunctionInitInput &input) {
PostgresScanTableFunction::PostgresScanInitGlobal(duckdb::ClientContext &, duckdb::TableFunctionInitInput &input) {
auto &bind_data = input.bind_data->CastNoConst<PostgresScanFunctionData>();
auto global_state = duckdb::make_uniq<PostgresScanGlobalState>(bind_data.snapshot, bind_data.rel, input);
return global_state;
}

duckdb::unique_ptr<duckdb::LocalTableFunctionState>
PostgresScanTableFunction::PostgresScanInitLocal(__attribute__((unused)) duckdb::ExecutionContext &context,
__attribute__((unused)) duckdb::TableFunctionInitInput &input,
PostgresScanTableFunction::PostgresScanInitLocal(duckdb::ExecutionContext &, duckdb::TableFunctionInitInput &,
duckdb::GlobalTableFunctionState *gstate) {
auto global_state = reinterpret_cast<PostgresScanGlobalState *>(gstate);
return duckdb::make_uniq<PostgresScanLocalState>(global_state);
Expand All @@ -189,8 +188,8 @@ SetOutputCardinality(duckdb::DataChunk &output, PostgresScanLocalState &local_st
}

void
PostgresScanTableFunction::PostgresScanFunction(__attribute__((unused)) duckdb::ClientContext &context,
duckdb::TableFunctionInput &data, duckdb::DataChunk &output) {
PostgresScanTableFunction::PostgresScanFunction(duckdb::ClientContext &, duckdb::TableFunctionInput &data,
duckdb::DataChunk &output) {
auto &local_state = data.local_state->Cast<PostgresScanLocalState>();

/* We have exhausted table scan */
Expand Down Expand Up @@ -221,8 +220,7 @@ PostgresScanTableFunction::PostgresScanFunction(__attribute__((unused)) duckdb::
}

duckdb::unique_ptr<duckdb::NodeStatistics>
PostgresScanTableFunction::PostgresScanCardinality(__attribute__((unused)) duckdb::ClientContext &context,
const duckdb::FunctionData *data) {
PostgresScanTableFunction::PostgresScanCardinality(duckdb::ClientContext &, const duckdb::FunctionData *data) {
auto &bind_data = data->Cast<PostgresScanFunctionData>();
return duckdb::make_uniq<duckdb::NodeStatistics>(bind_data.cardinality, bind_data.cardinality);
}
Expand Down

0 comments on commit 731faad

Please sign in to comment.