# Default Values in tileDB arrays

**URL:** <https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192>\
**Category:** Uncategorized\
**Created:** [June 5, 2020, 6:47am UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192 "2020-06-05T06:47:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![voss](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@voss](https://forum.tiledb.com/u/voss)\
**Post date:** [June 5, 2020, 6:47am UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/1 "2020-06-05T06:47:00Z")

</div>

Is there the possibility of having a default value, when creating an array, that when I am trying to read from it and I haven’t actually written anything into the array, I still get back that default value.

---

<div class="post-metadata">

**Author:** ![stavros](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@stavros](https://forum.tiledb.com/u/stavros)\
**Post date:** [June 5, 2020, 3:26pm UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/2 "2020-06-05T15:26:51Z")

</div>

Hi there. Yes, it is at the top of our list. A quick question: do you want to use a _dense_ or a _sparse_ array?

---

<div class="post-metadata">

**Author:** ![stavros](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@stavros](https://forum.tiledb.com/u/stavros)\
**Post date:** [June 7, 2020, 7:34pm UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/3 "2020-06-07T19:34:16Z")

</div>

Addressed by this PR: [https://github.com/TileDB-Inc/TileDB/pull/1666](https://github.com/TileDB-Inc/TileDB/pull/1666)

---

<div class="post-metadata">

**Author:** ![voss](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@voss](https://forum.tiledb.com/u/voss)\
**Post date:** [June 8, 2020, 7:02am UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/4 "2020-06-08T07:02:33Z")

</div>

> [@stavros](#):
>
> [Add arbitrary fill value support by stavrospapadopoulos · Pull Request #1666 · TileDB-Inc/TileDB · GitHub](https://github.com/TileDB-Inc/TileDB/pull/1666)

I am using a sparse array.

---

<div class="post-metadata">

**Author:** ![stavros](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@stavros](https://forum.tiledb.com/u/stavros)\
**Post date:** [June 8, 2020, 12:27pm UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/5 "2020-06-08T12:27:51Z")

</div>

For a sparse array, there is no notion of cells with default values. TileDB materializes on disk only _non-empty_ cells in the sparse case by definition, and therefore also returns only non-empty cells when slicing. Therefore, if a sparse array is empty, TileDB should not return any cells.

Do you mean instead that you’d like TileDB to return the cells from a sparse arrays in _dense form_? That is, write on disk only non-empty cells, but when you slice the array you can get a dense representation, which will naturally have default values for the empty cells?

---

<div class="post-metadata">

**Author:** ![michael-imbeault](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@michael-imbeault](https://forum.tiledb.com/u/michael-imbeault)\
**Post date:** [June 17, 2020, 10:18am UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/6 "2020-06-17T10:18:55Z")

</div>

I have a similar need, and what you suggest is what the desired behavior would be - get a dense result out of a sparse array (in my case, with empty cells filled with a 0). Use case is displaying the interval - of course I can fill in a zero-filled numpy array with what I get from tiledb, but it would be nice if getting the output directly was supported.

Is this currently possible?

---

<div class="post-metadata">

**Author:** ![stavros](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@stavros](https://forum.tiledb.com/u/stavros)\
**Post date:** [June 17, 2020, 1:03pm UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/7 "2020-06-17T13:03:55Z")

</div>

No it is not supported currently, but it is in our roadmap. We’ll hopefully have an update soon.

---

<div class="post-metadata">

**Author:** ![michael-imbeault](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@michael-imbeault](https://forum.tiledb.com/u/michael-imbeault)\
**Post date:** [June 17, 2020, 1:19pm UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/8 "2020-06-17T13:19:22Z")

</div>

Cool thanks - easy to work around in the mean time - also, is there a public roadmap somewhere?

---

<div class="post-metadata">

**Author:** ![stavros](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@stavros](https://forum.tiledb.com/u/stavros)\
**Post date:** [June 17, 2020, 1:28pm UTC](https://forum.tiledb.com/t/default-values-in-tiledb-arrays/192/9 "2020-06-17T13:28:53Z")

</div>

We have a feedback site: [https://feedback.tiledb.com/](https://feedback.tiledb.com/)

Would you like to suggest this feature there? We are planning on keeping that up-to-date.
