หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา
- Service Overview
- Billing
- Getting Started
-
User Guide
-
HBase User Guide
-
HBase Cluster Management
- Overview
- Managing Clusters
- Preparing an ECS
- Using HBase
- HBase Cold and Hot Data Separation
- HBase Thrift Server
- HBase Security Channel Encryption
- HBase Batch Data Import
- HBase Monitoring Clusters
- Self-Healing from HBase Hotspotting
- Global Secondary Indexes
-
HBase Cluster Management
-
ClickHouse User Guide
-
ClickHouse Cluster Management
- Overview
- Managing ClickHouse Clusters
- Using ClickHouse
- Migrating ClickHouse Data
- ClickHouse User Management
- ClickHouse Role Management
- ClickHouse Slow Query Management
- Configuring Secure Channel Encryption for ClickHouse Clusters
- Application of ClickHouse Cold and Hot Data Separation
- ClickHouse Monitoring Clusters
-
ClickHouse Cluster Management
- Permissions Management
- Audit Logs
- Cluster Log Management
-
HBase User Guide
-
Developer Guide
- HBase Application Development Guide
- ClickHouse Application Development Guide
-
FAQs
-
General
- What Services Does a CloudTable Cluster Provide?
- Why Do I Choose CloudTable Service?
- How Do I Prepare for Creating a CloudTable HBase Cluster?
- What Should I Pay Attention to When Using CloudTable Service?
- What Compression Algorithms Are Supported by CloudTable HBase Clusters?
- Can I Stop CloudTable Service?
- Which Programming Languages Are Supported by HBase External APIs in CloudTable?
- How Do I Determine the Number of Faulty RegionServers?
- What Special Characters Does CloudTable HBase Support?
- What Can I Do If the Index Table Does Not Match the Data Table After CloudTable Data Is Deleted?
- What Should I Do If Concurrent Tasks Run Slowly When Python Accesses CloudTable Through Thrift?
- How do I view the TTL attribute of HBase shell?
- Why Are My Server Resources Released?
- How Do I Delete a Cluster?
- How Do I Stop Services and Release Resources?
-
Connection and Access
- How Do I Access a CloudTable Cluster?
- Can I Use SSH to Access Computing Nodes of CloudTable?
- Why Can't I Access HBase After the ZK Address Is Configured?
- Why Is the Error "Will not attempt to authenticate using SASL (unknown error)" Reported When Connecting to HBase?
- How Do I View the IP Address Corresponding to a Domain Name in a CloudTable Link?
- How Do I Access CloudTable from Other Cloud Services?
- Can I Configure the hbase-site.xml File?
- How Do I Query the Creation Time of a Table in CloudTable HBase?
-
Data Read/Write
- Is Raw Data Stored in CloudTable HBase?
- Why Can't I Write Data to HBase?
- What Is the Maximum Size of Data Written to the HBase Cluster?
- How Do I Check the Daily Incremental Data in HBase Tables?
- What Should I Do If an Error Is Reported When I Access the CloudTable HBase Cluster?
- How Do I Delete the Backup Table of the ZooKeeper Node in the ClickHouse Cluster?
- What Should I Do If a Database Missing Error Occurs When a Table Is Created in the ClickHouse Cluster?
- Billing FAQs
-
General
- General Reference
On this page
Help Center/
CloudTable Service/
Developer Guide/
HBase Application Development Guide/
Developing Term Index Applications/
Sample Code Description/
Common Query
Copied.
Common Query
Function Description
Based on the Lucene syntax, CloudTable term index provides the self-developed query API LemonTable.query(LemonQuery query).
Sample Code
public void testNormalQuery() { LOG.info("Entering testNormalQuery."); try (Table table = conn.getTable(tableName)) { // Using Table instance to create LemonTable. LemonTable lemonTable = new LemonTable(table); // Build LemonQuery. LemonQuery query = LemonQuery.builder() // Set ad-hoc query condition. .setQuery("education:bachelor OR education:master") //(1) // Set how many rows should be cached on client for the initial request. .setCaching(10) //(2) // Set return column family/columns. .addFamily(FAM_M) .addColumn(FAM_N, QUA_N) //(3) // Set return return result just contains rowkeys, no any qualifier // the CF of LemonConstants.EMPTY_COLUMN_RETURN can be a random existing CF //.addColumn(FAM_M, LemonConstants.EMPTY_COLUMN_RETURN) .build(); ResultSet resultSet = lemonTable.query(query); // Read result rows. int count = resultSet.getCount(); LOG.info("the entity count of query is " + count); List<EntityEntry> entries = resultSet.listRows(); for (EntityEntry entry : entries) { Map<String, Map<String, String>> fams = entry.getColumns(); for (Map.Entry<String, Map<String, String>> familyEntry : fams.entrySet()) { String family = familyEntry.getKey(); Map<String, String> qualifiers = familyEntry.getValue(); for (Map.Entry<String, String> qualifier : qualifiers.entrySet()) { String Qua = qualifier.getKey(); String value = qualifier.getValue(); LOG.info("rowkey is " + Bytes.toString(entry.getRow()) + ", qualifier is " + family + ":" + Qua + ", value is " + value); } } } } catch (IOException e) { LOG.error("testNormalQuery failed ", e); } LOG.info("Exiting testNormalQuery."); }
Precautions
(1) Indicates a query condition, which complies with the Lucene syntax/BNF normal form. Example:
"Male ANDMarried AND AGE:25-30 AND BLOOD_TYPE:A" "Male ANDMarried AND (AGE:25-30 OR AGE:30-35)AND BLOOD_TYPE:A"
(2) Indicates the number of rows of data to be returned in the query result.
(3) Indicates which qualifiers are returned in each row of data. If only a column family is set, all columns in the column family are returned.
Parent topic: Sample Code Description
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot