-- check sharding_key path is valid
for _, path_to_field in ipairs(space.sharding_key) do
local path = get_path_info(path_to_field)
if path.type ~= 'regular' then
return nil, string.format(
"spaces[%q].sharding_key[%q]: key containing JSONPath isn't supported yet",
space.name, path_to_field
)
end
local field = space.fields[path.field_name]
if not field then
return nil, string.format(
"spaces[%q].sharding_key[%q]: invalid reference to format[%q], no such field",
space.name, path_to_field, path.field_name
)
end
if field.type == 'map' or field.type == 'array' then
return nil, string.format(
"spaces[%q].sharding_key[%q]: key references to field " ..
"with %s type, but it's not supported yet",
space.name, path_to_field, field.type
)
end
end
return true
end
Types
map
,array
and JSON path are not supported in DDL schema. We need to describe it in DDL documentation.https://github.com/tarantool/ddl/blob/master/ddl/check.lua#L720-L746