Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types map and array and JSON path are not support in DDL schema #81

Open
ligurio opened this issue Sep 29, 2021 · 0 comments
Open

Types map and array and JSON path are not support in DDL schema #81

ligurio opened this issue Sep 29, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ligurio
Copy link
Member

ligurio commented Sep 29, 2021

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

    -- 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
@ligurio ligurio added the documentation Improvements or additions to documentation label Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants