Skip to content

bug: QueryFailed: [1104]index out of bounds: the len is 16 but the index is 16 [v0.33.7] #19787

@rad-pat

Description

@rad-pat

Search before asking

  • I had searched in the issues and found no similar issues.

Version

1.2.891

What's Wrong?

INSERT statement fails with QueryFailed: [1104]index out of bounds: the len is 16 but the index is 16 [v0.33.7]

How to Reproduce?

SQL is as below. We had recently upgraded from 1.2.790 to 1.2.891 and this error started appearing

INSERT INTO "s1"."target" (
	"RespCenterName"
	,"LineItemActivityName"
	,"ACC&SC Combo"
	,"ActivityDriver1Name"
	,"CostObject1Name"
	,"CostObject2Name"
	,"Include"
	,"PriorMonth"
	)
SELECT result."RespCenterName"
	,result."LineItemActivityName"
	,result."ACC&SC Combo"
	,result."ActivityDriver1Name"
	,result."CostObject1Name"
	,result."CostObject2Name"
	,result."Include"
	,result."PriorMonth"
FROM (
	SELECT CAST("PriorMonth_Combine"."RespCenterName" AS VARCHAR) AS "RespCenterName"
		,CAST("PriorMonth_Combine"."LineItemActivityName" AS VARCHAR) AS "LineItemActivityName"
		,CAST("PriorMonth_Combine"."ACC&SC Combo" AS VARCHAR) AS "ACC&SC Combo"
		,CAST(coalesce(anon_1."ActivityDriverName", "PriorMonth_Combine"."ActivityDriver1Name") AS VARCHAR) AS "ActivityDriver1Name"
		,CAST(coalesce(anon_1."CostObject1", "PriorMonth_Combine"."CostObject1Name") AS VARCHAR) AS "CostObject1Name"
		,CAST(coalesce(anon_1."CostObject2", "PriorMonth_Combine"."CostObject2Name") AS VARCHAR) AS "CostObject2Name"
		,CAST(coalesce(anon_1."Include", '1') AS VARCHAR) AS "Include"
		,CAST(coalesce(anon_1."PriorMonth", "PriorMonth_Combine"."PriorMonth") AS VARCHAR) AS "PriorMonth"
	FROM "s1"."source" AS "PriorMonth_Combine"
	LEFT OUTER JOIN (
		SELECT CAST("Weight"."RespCenterName" AS VARCHAR) AS "RespCenterName"
			,CAST("Weight"."ActivityName" AS VARCHAR) AS "ActivityName"
			,CAST(min("Weight"."ActivityDriverName") AS VARCHAR) AS "ActivityDriverName"
			,CAST(min("Weight"."CostObject1") AS VARCHAR) AS "CostObject1"
			,CAST(min("Weight"."CostObject2") AS VARCHAR) AS "CostObject2"
			,CAST(min("Weight"."Include") AS VARCHAR) AS "Include"
			,CAST(min("Weight"."FileName") AS VARCHAR) AS "FileName"
			,CAST(min("Weight"."PriorMonth") AS VARCHAR) AS "PriorMonth"
		FROM "s1"."source2" AS "Weight"
		WHERE EXISTS (
				SELECT *
				FROM "s1"."source" AS a_exists
				WHERE "Weight"."RespCenterName" = a_exists."RespCenterName"
					AND "Weight"."ActivityName" = a_exists."LineItemActivityName"
				)
		GROUP BY "Weight"."RespCenterName"
			,"Weight"."ActivityName"
		) AS anon_1 ON "PriorMonth_Combine"."RespCenterName" = anon_1."RespCenterName"
		AND "PriorMonth_Combine"."LineItemActivityName" = anon_1."ActivityName"
	GROUP BY "PriorMonth_Combine"."RespCenterName"
		,"PriorMonth_Combine"."LineItemActivityName"
		,"PriorMonth_Combine"."ACC&SC Combo"
		,CAST(coalesce(anon_1."ActivityDriverName", "PriorMonth_Combine"."ActivityDriver1Name") AS VARCHAR)
		,CAST(coalesce(anon_1."CostObject1", "PriorMonth_Combine"."CostObject1Name") AS VARCHAR)
		,CAST(coalesce(anon_1."CostObject2", "PriorMonth_Combine"."CostObject2Name") AS VARCHAR)
		,CAST(coalesce(anon_1."Include", '1') AS VARCHAR)
		,CAST(coalesce(anon_1."PriorMonth", "PriorMonth_Combine"."PriorMonth") AS VARCHAR)
	) AS result
WHERE result."PriorMonth" = 'Yes'

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Labels

C-bugCategory: something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions