# Unable to cast data types programmatically

**URL:** <https://community.amazonquick.com/t/unable-to-cast-data-types-programmatically/10852>\
**Category:** Q&A\
**Tags:** dataset, quick-sight\
**Created:** [March 8, 2023, 6:30pm UTC](https://community.amazonquick.com/t/unable-to-cast-data-types-programmatically/10852 "2023-03-08T18:30:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0ltar](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/m0ltar/32/684_2.png) [@m0ltar](https://community.amazonquick.com/u/m0ltar)\
**Post date:** [March 8, 2023, 6:30pm UTC](https://community.amazonquick.com/t/unable-to-cast-data-types-programmatically/10852/1 "2023-03-08T18:30:31Z")

</div>

I am creating a data set thru the API. I am casting columns from an Athena query to a correct data type.

When I call `describe-data-set`, I do see the column types (`"Type": "INTEGER"`) are set in the `CustomSql.Columns` array and the `OutputColumns` array.

I am able to do a SPICE refresh without a problem.

Yet, when I look at the data set in the UI, all the preview column types are set to `STRING`.

I tried to completely delete the data set and create it again, and I got the same result.

How can a column type be specified during the data set creation or an update operation thru the API?

Thanks.

---

<div class="post-metadata">

**Author:** ![Max](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/max/32/2288_2.png) [@Max](https://community.amazonquick.com/u/Max)\
**Post date:** [March 10, 2023, 7:43pm UTC](https://community.amazonquick.com/t/unable-to-cast-data-types-programmatically/10852/2 "2023-03-10T19:43:38Z")

</div>

Can you paste in the json you are using to create the data set?

> **[CreateDataSet - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateDataSet.html)**
>
> Creates a dataset. This operation doesn't support datasets that include uploaded files as a source.

> **[UpdateDataSet - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdateDataSet.html)**
>
> Updates a dataset. This operation doesn't support datasets that include uploaded files as a source. Partial updates are not supported by this operation.

---

<div class="post-metadata">

**Author:** ![m0ltar](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/m0ltar/32/684_2.png) [@m0ltar](https://community.amazonquick.com/u/m0ltar)\
**Post date:** [March 20, 2023, 10:28pm UTC](https://community.amazonquick.com/t/unable-to-cast-data-types-programmatically/10852/3 "2023-03-20T22:28:26Z")

</div>

Was my fault, nothing to do with QS. Closing 🙂
