# Unable to Upload valid JSON

**URL:** <https://community.dremio.com/t/unable-to-upload-valid-json/10173>\
**Category:** Uncategorized\
**Created:** [January 13, 2023, 9:49am UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173 "2023-01-13T09:49:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohsin.mansur](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mohsin.mansur](https://community.dremio.com/u/mohsin.mansur)\
**Post date:** [January 13, 2023, 9:49am UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/1 "2023-01-13T09:49:00Z")

</div>

Hello  
I am trying to upload a valid JSON file into dremio but it is giving error. And I think its due to it has values in mix of array and non-array for same attribute name. As this is valid JSON I am expecting it to be uploaded seamlessly

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/9/967d1e970c4194c33b5d3b24b5e42492f39432e7.png)

```auto
{
	"OrganizationName": "Test Org",
	"Employee": [
		{
			"SkillAssignment": [
				{
					"Proficiency": 1,
					"Skill": "Skil1",
					"Priority": 1
				},
				{
					"Proficiency": 1,
					"Skill": "Skill2",
					"Priority": 2
				}
			]
		},
		{
			"SkillAssignment": {
				"Proficiency": 1,
				"Skill": "Skill1",
				"Priority": 1
			}
		}
	]
}

```

---

<div class="post-metadata">

**Author:** ![mohsin.mansur](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mohsin.mansur](https://community.dremio.com/u/mohsin.mansur)\
**Post date:** [January 13, 2023, 12:03pm UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/2 "2023-01-13T12:03:30Z")

</div>

Is there a way to resolve this issue?

@balaji.ramaswamy you seems to be replying most of the posts. So can you shed some light on this issue please?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [January 14, 2023, 8:48pm UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/3 "2023-01-14T20:48:23Z")

</div>

@mohsin.mansur This error means that Dremio is unable to coerce struct and list. Is it possible to make both lists or both as structs?

---

<div class="post-metadata">

**Author:** ![mohsin.mansur](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mohsin.mansur](https://community.dremio.com/u/mohsin.mansur)\
**Post date:** [January 16, 2023, 8:14am UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/4 "2023-01-16T08:14:13Z")

</div>

Thanks for reply @balaji.ramaswamy

We are getting this JSON from external system. The size of JSON files are big, so if we re-process (to change you per your suggestion) at our end it then it will be more processing and time consuming.

As this is valid file, it is unreasonable to ask external system to change it.

Do you not think that dremio should be able to handle this, as this is valid JSON file?

---

<div class="post-metadata">

**Author:** ![adamr](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@adamr](https://community.dremio.com/u/adamr)\
**Post date:** [January 16, 2023, 5:27pm UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/5 "2023-01-16T17:27:50Z")

</div>

@balaji.ramaswamy, is there any method to programmatically give dremio instructions for the coercion we desire on specific fields?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [January 20, 2023, 3:50pm UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/6 "2023-01-20T15:50:18Z")

</div>

@adamr

Currently this coercion is not supported, there is an internal schema feature for only certain sources where you can define the incoming schema using alter table

What is the right data type that should be defined? List (Array) or Struct?

---

<div class="post-metadata">

**Author:** ![adamr](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@adamr](https://community.dremio.com/u/adamr)\
**Post date:** [January 20, 2023, 6:02pm UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/7 "2023-01-20T18:02:34Z")

</div>

@balaji.ramaswamy

In this case it would be List (Array)

What sources is the internal schema feature available for?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [January 22, 2023, 4:52pm UTC](https://community.dremio.com/t/unable-to-upload-valid-json/10173/8 "2023-01-22T16:52:52Z")

</div>

@adamr JSON should be supported, can you try changing the data type to LIST? If the incoming file after that has STRUCT, you may run into the same issue, please check and let us know
