You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run a materialize command and getting this error: wrong number of fields: got 9 fields for 12 bind locations. I’m selecting 9 unique fields from the source table. 1 of those is referenced 2 times and another 3 times, for 12 total references, which appears to be the error. The raw query runs just fine against vtgate, but fails when executed from Materialize. I'm sure it's much easier to reproduce than I have here, this is just the exact setup where it failed.
returnvterrors.Errorf(vtrpcpb.Code_INTERNAL, "wrong number of fields: got %d fields for %d bind locations ",
len(fields), len(pq.bindLocations))
}
Raw query
select
event_id as id,
user_id as keyspace_id,
unix_timestamp(created_at)*1e9 as time_next,
unix_timestamp(created_at)*1e9 as time_scheduled,
unix_timestamp(created_at)*1e9 as time_created,
if(workspace_id=0,null,workspace_id) as workspace_id,
team_id,
kind,
kind_id,
kind_version_id,
type
from iam_events
Materialize command
vtctlclient -server localhost:15999 Materialize '{ "workflow": "iam__invite_email__msgs_test", "source_keyspace": "iam", "target_keyspace": "iam", "table_settings": [ { "target_table": "iam__invite_email__msgs_test", "source_expression": "select event_id as id, user_id as keyspace_id, unix_timestamp(created_at)*1e9 as time_next, unix_timestamp(created_at)*1e9 as time_scheduled, unix_timestamp(created_at)*1e9 as time_created, if(workspace_id=0,null,workspace_id) as workspace_id, team_id, kind, kind_id, kind_version_id, type from iam_events" } ], "tablet_types": "PRIMARY"}'
Source table
CREATETABLE `iam_events` (
`event_id`bigintNOT NULL,
`workspace_id`bigintNOT NULL,
`team_id`bigint DEFAULT NULL,
`kind` varbinary(15) NOT NULL COMMENT 'string representation of a crud object name: workspace, team, etc.',
`kind_id`bigintNOT NULL COMMENT 'the id for the kind - used for joins back to the original object',
`kind_version_id`bigintNOT NULL COMMENT 'the version id for the kind - used for joins back to the original object',
`type` varbinary(15) NOT NULL COMMENT 'what type of operation occurred: create, update, delete, etc.',
`user_id`bigintNOT NULL COMMENT 'the user who performed the operation',
`idempotency_key` varbinary(15) DEFAULT NULL COMMENT 'optionally provided by client to prevent duplicate operations',
`message` varbinary(100) DEFAULT NULL COMMENT 'optional user facing message to describe the event',
`created_at`timestampNOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`event_id`),
KEY `iam_events__user_id` (`user_id`),
CONSTRAINT`iam_events__user_id`FOREIGN KEY (`user_id`) REFERENCES`users` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED;
I'm trying to run a materialize command and getting this error:
wrong number of fields: got 9 fields for 12 bind locations
. I’m selecting 9 unique fields from the source table. 1 of those is referenced 2 times and another 3 times, for 12 total references, which appears to be the error. The raw query runs just fine against vtgate, but fails when executed fromMaterialize
. I'm sure it's much easier to reproduce than I have here, this is just the exact setup where it failed.vitess/go/vt/sqlparser/parsed_query.go
Lines 88 to 98 in ccdb446
Raw query
Materialize command
Source table
Target table
Using v12 of all Vitess components
The text was updated successfully, but these errors were encountered: