In some cases, we see the error in subject while attempting to list tablets for a YSQL table using `yb-admin`.
Example:
For a database named `foo` and a table named `bar` that only exists in YSQL namespace, you might see the error below:
yb-admin -master_addresses ip1:7100,ip2:7100,ip3:7100 list_tablets foo bar 0
Error: Invalid argument (yb/tools/yb-admin_client.cc:339): Namespace 'foo' of type 'ycql' not found
What happens behind the scenes is that list_tablets by default assumes a YCQL namespace, hence complains about missing table in YCQL namespace.
In most cases, such errors will go away by simply using the `ysql.` prefix.
yb-admin -master_addresses ip1:7100,ip2:7100,ip3:7100 list_tablets ysql.foo bar 0
Same YSQL table name in different schema in the same database:
There is an edge case for YSQL tables and that is when you may also have same table name in different schema within the same YSQL database.
The two tables will appear inside the same YB keyspace in platform UI. However, listing tablets in such cases even with ysql. will result in the following error:
$ yb-admin -master_addresses ip1:7100,ip2:7100,ip3:7100 list_tablets ysql.foo bar
Error: Invalid argument (yb/tools/yb-admin_client.cc:371): Namespace 'ysql.foo' has multiple tables named 'bar', specify table id instead
Even though we used the `ysql.` qualifier, we still got an error. And, these are the types of cases where you'd require the tableid syntax.
yb-admin -master_addresses ip1:7100,ip2:7100,ip3:7100 list_tablets tableid.0000000000000000000007
In the syntax above, you do not require a ysql or ycql prefix or a keyspace name.
Comments
0 comments
Please sign in to leave a comment.