I want to clarify something on intended behavior with “use branch” (all “use” statements, in fact).
Right now in Dremio-Cloud, when I open a query window and submit this statement:
create branch my_test_branch AT BRANCH main in analytics;
The branch is created as expected.
Then I run this statement:
use branch my_test_branch in analytics;
The context of the query window does not change. Generally, any “use” statement does not change the context of the current query window.
I expected the context of the current query window to change when I ran a “use” statement, and the fact that it didn’t strikes me as a bit of a landmine.
I would also expect “use my_datasource” would change the query window’s context to “my_datasource”.
Stated another way, currenly “use” statements seem to only apply to subsequent statements in a batch of sql statements, rather than to all subsequent statements in the current query window.
Is this the intended behavior? Is there any way I could change it so “use” statements immediately change the context of the current query window?
@capnjosh On both cloud and softare I tried to use the USE statement and folloed by a query, The context of the window does not change but query completes. Id your concern the context in the SQL runner pane does not switch?
Yes, my concern is that the context in the SQL runner pane does not change.
I can see how this may be a user preference. Could you maybe support a configurable that would allow admins to choose the behavior they prefer?
@capnjosh provided feedback to the concerned team
The USE command is suppose to affect the current session but the way we define session differs between the UI and Arrow/JDBC/ODBC clients. So, the USE command would work as expected with the ARROW/JDBC/ODBC clients because it is persistent. Whereas for the UI, it is defaulted to the UI’s picker and then overridden (possibly repeatedly) in a multi-state SQL or script.
There’s a long standing improvement to have the USE command also update the UI picker.
Makes sense. If you can add my vote to that improvement backlog item (to make “use” statements update the context of the current query window), it would be an enthusiastic vote 