# Custom SQL function or UDF

**URL:** <https://community.dremio.com/t/custom-sql-function-or-udf/157>\
**Category:** Uncategorized\
**Created:** [August 1, 2017, 9:02pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157 "2017-08-01T21:02:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Suh](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@Tim\_Suh](https://community.dremio.com/u/Tim_Suh)\
**Post date:** [August 1, 2017, 9:02pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/1 "2017-08-01T21:02:47Z")

</div>

Can we add a custom user defined function to dremio? I read the documentation but did not see any option to create my own function. Is this possible?

---

<div class="post-metadata">

**Author:** ![can](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/can/32/40_2.png) [@can](https://community.dremio.com/u/can)\
**Post date:** [August 1, 2017, 9:13pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/2 "2017-08-01T21:13:19Z")

</div>

Hey Tim, thanks for bringing this up. This is one of the top items on our roadmap. I’ll reach out with more details as we plan and schedule this.

---

<div class="post-metadata">

**Author:** ![Tim\_Suh](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@Tim\_Suh](https://community.dremio.com/u/Tim_Suh)\
**Post date:** [August 2, 2017, 4:05pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/3 "2017-08-02T16:05:19Z")

</div>

Can, thank you. I am very excited about this product so feel free to share your roadmap with me if allowed.

---

<div class="post-metadata">

**Author:** ![Monika\_Goel](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Monika\_Goel](https://community.dremio.com/u/Monika_Goel)\
**Post date:** [August 22, 2018, 1:51pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/4 "2018-08-22T13:51:10Z")

</div>

Hi Can, please update if UDF feature is now available or not?

---

<div class="post-metadata">

**Author:** ![sambitdixit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/sambitdixit/32/848_2.png) [@sambitdixit](https://community.dremio.com/u/sambitdixit)\
**Post date:** [August 29, 2018, 1:12pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/5 "2018-08-29T13:12:06Z")

</div>

Is it possible to create a custom UDF function in DremIO. For example i have one column which contains json string. I want to have a get\_json\_object type of UDF as in Hive. If not available i was thinking of can write one if there are interface specs or samples available.

---

<div class="post-metadata">

**Author:** ![kelly](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/kelly/32/11_2.png) [@kelly](https://community.dremio.com/u/kelly)\
**Post date:** [August 29, 2018, 5:39pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/6 "2018-08-29T17:39:44Z")

</div>

There’s a lot of support for JSON in Dremio without resorting to UDFs. For example, you can use . to access children, and the FLATTEN() operator to handle arrays:

[https://docs.dremio.com/sql-reference/sql-functions/nested-data.html](https://docs.dremio.com/sql-reference/sql-functions/nested-data.html)

What is particular are you trying to do with JSON?

---

<div class="post-metadata">

**Author:** ![can](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/can/32/40_2.png) [@can](https://community.dremio.com/u/can)\
**Post date:** [August 30, 2018, 8:43pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/7 "2018-08-30T20:43:05Z")

</div>

hey @sambitdixit, how about something like the following:

```sql
SELECT convert_from('{"a":1,"b":["x","y","z"]}', 'JSON') AS field
FROM (values 1)

```

You can then access individual items as follows:

```sql
field.a --would return 1
field.b[0] --would return "x"
FLATTEN(field.b) --would return a new row for each item in b

```

---

<div class="post-metadata">

**Author:** ![sambitdixit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/sambitdixit/32/848_2.png) [@sambitdixit](https://community.dremio.com/u/sambitdixit)\
**Post date:** [September 3, 2018, 10:37am UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/8 "2018-09-03T10:37:51Z")

</div>

Thanks can & kelly . This is useful.

---

<div class="post-metadata">

**Author:** ![jalandhar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/jalandhar/32/2553_2.png) [@jalandhar](https://community.dremio.com/u/jalandhar)\
**Post date:** [June 18, 2020, 8:49am UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/9 "2020-06-18T08:49:40Z")

</div>

Hey team,  
Did we enable the support of UDFs in Dremio or is it still in the roadmap?

It would be great if someone can help on this use case

Thanks,  
Jalandhar

---

<div class="post-metadata">

**Author:** ![hugabora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/hugabora/32/4466_2.png) [@hugabora](https://community.dremio.com/u/hugabora)\
**Post date:** [October 6, 2022, 1:46pm UTC](https://community.dremio.com/t/custom-sql-function-or-udf/157/10 "2022-10-06T13:46:41Z")

</div>

[https://github.com/dremio-hub/dremio-internal-function-example](https://github.com/dremio-hub/dremio-internal-function-example) may be helpful
