# Question about dh6: Fetch with no topics

**URL:** <https://forum.codecrafters.io/t/question-about-dh6-fetch-with-no-topics/4676>\
**Category:** Challenges\
**Tags:** challenge:kafka\
**Created:** [February 5, 2025, 9:47pm UTC](https://forum.codecrafters.io/t/question-about-dh6-fetch-with-no-topics/4676 "2025-02-05T21:47:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gad](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/gad/32/4211_2.png) [@Gad](https://forum.codecrafters.io/u/Gad)\
**Post date:** [February 5, 2025, 9:47pm UTC](https://forum.codecrafters.io/t/question-about-dh6-fetch-with-no-topics/4676/1 "2025-02-05T21:47:10Z")

</div>

Hi,  
I understand that we don’t have to parse the Fetch request body but I was wondering how it can work with several partitions per topic as I don’t see a Partition Array length in the request definition:  
" topics =\> topic\_id [partitions] TAG\_BUFFER  
topic\_id =\> UUID  
partitions =\> partition current\_leader\_epoch fetch\_offset last\_fetched\_epoch log\_start\_offset partition\_max\_bytes TAG\_BUFFER  
partition =\> INT32  
current\_leader\_epoch =\> INT32  
fetch\_offset =\> INT64  
last\_fetched\_epoch =\> INT32  
log\_start\_offset =\> INT64  
partition\_max\_bytes =\> INT32  
forgotten\_topics\_data =\> topic\_id [partitions] TAG\_BUFFER "

How can one know that after partition\_max\_bytes, there is a topic\_id referring to forgotten\_topics\_data or another partition index ?  
Thanks

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [February 7, 2025, 3:18pm UTC](https://forum.codecrafters.io/t/question-about-dh6-fetch-with-no-topics/4676/3 "2025-02-07T15:18:36Z")

</div>

Hi @Gad, thanks for your question! The Kafka docs can be unclear and confusing.

In this case, `[partitions]` is a **COMPACT\_ARRAY** , meaning a length field will be included in the request—even though the definition doesn’t explicitly state it.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/3/34c1c85dfef78a1cfd68f7e975d4a3f5066ab5f9.png)

Let me know if you’d like further clarification!

---

<div class="post-metadata">

**Author:** ![Gad](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/gad/32/4211_2.png) [@Gad](https://forum.codecrafters.io/u/Gad)\
**Post date:** [February 7, 2025, 3:50pm UTC](https://forum.codecrafters.io/t/question-about-dh6-fetch-with-no-topics/4676/4 "2025-02-07T15:50:56Z")

</div>

Thank you Andy, makes sense !  
Is it the square brackets around _partitions_ that indicate the COMPACT\_ARRAY ?

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [February 7, 2025, 3:55pm UTC](https://forum.codecrafters.io/t/question-about-dh6-fetch-with-no-topics/4676/5 "2025-02-07T15:55:08Z")

</div>

Yep, [partitions] indicates an array, and in newer versions of Kafka APIs, you can assume it’s a **COMPACT\_ARRAY** rather than a standard **ARRAY**.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [February 12, 2025, 3:55pm UTC](https://forum.codecrafters.io/t/question-about-dh6-fetch-with-no-topics/4676/7 "2025-02-12T15:55:32Z")

</div>

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