Description
openedon Jun 13, 2024
About
The CrateDB SQL query collection on behalf of library.py
, added with GH-88, needs further improvements. It has been assembled from a wave of quick & dirty operations, collected from different sources, without much review.
Details
While working on the code base, @seut discovered a few specific shortcomings in this area. Thank you. Maybe @WalBeh, @hlcianfagna, @hammerhead, or others have something to contribute to answer those questions.
Settings
Why only this small subset of settings? It's also not really dedicated to a concrete topic as both, rebalance and recovery settings are queried.
https://github.com/crate-workbench/cratedb-toolkit/blob/7b4e30525025fa2d310dd8ca8418442d3d5a4977/cratedb_toolkit/wtf/library.py#L369-L383
Shards
This looks unreasonable complicated to just translate the primary boolean into a string.
https://github.com/crate-workbench/cratedb-toolkit/blob/7b4e30525025fa2d310dd8ca8418442d3d5a4977/cratedb_toolkit/wtf/library.py#L422-L439
Why selecting the 2nd decision? This looks problematic e.g. when only 1 shard exists there isn't a 2nd decision.
https://github.com/crate-workbench/cratedb-toolkit/blob/7b4e30525025fa2d310dd8ca8418442d3d5a4977/cratedb_toolkit/wtf/library.py#L534-L543
Isn't the query above more detailed? I think this one can be skipped...
https://github.com/crate-workbench/cratedb-toolkit/blob/7b4e30525025fa2d310dd8ca8418442d3d5a4977/cratedb_toolkit/wtf/library.py#L591-L601
Thoughts
In general, I am happy to remove any item which should be skipped, and improve all others which have shortcomings, into a DWIM shape, based on your suggestions. Thanks already, and thanks in advance!