-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add system command to show #25844
Comments
Okay I've started looking into how system tables are implemented to figure out how best to validate system table name arguments (ie the influxdb/influxdb3_server/src/system_tables/mod.rs Lines 31 to 41 in 061b62a
But now I'm wondering -- should this subcommand be constructing an SQL query and reaching out to another node's FlightSQL endpoint or should it be constructing its own system tables internally based on available object store connection parameters? I think with the latter approach there would probably be a lot of missing information since my rough understanding is that a lot of system table info lives in-memory only (at least, that's how it was in IOx). So the former approach is probably preferable, right? But in that case it's probably better not to worry about using the system table names in code to validate CLI table name arguments. |
The CLI should just be constructing a SQL query and running it through the front door. Can be FlightSQL or the HTTP API, whatever's easiest. What system tables exist can be established by querying the DB through the front door using The thing we'd want the user to be able to see, either through the CLI help or through a quick command is what system tables are available to query (which can be established through a query) |
Currently, queries to a given system table go through the select * from system.parquet_files The implementation of that is here in core. For the CLI described in the issue, one way would be to compose the request to the
the contents of which could be parsed in the API handler and used to construct a query and pass it in to the above interface. I agree that an API to show available system tables would be nice, and we probably have the means to do that. When a query comes in, the system table provider is constructed on the fly here: influxdb/influxdb3_server/src/query_executor/mod.rs Lines 451 to 458 in 061b62a
We could have a new method on the |
I'd hold off on creating APIs for these things and instead lean on using the query API and its results. I want to keep the HTTP API surface area as small as possible, which is why we have system tables for everything in the DB. The |
Yeah this is what I was leaning toward myself -- it should be more resilient to code changes like the addition or removal of system tables. As far as the subcommand structure goes, I was thinking of something a little different than what's described in this issue:
Where
|
Your suggested list looks good to me |
Closing this issue after addressing in #25912 |
We expose all information about the server and its state through system tables. The user can execute queries from the command line to get at this, but it would be a nice convenience to have a command to quickly show the most recent records in any system table.
Something like:
Limit should default to 100 so it is optional. The help should display what are valid names for the system table we're querying. Under the covers the CLI should just execute the query for the user.
This would likely be good enough to close out #25792
The text was updated successfully, but these errors were encountered: