Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
fce28f44
Commit
fce28f44
authored
1 year ago
by
Arseniy Volynets
Committed by
Denis Smirnov
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: allow create global table through sql
parent
36602d9a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!668
feat: allow create global table through sql
Pipeline
#25150
passed
1 year ago
Stage: test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
src/sql.rs
+6
-1
6 additions, 1 deletion
src/sql.rs
test/int/test_sql.py
+23
-0
23 additions, 0 deletions
test/int/test_sql.py
with
31 additions
and
1 deletion
CHANGELOG.md
+
2
−
0
View file @
fce28f44
...
...
@@ -57,6 +57,8 @@ with the `YY.0M.MICRO` scheme.
- _Clusterwide SQL_ introduces the capability to drop picodata users.
- _Clusterwide SQL_ introduces the capability to create roles.
- _Clusterwide SQL_ now allows creation of a global table through
`
create table
`.
### Lua API:
...
...
This diff is collapsed.
Click to expand it.
src/sql.rs
+
6
−
1
View file @
fce28f44
...
...
@@ -257,12 +257,17 @@ fn reenterable_ddl_request(
is_nullable
:
f
.is_nullable
,
})
.collect
();
let
distribution
=
if
sharding_key
.is_some
()
{
DistributionParam
::
Sharded
}
else
{
DistributionParam
::
Global
};
let
params
=
CreateSpaceParams
{
id
:
None
,
name
,
format
,
primary_key
,
distribution
:
DistributionParam
::
Sharded
,
distribution
,
by_field
:
None
,
sharding_key
,
sharding_fn
:
Some
(
ShardingFn
::
Murmur3
),
...
...
This diff is collapsed.
Click to expand it.
test/int/test_sql.py
+
23
−
0
View file @
fce28f44
...
...
@@ -238,6 +238,29 @@ def test_create_drop_table(cluster: Cluster):
)
assert
ddl
[
"
row_count
"
]
==
1
# Check global space
ddl
=
i1
.
sql
(
"""
create table
"
global_t
"
(
"
key
"
string not null,
"
value
"
string not null,
primary key (
"
key
"
))
using memtx
distributed globally
option (timeout = 3)
"""
)
assert
ddl
[
"
row_count
"
]
==
1
with
pytest
.
raises
(
ReturnError
,
match
=
"
global spaces can use only memtx engine
"
):
i1
.
sql
(
"""
create table
"
t
"
(
"
key
"
string not null,
"
value
"
string not null,
primary key (
"
key
"
))
using vinyl
distributed globally
option (timeout = 3)
"""
)
def
test_insert_on_conflict
(
cluster
:
Cluster
):
cluster
.
deploy
(
instance_count
=
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment