# Partitioning by field name in s3 connector (access on field name in multiple record avro schema)

**URL:** <https://forum.confluent.io/t/partitioning-by-field-name-in-s3-connector-access-on-field-name-in-multiple-record-avro-schema/7652>\
**Category:** Kafka Connect\
**Created:** [19 April 2023 14:56 UTC](https://forum.confluent.io/t/partitioning-by-field-name-in-s3-connector-access-on-field-name-in-multiple-record-avro-schema/7652 "2023-04-19T14:56:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![schmeinky](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@schmeinky](https://forum.confluent.io/u/schmeinky)\
**Post date:** [19 April 2023 14:56 UTC](https://forum.confluent.io/t/partitioning-by-field-name-in-s3-connector-access-on-field-name-in-multiple-record-avro-schema/7652/1 "2023-04-19T14:56:34Z")

</div>

Hi there,

I’m using the Kafka-Connector to send data to s3.  
The Kafka topic is using an Avro schema. In that schema, there are multiple records. So I need to access a field name on a record inside the record. So my scheme is looking like that:

```auto
{
	"type": "record",
	"name": "userdata",
	"namespace": "myNamespace",
	"fields": [
		{
			"name": "userinfo",
			"type": {
				"type": "record",
				"name": "record1",
				"fields": [
					{
						"name": "eventtime",
						"type": "long",
					},
				]
			}
		},
		{
			"name": "clientinfo",
			"type": {
				"type": "record",
				"name": "record2",
				"fields": [
					{
						"name": "username",
						"type": {
							"type": "string",
							"avro.java.string": "String"
						},
					}
				]
			}
		}
}

```

In my Kafka connector, I’m using this:

```auto
        partitioner.class: io.confluent.connect.storage.partitioner.FieldPartitioner
        partition.field.name: clientinfo.record2.username

```

But it’s not working. How do I access to a field name from a record inside a record? I tried different types of writing, but without success.

This is my error:

```auto
Caused by: org.apache.kafka.connect.errors.DataException: clientinfo.record2.username is not a valid field name

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [19 May 2023 14:56 UTC](https://forum.confluent.io/t/partitioning-by-field-name-in-s3-connector-access-on-field-name-in-multiple-record-avro-schema/7652/2 "2023-05-19T14:56:44Z")

</div>

Closed on 19 May 2023 14:56 UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
