> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/query-hcp/options-query-hcp/query-tab.md).

# Query tab

![Query tab in the Query HCP step](/files/x9bAeg28u6R1K92GcyUa)

In this tab, specify the VFS connection to connect to your HCP repository, and then refine your search with a query statement and other options.

| Option                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **HCP VFS Connection**          | From the drop-down list, select the [VFS connection](/pdia-data-integration/10.2-data-integration/data-integration-perspective-in-the-pdi-client/virtual-file-system-browser/create-a-vfs-connection-in-pdi.md) you created for this transformation to connect to your HCP repository.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Query statement**             | <p>Specify your HCP Metadata Query Engine (MQE) search statement for finding particular objects. For example, to find objects of 2000 MBs or greater, specify <code>+(size\[2000 TO \*])</code>.You can use the metadata query engine to generate a <strong>Query statement</strong> for PDI.</p><ol><li>In the HCP Namespace Browser, specify your filters in the <strong>Structured Query</strong> tab.</li><li>Click <strong>Show as advanced query</strong>. The related query statement is generated under the <strong>Advanced Query</strong> tab in the HCP Namespace Browser.</li><li>Copy the resulting HCP query statement into this PDI <strong>Query statement</strong> option.</li></ol><p>See <a href="https://knowledge.hitachivantara.com/Documents/Storage/Content_Platform/8.1.2/Developer_documentation/Searching_Namespaces/04_Working_with_structured_searches">Working with structured searches</a> and <a href="https://knowledge.hitachivantara.com/Documents/Storage/Content_Platform/8.1.2/Developer_documentation/Searching_Namespaces/05_Working_with_advanced_searches">Working with advanced searches</a> for more details.</p> |
| **Sort results by**             | Select which object properties you want to use to sort the results in alphabetical order.You can sort by **Ascending** or **Descending** order.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Number of rows to skip**      | (Optional) Specify a number of resulting objects to skip. This option is useful when setting up a paged query. See the "Paging through objects" section below for information about paged queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Number of results to return** | <p>(Optional) Specify the maximum number of objects to return. The maximum is 10,000 objects. If you do not specify a value for <strong>Number of results to return</strong>, HCP returns the properties of up to 100 objects.The following other values are possible for this option:</p><ul><li><strong><code>-1</code></strong></li></ul><p>Returns the properties of all the objects up to 10,000 objects.</p><ul><li><strong><code>0</code></strong></li></ul><p>Returns just the total count of objects in the HCP repository.</p><p>Hitachi Vantara recommends working with only a few thousand results at a time for the best performance.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

\## Paging through objects

You can use **Number of rows to skip** and **Number of results to return** to page through in your HCP repository. First, query the repository with **Number of results to return** set to `0` to obtain the total count of objects. Then, query the repository for a specify number of objects at an offset location by setting **Number of rows to skip**. Within a PDI transformation, you can loop over the Query HCP step with a variable offset to page through the objects in the HCP repository. See [Paged queries with object-based requests](https://knowledge.hitachivantara.com/Documents/Storage/Content_Platform/8.1.2/Developer_documentation/HCP_Metadata_Query_API_Reference/03_Query_requests#Paged_queries_with_object-based_requests) for more details on how to page through an HCP repository.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/query-hcp/options-query-hcp/query-tab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
