# Rockset

## Authentication Methods

Rockset connections support [API Key authentication](https://rockset.com/docs/iam/#users-api-keys-and-roles).

## Supported Data Types

{% hint style="warning" %}
Rockset is a document store and does not impose static typing on columns.

Because Salesforce fields expect consistent data types to be used, it is your responsibility to ensure that this occurs.

If you aren't careful with this, you may see runtime errors like:

> The "amount\_\_c" field is of type number, but the value from the external system is "hello"

The Omnata Setup process will make every effort to choose an appropriate data type, but in some situations it relies on a sample of values that don't cover the full range of possibilities.

If you prefer to guarantee readability and sacrifice some filtering capability, you can manually change the Salesforce field type to Text.
{% endhint %}

The following table describes the current mapping between Rockset data types and Salesforce.

| Rockset   | Corresponding Salesforce type                                                                                                                                                            |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| float     | NUMBER\_TYPE if the precision is < 18, otherwise STRING\_SHORT\_TYPE                                                                                                                     |
| int       | NUMBER\_TYPE                                                                                                                                                                             |
| bool      | <p>BOOLEAN\_TYPE (rendered as Checkbox)</p><p><em>Note that Salesforce does not support null values here, so you must ensure that none exist.</em></p>                                   |
| date      | <p>Dates are not supported by Salesforce Connect, but the adapter converts to DATETIME\_TYPE (at midnight) for convenience.</p><p>This makes them usable but potentially misleading.</p> |
| datetime  | DATETIME\_TYPE                                                                                                                                                                           |
| timestamp | DATETIME\_TYPE                                                                                                                                                                           |
| time      | STRING\_SHORT\_TYPE                                                                                                                                                                      |
| string    | STRING\_SHORT\_TYPE if the max length is <255, otherwise STRING\_LONG\_TYPE                                                                                                              |

## Improving View Performance

Rockset does not provide column metadata for views via the DESCRIBE statement, which we need to fetch whenever the platform cache is cleared.

For performance reasons, we recommend creating a collection named ***\<view name>*****\_sample** containing a sample of the records in your view. If you don't do this, we'll sample the view directly to determine the column data types which may be slow on larger datasets.

To do this, first query your view with a limit of 20 records and download the result as a JSON file.

<figure><img src="/files/IwhMYkcbwM4ewv3SPsRk" alt=""><figcaption><p>Note that these records will be used to infer the column schema of your view, so if you have columns that contain a lot of null values, you may wish to take a larger sample or filter the view. There is no performance impact for using a larger sample, as we'll only be using DESCRIBE on this sample collection.</p></figcaption></figure>

Then create a Collection, upload the JSON file, and click "Next" through to step 3.

Ensure your new collection is in the same workspace as your view, and give it the same name with the **\_sample** suffix:

<figure><img src="/files/ZRPk4QTEeJUjxZW97Deb" alt=""><figcaption></figcaption></figure>

Once this is done, refresh the External Objects in the Omnata UI and the warning should disappear.


---

# Agent Instructions: 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.omnata.com/omnata-product-documentation/omnata-connect-for-salesforce/getting-started/connect-to-your-data-warehouse/rockset.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.
