apache / apache/arrow

[C++][FlightSQL][ODBC][SQLPrimaryKeys] Implement SQLPrimaryKeys catalog function

Open
#50,805 1 comment 0 reactions 0 assignees View on GitHub
Component: C++ Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

`SQLPrimaryKeys` is currently an unimplemented placeholder in the Arrow Flight SQL ODBC driver. In `cpp/src/arrow/flight/sql/odbc/entry_points.cc`, the entry point logs its arguments and then throws:

```
arrow::flight::sql::odbc::DriverException("SQLPrimaryKeysW is not implemented", "IM001")
```

The placeholder was added in #47725 with the intent that follow-up PRs would implement each API. This issue tracks implementing `SQLPrimaryKeys`.

The underlying capability already exists on the Flight SQL C++ client (`cpp/src/arrow/flight/sql/client.h`): `GetPrimaryKeys()` / `GetPrimaryKeysSchema()`.

Ref (SQLPrimaryKeys spec): https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlprimarykeys-function

Parent issue: https://github.com/apache/arrow/issues/30622

### Component(s)

C++

Contributor guide

Open the contributing guide

Research direction

Start in cpp/src/arrow/flight/sql/odbc/entry_points.cc, then read GetPrimaryKeys() and GetPrimaryKeysSchema() in cpp/src/arrow/flight/sql/client.h alongside the SQLPrimaryKeys specification. Replace the placeholder behavior with the catalog function implementation, preserving the required ODBC arguments and results; done means SQLPrimaryKeys no longer throws the not-implemented error and returns primary-key metadata through the Flight SQL client.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.