GitHub user singhpratech added a comment to the discussion: Apache Cloudberry 
through ODBC into Apache Arrow (adbcBridge 0.1.0) — is multi-argument unnest a 
safe bulk-ingest path on Cloudberry?

Thank you, this is exactly the kind of answer I was hoping for, and I agree 
with the principle: a capability test is a better contract than a banner.

For completeness, here is what the bridge does today. There is already a 
capability probe, and it is what actually protects the fast path: on a 
connection's first bulk ingest it runs one `SELECT … FROM 
unnest('{1,2,3,4,5}'::bigint[], '{"a,b}","",NULL,"x\"y","p\\q"}'::text[]) AS 
t(a, b)` and compares the aggregated answer to the string PostgreSQL produces, 
which pins down positional pairing of the two arrays, a NULL element, an empty 
element, a separator and a brace inside a quoted element, an escaped quote and 
an escaped backslash. Any other answer, or an error, and the connection keeps 
the multi-row `INSERT` path for good; the fallback you describe is always 
there. The probe is a plain read with no side effects, so it needs no 
transaction to roll back.

What the banner does is sit in front of that probe: a fork marker in 
`version()` means the probe is never even asked. So the change you are 
proposing is smaller than it sounds. Drop the fork allow-list, let the probe 
decide for any server behind psqlodbc, keep the fallback. Your unequal-length 
case is a good addition to the probe. The bridge only ever sends arrays of 
equal length, one per column, but a server that does not pad the shorter array 
with NULL the way PostgreSQL does is a server whose `unnest` semantics differ, 
and the probe should say so rather than assume. The distributed and 
append-optimized checks I will keep where they are, as compatibility tests 
against a real cluster: the probe runs before any table is involved, and what 
it establishes is the expansion; where the rows land afterwards is the 
`DISTRIBUTED BY` clause's business, which the extra steps already verify.

Until Cloudberry documents a guarantee of its own, your framing is the right 
one: the PostgreSQL documentation covers the form, Cloudberry passes the test 
today, and the bridge should re-check on every connection instead of trusting a 
name. The change is tracked here: 
https://github.com/singhpratech/adbcbridge/issues/83

GitHub link: 
https://github.com/apache/cloudberry/discussions/1939#discussioncomment-18311221

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to