Skip to content

Commit

Permalink
feat: add create alter table expr translator (GreptimeTeam#3203)
Browse files Browse the repository at this point in the history
* feat: add create table expr translator

* feat: add alter table expr translator

* refactor: expose mod

* refactor: expr generator

* chore: ignore typos check for lorem_words

* feat: add string map helper functions

* chore: remove unit tests
  • Loading branch information
WenyXu authored Jan 23, 2024
1 parent 31787f4 commit 364754a
Show file tree
Hide file tree
Showing 17 changed files with 1,234 additions and 265 deletions.
25 changes: 7 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion tests-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@ async-trait = { workspace = true }
common-error = { workspace = true }
common-macro = { workspace = true }
common-query = { workspace = true }
common-telemetry = { workspace = true }
datatypes = { workspace = true }
derive_builder = { workspace = true }
faker_rand = "0.1"
lazy_static = { workspace = true }
partition = { workspace = true }
rand = { workspace = true }
rand_chacha = "0.3.1"
serde = { workspace = true }
serde_json = { workspace = true }
snafu = { workspace = true }
sql = { workspace = true }
sqlparser.workspace = true

[dev-dependencies]
dotenv = "0.15"
sqlx = { version = "0.6", features = [
"runtime-tokio-rustls",
"mysql",
"postgres",
"chrono",
] }
tokio = { workspace = true }
6 changes: 3 additions & 3 deletions tests-fuzz/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct TableContext {
pub columns: Vec<Column>,

// GreptimeDB specific options
pub partitions: Vec<PartitionDef>,
pub partition: Option<PartitionDef>,
pub primary_keys: Vec<usize>,
}

Expand All @@ -35,15 +35,15 @@ impl From<&CreateTableExpr> for TableContext {
CreateTableExpr {
name,
columns,
partitions,
partition,
primary_keys,
..
}: &CreateTableExpr,
) -> Self {
Self {
name: name.to_string(),
columns: columns.clone(),
partitions: partitions.clone(),
partition: partition.clone(),
primary_keys: primary_keys.clone(),
}
}
Expand Down
249 changes: 249 additions & 0 deletions tests-fuzz/src/data/lorem_words
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
alias
consequatur
aut
perferendis
sit
voluptatem
accusantium
doloremque
aperiam
eaque
ipsa
quae
ab
illo
inventore
veritatis
et
quasi
architecto
beatae
vitae
dicta
sunt
explicabo
aspernatur
aut
odit
aut
fugit
sed
quia
consequuntur
magni
dolores
eos
qui
ratione
voluptatem
sequi
nesciunt
neque
dolorem
ipsum
quia
dolor
sit
amet
consectetur
adipisci
velit
sed
quia
non
numquam
eius
modi
tempora
incidunt
ut
labore
et
dolore
magnam
aliquam
quaerat
voluptatem
ut
enim
ad
minima
veniam
quis
nostrum
exercitationem
ullam
corporis
nemo
enim
ipsam
voluptatem
quia
voluptas
sit
suscipit
laboriosam
nisi
ut
aliquid
ex
ea
commodi
consequatur
quis
autem
vel
eum
iure
reprehenderit
qui
in
ea
voluptate
velit
esse
quam
nihil
molestiae
et
iusto
odio
dignissimos
ducimus
qui
blanditiis
praesentium
laudantium
totam
rem
voluptatum
deleniti
atque
corrupti
quos
dolores
et
quas
molestias
excepturi
sint
occaecati
cupiditate
non
provident
sed
ut
perspiciatis
unde
omnis
iste
natus
error
similique
sunt
in
culpa
qui
officia
deserunt
mollitia
animi
id
est
laborum
et
dolorum
fuga
et
harum
quidem
rerum
facilis
est
et
expedita
distinctio
nam
libero
tempore
cum
soluta
nobis
est
eligendi
optio
cumque
nihil
impedit
quo
porro
quisquam
est
qui
minus
id
quod
maxime
placeat
facere
possimus
omnis
voluptas
assumenda
est
omnis
dolor
repellendus
temporibus
autem
quibusdam
et
aut
consequatur
vel
illum
qui
dolorem
eum
fugiat
quo
voluptas
nulla
pariatur
at
vero
eos
et
accusamus
officiis
debitis
aut
rerum
necessitatibus
saepe
eveniet
ut
et
voluptates
repudiandae
sint
et
molestiae
non
recusandae
itaque
earum
rerum
hic
tenetur
a
sapiente
delectus
ut
aut
reiciendis
voluptatibus
maiores
doloribus
asperiores
repellat
Loading

0 comments on commit 364754a

Please sign in to comment.