Join Panic error
When joining tables join.full returns internal error: panic: arrow/array: index out of range.
join.full(
left: base,
right: z_info,
on: (l, r) => l.product == r.product,
as: (l, r) => ({l with zscore: ((float(v: l._value) - r.mean) / r.dev) } ),
)
Note changing
as:...toas: (l, r) => ({l with mean: r.mean, dev: r.dev})also produced this error
This has only been seen with a subset of data and our current work around is to use the "Deprecated" join() function
Have same error reliably when attempting to calculate CPU utilization using metrics reported by the inputs.kubernetes and inputs.kube_inventory Telegraf plugins:
import "join"
container = from(bucket: "hc-prod")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "kubernetes_pod_container")
|> keep(columns: ["_time", "_field", "_value", "mc_zone", "namespace", "pod_name", "container_name"])
|> group(columns: ["mc_zone", "namespace", "pod_name", "container_name"])
cpu_usage = container
|> filter(fn: (r) => r._field == "cpu_usage_nanocores")
cpu_limit = container
|> filter(fn: (r) => r._field == "resource_limits_millicpu_units")
join.inner(
left: cpu_usage,
right: cpu_limit,
on: (l, r) => l.mc_zone == r.mc_zone and l.namespace == r.namespace and l.pod_name == r.pod_name and l.container_name == r.container_name,
as: (l, r) => ({l with cpu_limit: r._value})
OK, it seems that join panics when there are more than 1 row on the right to match. Either of these chagres stops it from crashing:
- Leave just one row on the right:
cpu_limit = container
|> filter(fn: (r) => r._field == "resource_limits_millicpu_units")
|> last()
- or add
l._time == r._timeas join condition
This issue has had no recent activity and will be closed soon.