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

Parse and process MergeTree CREATE TABLE expression #31

Open
Tracked by #28
akvlad opened this issue Aug 13, 2024 · 1 comment
Open
Tracked by #28

Parse and process MergeTree CREATE TABLE expression #31

akvlad opened this issue Aug 13, 2024 · 1 comment

Comments

@akvlad
Copy link
Contributor

akvlad commented Aug 13, 2024

What

Desired functionality:

  1. A user makes a create table request:
POST /qp/query
...
create_table: experiment
fields:
  a: UInt64
  b: String
  c: Float64
engine: Merge
order_by: 
  - a
timestamp:
  field: a
  precision: ms
partition_by:
  - b

Or the json request with the same data.

  1. The processing component should create the following entry int the tables table:
  name: experimental, 
  path /tmp/experimental,
  field_names ['a', 'b', 'c'],
  field_types ['UInt64', 'String', 'Float64'],
  order_by ['a'],
  engine 'Merge',
  timestamp_field: 'a',
  timestamp_precision: 'ns',
  partition_by: ['b'],
  1. The processing component should create the /tmp/experimental/tmp and /tmp/experimental/data folders.

#How

  1. Create an endpoint /qp/query .
  2. Add the following checks to /qp/query endpoint
  • Content-type should be either yaml or json
  • If the decoded structure doesn't have "create_table" attribute, return 400 - Not supported error
  • Check if the decoded structure has all the attributes and the attributes are of the desired type
  • Check if the name of the table and names of the fields are alphanumeric or _ character and don't start with a number.
  • Check if the fields enumerated in order_by, timestamp, partition_by are present in the fields attributes.
  1. If all the checks are passed, the system should create an entry in the tables table and create the folders on the HD.
Copy link

Thanks for opening an Issue! Please star this repository to motivate developers! ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant