Help Center/ DataArts Studio/ FAQs/ DataArts Migration (Real-Time Jobs)/ What Should I Do If a Job for Synchronizing Data from Kafka to DLI in Real Time Fails and "Array element access needs an index starting at 1 but was 0" Is Displayed?
Updated on 2025-08-05 GMT+08:00

What Should I Do If a Job for Synchronizing Data from Kafka to DLI in Real Time Fails and "Array element access needs an index starting at 1 but was 0" Is Displayed?

Symptom

A job for synchronizing data from Kafka to DLI in real time fails and "Array element access needs an index starting at 1 but was 0" is displayed.

Figure 1 Error message

Possible Cause

The error message indicates that the array subscript must start from 1, and a[1] indicates the first element in the array.

Check the CDM real-time job. The migration source is Kafka, destination is the mapped DLI field, value source is the source table field, and value is a[0] (the nested JSON array in the Kafka message). When the source table field is used to assign a value to a destination column during field mapping, the array subscript must start from 1 (indicating the first element of the array). If subscript 0 is used by mistake, the job will fail. The error was caused by the incorrect subscript of the assignment array. You need to reset it.

Figure 2 Original parameter settings

Solution

Change the value of the field to a[1], submit the job version, and restart the job.

Figure 3 Setting the value assignment parameters of the destination table