You always need to query a data record in Lindorm when you develop, debug, or maintain your services. You can use Lindorm Shell to create Get and Scan queries. You can also use the easy-to-use SQL query interface in Lindorm Insight to query data. In the interface, you can use the SQL syntax to query Lindorm tables.
- The system supports only SELECT statements. If you need to modify data, use the command-line interface or use the ApsaraDB for HBase API to develop an application.
- To ensure data security, the system returns a maximum of 100 data records for each query.
- To query varbinary fields based on conditions, you must use hexadecimal strings as values.
- The ROW field corresponds to the rowkey in ApsaraDB for HBase. The ROW and qualifier fields are of the varbinary data type. If the qualifier does not belong to the family, you must specify the family, such as
select 'ROW', q1, 'f1:q2' from....
- ROW and COL are SQL reserved words. Therefore, you must use backticks to enclose them in your queries. When you specify a family for a qualifier, you must also use backticks to enclose the family.
- Log on to the Lindorm Insight system. For more information, see Log on to Lindorm Insight.
- In the left-side navigation pane, click Data Query.
- On the SQL query page, select a namespace from the corresponding drop-down list. All the tables in
the selected namespace are displayed on the right side of the page. Then, edit SQL
query statements based on the information about these tables and click execute.
Convert binary strings to hexadecimal strings
In Lindorm, data is stored in the
byte format. In the query results on the SQL query page, the values of
varbinary fields are displayed in the Lindorm BinaryString coding format.
If you query
varbinary fields based on conditions, you use a
where clause that contains
rowkey or other fields in your query statement. In this case, you must specify the values
in the query conditions as hexadecimal strings. For example, to query data where the
where clause in the SQL query must be
where rowkey='7321'. In this example, the hexadecimal value of the
r1 string is