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

feat: impl create dynamic table sql parser and planner #39

Closed
wants to merge 755 commits into from

Conversation

zhyass
Copy link

@zhyass zhyass commented Apr 17, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR.

Fixes #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

drmingdrmer and others added 30 commits March 7, 2024 22:10
* feat(query): support queries queue

* feat(query): support queries queue

* feat(query): support queries queue

* feat(query): support queries queue
* fix: allow insert in multiline statment

* fix

* fix

* fix
* refactor(ast): migrate to derive-visitor

* add more

* add more

* add more

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
* fix: try to make nvl great again

Signed-off-by: Chojan Shang <psiace@apache.org>

* fix: try to make ifnull great again

Signed-off-by: Chojan Shang <psiace@apache.org>

* fix: make sqllogictest happy

Signed-off-by: Chojan Shang <psiace@apache.org>

* fix: workaround for fewer than expected number of null

Signed-off-by: Chojan Shang <psiace@apache.org>

* fix: make sqllogictest happy

Signed-off-by: Chojan Shang <psiace@apache.org>

* fix: make sqllogictest happy

Signed-off-by: Chojan Shang <psiace@apache.org>

---------

Signed-off-by: Chojan Shang <psiace@apache.org>
* feat(query): create drop inverted index

* fix typos

* fix tests

* fix tests

* rewrite as table index

* index use column ids

* check column id exist
…atabendlabs#14862)

* show grants support mget table/db name by table/db id.

* fix test

* refactor function name: list replace to mget

* fix error

* rename new api

* modify func name && modify err msg

* use slice

* fmt code
…alization (databendlabs#14895)

fix incorrect schema in window expr in subquery with lazy_materialization
* ut case of merget into ... insert *

* fix: displays "*" if necessary for insert clause of merge-into
…atabendlabs#14899)

When writing back upgraded json-to-pb data to meta-service,
it should return `MetaError`, instead of business error such as
`ErrorCode::UnknownRole`.

Add quota limit to `check_and_upgrade_to_pb`: for each API calls, it
upgrades upto 100 records. So that an API call won't be delay a lot.

After upgrading, it should returns the `seq` number after upgrading.
…bytes (databendlabs#14896)

* add a new ratio config for data cache

* Update src/query/config/src/config.rs

Co-authored-by: dantengsky <dantengsky@gmail.com>

* Update src/query/config/src/inner.rs

Co-authored-by: dantengsky <dantengsky@gmail.com>

* add a new ratio config for data cache

---------

Co-authored-by: dantengsky <dantengsky@gmail.com>
* feat(ast): add parser for script

* add resultset

* fix
Openraft 0.9.0 release:
https://github.com/datafuselabs/openraft/releases/tag/v0.9.0

Implement chunk-based snapshot transmission outside openraft core.
This makes it possible to switch to another snapshot transmission
protocol in a compatible manner.
* feat: support cross join spilling

* trigger probe spill

* fix probe input with 0 col but non-zero row
* fix: Display of compact AST

* modify ut
…abendlabs#14915)

* refactor: use kvapi::Key to define meta-service key for QuotaMgr

* chore: fix time tolerance in kv_meta test suites
`PasswordPolicyMgr::new()` does not have to return error because the
input tenant is never empty.

Use `KVPbApi` to access protobuf encoded values in meta-service.
Get rid of manually encoding/decoding.
* chore(query): add allow_streaming_insert_source in ast parser

* chore(query): add allow_streaming_insert_source in ast parser

* chore(query): add allow_streaming_insert_source in ast parser

* chore(query): add allow_streaming_insert_source in ast parser

* chore(query): add allow_streaming_insert_source in ast parser

* update

* update

* update

* update

* add more function alias
* test

* test

* finish singleton spill

* cluster spill

* Update src/query/service/src/pipelines/processors/transforms/aggregator/aggregate_meta.rs

Co-authored-by: Winter Zhang <coswde@gmail.com>

* add Result<> for func return type

* fix bug

* fix decimal bug

* remove output columns(AggregatePartial) to pass ci

* revert set

---------

Co-authored-by: jw <freejw@gmail.com>
Co-authored-by: Winter Zhang <coswde@gmail.com>
fixup: extend time tolerance for meta-service test
* refactor(privilege access): reduce meta call

* modify err msg display
TCeason and others added 26 commits April 9, 2024 22:01
E.g.

```sql
SET GLOBAL data_retention_time_in_days=0; -- Need work
```
…ilege (databendlabs#15188)

* fix(query): show grants panic when role/user has immute db/table

* Unify function parameter styles
* chore: refine explain read size

* chore: handle read size 0

* chore: remove eb test

* chore: update ee test

* chore: update cluster test

* chore: update test

* chore: update test

* chore: update test

* chore: fix broken test

* chore: fix merge into test

* chore: fix test

* chore: fix cluster test

* chore: update cluster test
implement ST_MAKEPOLYGON

Signed-off-by: Fan Yang <yangfanlinux@gmail.com>
…abs#15203)

* refactor: simplify `DatabaseFactory`, just static dispatch

* chore: try reduce usage of Tenant::new_nonempty()

This methods is a transitional method, to build a Tenant from a
NonEmptyString. This method will be removed in future because a Tenant
must contain a in-meta-service per-tenant config to work correctly,
e.g., determine the version of path to store a value: with tenant prefix
or without.
…ed. (databendlabs#15206)

* feat: distinguish early close from kill/cancel with new LogType::Closed.

* extract Executor::get_response_state

* feat: http handler allow redundant final/kill.

* revert databendlabs#15022

databendlabs#15094 (comment)

* fix test.

* ignore flaky test.
)

* refactor(query): move api to servers

* refactor(query): move metrics to servers

* refactor(query): move metrics to servers
* chore: fix decorrelate exists subquery

* chore: fix subquery explain sqllogictest
* refactor: add view system tables

add system tables: system.view and system.view_with_history

The view engine no need to display stat info.

And fuse engine does not have view_query.

* fix test err
…databendlabs#15217)

* fix(query): alter modify col comment need modify when type not modify

* fix err
* feat: add EXECUTE IMMEDIATE statement

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* add test
* refactor: introduce `UninitTenant` and `TIdentRaw`

`Tenant` is a meta-service key component representing a tenant,
with a embedded per-tenant config.

`UninitTenant` is a shadow of `TIdent` but without config thus it can
not be used as a key.
`UninitTenant` can be initialized to build a `Tenant` for use as a
meta-service key.

Correspondingly, this commit introduce `TIdentRaw` as an uninitialized
version of `TIdent`.
`TIdentRaw` does not cantain per-tenant config and is only used inside
meta-service values(not keys), which could be `serde`.

Other changes:

Populate usage of `Tennat` to `Catalog` implementation.

* chore: fix wrong url in share

* chore: fix rebase
)

* chore: vacuum drop table for external location table

* fix test_fuse_do_vacuum_drop_table_external_storage
* use get-connection-ip

* fix get_client_ip

* refactor the code

* fix

* fix test

* middleware.rs: &req -> req

---------

Co-authored-by: Bohu <overred.shuttler@gmail.com>
…5225)

* chore(query): add query queued duration for query log

* chore(query): add query queued duration for query log

* chore(query): add query queued duration for query log

* chore(query): add query queued duration for query log
@zhyass zhyass requested a review from drmingdrmer as a code owner April 17, 2024 04:30
@zhyass zhyass closed this Apr 17, 2024
@zhyass
Copy link
Author

zhyass commented Apr 17, 2024

Sorry, pulling the wrong branch.

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

Successfully merging this pull request may close these issues.