You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Diadochokinetic (via GitHub)" <gi...@apache.org> on 2024/12/02 20:10:34 UTC
[I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Diadochokinetic opened a new issue, #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343
### What feature or improvement would you like to see?
### Describe the use case
Currently `adbc_ingest` supports a parameter `temporary` to execute `CREATE TEMPORARY TABLE` statements. `sqlalchemy` supports this in a more abstract way, by accepting a list of table [`prefixes`](https://docs.sqlalchemy.org/en/20/core/metadata.html#sqlalchemy.schema.Table.params.prefixes). I suggest to upgrade the API by implementing a `prefixes` parameter like `sqlalchemy.Table`.
### Databases / Backends / Drivers targeted
Some DBMS, e.g. `ibm db2`, support the use of [`CREATE GLOBAL TEMPORARY TABLE`](https://www.ibm.com/docs/en/db2/11.5?topic=statements-create-global-temporary-table) and therefore need multiple table prefixes.
### Example Use
Create a global temporary table from some data.
```python
with con.cursor() as cur:
total_inserted = cur.adbc_ingest(
table_name="TEST",
data=some_data,
mode="create",
db_schema_name="SESSION",
temporary=["GLOBAL", "TEMPORARY"],
)
con.commit()
```
User can then use this "empty shell" to insert and further process data within their respective session.
### Additional context
I'm currently working on adding a `prefixes` parameter to `pandas to_sql()` method, see https://github.com/pandas-dev/pandas/pull/60409 for reference. Since `to_sql()` supports both `sqalchmy` and `adbc` it would be beneficial for the ecosystem to have feature parity. The current state of progress:
- I fully implemented `prefixes` for `sqlalchemy` drivers
- I implemented a way to only use the `TEMPORARY` keyword from `prefixes` for `adbc` drivers
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2520891566
I agree with @lidavidm for the most part here, I'm hesitant to bake the SQLAlchemy part of the option in unless it is a more widely utilized feature. Until we see more systems leveraging something like this it might be better to simply have `GLOBAL` vs not `GLOBAL` be a separate, DB2 specific option. If we see in the future more systems supporting this, then it can make sense to make a more formal change at that point to formalize the `PREFIXES` style then rather than making this change now. That's my two cents at least.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513674554
That said, looking at the original issue: for ADBC, the idea would be that `temporary=True` would automatically (in a hypothetical DB2 driver) generate `CREATE GLOBAL TEMPORARY TABLE`, instead of requiring the user to know about this. Are there prefixes where this needs to be under the user's control?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513865723
Ah, ok. I suppose having the option can be useful, but I'm hesitant to actually do so until we support databases that need it (I don't think any of our current backends do?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513182440
Is there anything else you think may be missing that we can tackle while we're at it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513868275
Partly I'm hesitant to effectively bake in a SQLAlchemy option, though having this functionality in the first place opens us up to that discussion, so I'm not necessarily against it, I suppose I'd just like to see other examples, or debate whether it needs to be an option fully in the spec vs. an option that only a few drivers support (I suppose the latter complicates use on your side, though)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2521065163
One of the ways that I've worked around limitations of the ingest in the past is to do something like:
- Execute `CREATE WHATEVER WHATEVER TABLE XXX`
- Ingest using `append` mode (maybe this is still a problem if we need to resolve the name of the table in some special way)
...but I don't know what kind of limitations that incurs with respect to drivers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513182213
I added this to the spec milestone but I think we can also just add out-of-band parameter definitions as we have in the past to handle this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513267528
Ah I see. @Diadochokinetic open to any contribution you'd like to make here. I should have some time to explore that in more detail later this week if needed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2518729897
Got it, thanks. Hmm, it seems for DB2 we would just treat temporary as equal to `GLOBAL TEMPORARY` by default, since it doesn't seem to have any other option; for Postgres and Snowflake global/local/volatile are just aliases to ease porting from other systems; unlogged/transient do actually do something.
@paleolimbot @zeroshade any thoughts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-3942158607
Moving this out of the milestone. I think we need to prototype this in drivers before committing to it in the standard, and it's unclear to me whether the prefixes are actually useful much of the time (and there's the workaround Dewey mentioned).
(Also, parity with SQLAlchemy isn't necessarily a goal.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "Diadochokinetic (via GitHub)" <gi...@apache.org>.
Diadochokinetic commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2518057261
I checked the docs of some of the currently supported databases and there are a couple, e.g. `postgres` and `snowflake`, that support multiple prefixes. I edited my initial post and added some links to the respective docs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513227393
@lidavidm what do you mean by adding an `out-of-band parameter`? In the case of the OP just adding a `global=` parameter?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513238324
Oh, I mean just adding a parameter that the drivers agree on by convention without going through the full vote (and we can roll it up into the next vote)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Upgrade `adbc_ingest` parameter `temporary` to `prefixes` [arrow-adbc]
Posted by "Diadochokinetic (via GitHub)" <gi...@apache.org>.
Diadochokinetic commented on issue #2343:
URL: https://github.com/apache/arrow-adbc/issues/2343#issuecomment-2513753097
`db2` offers both: `CREATE TEMPORARY TABLE` and `CREATE GLOBAL TEMPORARY TABLE`. The first one only exists within a session, the second one exists forever (or until dropped), but the data is only available within a session. Depending on the use case, you need to pass either ["TEMPORARY"] or ["GLOBAL", "TEMPORARY"].
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org