# Data types for Spark

![](/files/-MdvUYcjsd_NKbapidlg)

The handling of data types is explained in [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#request_data).

Although Excel is not a [statically typed](https://developer.mozilla.org/en-US/docs/Glossary/Static_typing#:~:text=A%20statically%2Dtyped%20language%20is,not%20indicate%20their%20variable%20types.) language, understanding how Spark processes Excel's *Number Category* is important in ensuring the inputs and outputs are processed correctly.

## *Number Category* in Excel

Please follow these formatting guidelines when preparing an Excel file to be used in Spark.

### Blank values

* For a single cell without a default value, leave the cell blank if possible. Avoid introducing quotations such as `=""`.

### Numbers and text

* To return a number value as a string, consider the following:
  * Set the Format of the cell to the Text category in Excel (see above).
  * Begin cell formulas with `=TEXT(`. This enables custom formatting to be applied to numbers and for them to be returned as a string.
  * Do not use an apostrophe before a number to denote it as a string. This will not prevent a number from being returned as a number unless the cell is defined as a Text category.
  * It is not uncommon to see data validation lists defined as `"0,1,2+"`. See [How to: Prepare an Excel file for Spark](/build-spark-services/how-to-prepare-an-excel-file-for-spark.md#avoid-data-type-clashes).

### Dates and times:

* For dates, use the date format `YYYY-MM-DD`.
* For times, use the time format `hh:mm:ss`.
* For Spark to read a combined date and time field correctly, it must be set to a format that includes date and time. For this type of field, use the Custom category and define the format as either `YYYY-MM-DD hh:mm:ss` or `YYYY-MM-DDThh:mm:ss.sssZ`.


---

# 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.coherent.global/build-spark-services/data-types-for-spark.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.
