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

Documentation: Improve docs for ctk load table #221

Open
amotl opened this issue Aug 14, 2024 · 3 comments
Open

Documentation: Improve docs for ctk load table #221

amotl opened this issue Aug 14, 2024 · 3 comments

Comments

@amotl
Copy link
Member

amotl commented Aug 14, 2024

Just a small thing that it may be worth mentioning in the docs, the schema translation part takes the name of the MongoDB collection for the CREATE TABLE statement but the data load part takes the table name from the CRATEDB_SQLALCHEMY_URL so these 2 have to match for ctk load table to work.

Originally posted by @hlcianfagna in #216 (review)

@amotl
Copy link
Member Author

amotl commented Aug 14, 2024

Hi Hernan. Thanks for your suggestion. I am sure there are anomalies, but I can't spot them, probably because of operational blindness, and your description doesn't tell me anything where to apply an improvement, and what, at least not enough to make it actionable for me.

I know that migr8 splits the procedure into two phases, and that ctk load table bundles it. In this spirit, I don't know where to discriminate, and/or improve the documentation. Apologies.

Can I humbly ask you to submit a corresponding suggestion how and where to improve the documentation, either by commenting on the patch GH-216, or by submitting a separate one? Thanks a stack!

@hlcianfagna
Copy link

Hi, apologies for the delay coming back to you on this. This is for the case where we may want the table on CrateDB to have a different name from the collection in MongoDB (a real world example involved the need to filter what was pulled from MongoDB which was done with a view on the MongoDB side - but the final desired state in CrateDB was to have a table with the collection's original name not the view's name), when I tested this it looked like ctk load table would only work if those 2 matched, which is not obvious as the fact we can define a target table name in the CRATEDB_SQLALCHEMY_URL suggests we can use any name for the destination table, so we could mention this where we introduce CRATEDB_SQLALCHEMY_URL in the documentation or we could think of somehow amending the CREATE TABLE to use the table name from the connection string.

@amotl
Copy link
Member Author

amotl commented Oct 14, 2024

when I tested this it looked like ctk load table would only work if those 2 matched, which is not obvious as the fact we can define a target table name in the CRATEDB_SQLALCHEMY_URL suggests we can use any name for the destination table

Ah I see. Thanks for clarifying. Yes, in theory, the target table should be defined by CRATEDB_SQLALCHEMY_URL. If it's not, it's certainly a bug that should be fixed. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants