-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(sql): extend create table statement syntax to support "IN VOLUME volume-alias" #2931
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…I to see what happens
…ze as a masked size, with 62nd bit -> partition read-only
… the package can have access to the maps
…airo when you haven't got access to the volume
…l tests to SqlCompilerTest
ideoma
reviewed
Feb 2, 2023
core/src/main/java/io/questdb/cairo/AbstractTableNameRegistry.java
Outdated
Show resolved
Hide resolved
ideoma
reviewed
Feb 8, 2023
…it needs to be added at runtime with docker run --ulimit. See https://docs.docker.com/engine/reference/commandline/run/#ulimit
ideoma
approved these changes
Feb 15, 2023
[PR Coverage check]😍 pass : 320 / 343 (93.29%) file detail
|
puzpuzpuz
approved these changes
Feb 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR proposes a syntax extension for the create table statement.
It addresses the issue #2884 and is complementary to PR #2710 .
Documented https://github.com/questdb/questdb.io/pull/1341
Create table syntax
All these are valid statements (also with WAL, and IF NOT EXISTS):
The with part of the statement can happen independently of the partition by statement, where before it could not. If
in volume
is present along with with, a ',' is required (as if it were part of the with clause). If with is not present, thenin volume
must not have the ',' before it.in volume
is always the last part of the create table statement, it is optional.Because the volume path can be quoted, any name is valid for the alias, including names that contain white space.
Behavior
The table will be created in the target volume, and a symbolik link will be created in the table's standard root folder to point to it. From this point forward the table behaves the same way as if it had been created in the main (default) volume, with one exception,
drop table
will unlink the table, but the data will remain intact in its volume. This will be a problem if you need to create the table again with the same name in that volume. This is intentional and requires that you go manually to the volume and either rename the table folder, or delete it.Configuration
new server.conf attribute
cairo.volumes
supports a comma separated list of entries:where the token before the arrow is an alias to the absolute path found after the arrow. Either token can be optionally single quoted.
aliases are case insensitive, you can use the alias typed the way you want, all variations refer to the same alias.
volume paths must be absolute and must exist at bootstap time, as well as at the time of creating the table.
by default
cairo.volumes
is an empty list, which means the feature is disabled.In docker container
Given this Dockerfile:
(you would need to build
questdb-6.7.1-SNAPSHOT-no-jre-bin.tar.gz questdb.tar.gz
from my branch and place it alongside the other ^ ^ Dockerfile)(you would build the image:
docker build -t io.questdb.play:1.0-SNAPSHOT .
)This command will work just fine:
segregating the QuestDB file system at that level of granularity.
Notice the
cairo.volumes=volume0->/opt/volume0, volume1->/opt/volume1"
in server.conf .Then these queries will work from the web console:
each table will be in a different volume.