Skip to content

Commit

Permalink
Merge branch 'release-1.8' into auto-release-1.8-9d74e10916714dfc0975…
Browse files Browse the repository at this point in the history
…843843d172da84472944
  • Loading branch information
huangjw806 authored Apr 2, 2024
2 parents 4027fef + 7c9cd47 commit 9ab55fe
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 6 deletions.
228 changes: 228 additions & 0 deletions docker/docker-compose-with-sqlite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
---
version: "3"
x-image: &image
image: ${RW_IMAGE:-risingwavelabs/risingwave:nightly-20240328}
services:
risingwave-standalone:
<<: *image
command: "standalone --meta-opts=\" \
--listen-addr 0.0.0.0:5690 \
--advertise-addr 0.0.0.0:5690 \
--dashboard-host 0.0.0.0:5691 \
--prometheus-host 0.0.0.0:1250 \
--prometheus-endpoint http://prometheus-0:9500 \
--backend sql \
--sql-endpoint sqlite:///meta-data/metadata.db?mode=rwc \
--state-store hummock+minio://hummockadmin:hummockadmin@minio-0:9301/hummock001 \
--data-directory hummock_001 \
--config-path /risingwave.toml\" \
--compute-opts=\" \
--config-path /risingwave.toml \
--listen-addr 0.0.0.0:5688 \
--prometheus-listener-addr 0.0.0.0:1250 \
--advertise-addr 0.0.0.0:5688 \
--async-stack-trace verbose \
#--parallelism 4 \
#--total-memory-bytes 8589934592 \
--role both \
--meta-address http://0.0.0.0:5690\" \
--frontend-opts=\" \
--config-path /risingwave.toml \
--listen-addr 0.0.0.0:4566 \
--advertise-addr 0.0.0.0:4566 \
--prometheus-listener-addr 0.0.0.0:1250 \
--health-check-listener-addr 0.0.0.0:6786 \
--meta-addr http://0.0.0.0:5690\" \
--compactor-opts=\" \
--listen-addr 0.0.0.0:6660 \
--prometheus-listener-addr 0.0.0.0:1250 \
--advertise-addr 0.0.0.0:6660 \
--meta-address http://0.0.0.0:5690\""
expose:
- "6660"
- "4566"
- "5688"
- "5690"
- "1250"
- "5691"
ports:
- "4566:4566"
- "5690:5690"
- "5691:5691"
- "1250:1250"
depends_on:
- minio-0
volumes:
- "./risingwave.toml:/risingwave.toml"
- "meta-0:/meta-data"
environment:
RUST_BACKTRACE: "1"
# If ENABLE_TELEMETRY is not set, telemetry will start by default
ENABLE_TELEMETRY: ${ENABLE_TELEMETRY:-true}
container_name: risingwave-standalone
healthcheck:
test:
- CMD-SHELL
- bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/6660; exit $$?;'
- bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/5688; exit $$?;'
- bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/4566; exit $$?;'
- bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/5690; exit $$?;'
interval: 1s
timeout: 5s
restart: always
deploy:
resources:
limits:
memory: 28G
reservations:
memory: 28G

grafana-0:
image: "grafana/grafana-oss:latest"
command: []
expose:
- "3001"
ports:
- "3001:3001"
depends_on: []
volumes:
- "grafana-0:/var/lib/grafana"
- "./grafana.ini:/etc/grafana/grafana.ini"
- "./grafana-risedev-datasource.yml:/etc/grafana/provisioning/datasources/grafana-risedev-datasource.yml"
- "./grafana-risedev-dashboard.yml:/etc/grafana/provisioning/dashboards/grafana-risedev-dashboard.yml"
- "./dashboards:/dashboards"
environment: {}
container_name: grafana-0
healthcheck:
test:
- CMD-SHELL
- bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/3001; exit $$?;'
interval: 1s
timeout: 5s
retries: 5
restart: always

minio-0:
image: "quay.io/minio/minio:latest"
command:
- server
- "--address"
- "0.0.0.0:9301"
- "--console-address"
- "0.0.0.0:9400"
- /data
expose:
- "9301"
- "9400"
ports:
- "9301:9301"
- "9400:9400"
depends_on: []
volumes:
- "minio-0:/data"
entrypoint: "
/bin/sh -c '
set -e
mkdir -p \"/data/hummock001\"
/usr/bin/docker-entrypoint.sh \"$$0\" \"$$@\"
'"
environment:
MINIO_CI_CD: "1"
MINIO_PROMETHEUS_AUTH_TYPE: public
MINIO_PROMETHEUS_URL: "http://prometheus-0:9500"
MINIO_ROOT_PASSWORD: hummockadmin
MINIO_ROOT_USER: hummockadmin
MINIO_DOMAIN: "minio-0"
container_name: minio-0
healthcheck:
test:
- CMD-SHELL
- bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/9301; exit $$?;'
interval: 1s
timeout: 5s
retries: 5
restart: always

prometheus-0:
image: "prom/prometheus:latest"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--web.listen-address=0.0.0.0:9500"
- "--storage.tsdb.retention.time=30d"
expose:
- "9500"
ports:
- "9500:9500"
depends_on: []
volumes:
- "prometheus-0:/prometheus"
- "./prometheus.yaml:/etc/prometheus/prometheus.yml"
environment: {}
container_name: prometheus-0
healthcheck:
test:
- CMD-SHELL
- sh -c 'printf "GET /-/healthy HTTP/1.0\n\n" | nc localhost 9500; exit $$?;'
interval: 1s
timeout: 5s
retries: 5
restart: always

message_queue:
image: "docker.vectorized.io/vectorized/redpanda:latest"
command:
- redpanda
- start
- "--smp"
- "1"
- "--reserve-memory"
- 0M
- "--memory"
- 4G
- "--overprovisioned"
- "--node-id"
- "0"
- "--check=false"
- "--kafka-addr"
- "PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092"
- "--advertise-kafka-addr"
- "PLAINTEXT://message_queue:29092,OUTSIDE://localhost:9092"
expose:
- "29092"
- "9092"
- "9644"
ports:
- "29092:29092"
- "9092:9092"
- "9644:9644"
- "8081:8081"
depends_on: []
volumes:
- "message_queue:/var/lib/redpanda/data"
environment: {}
container_name: message_queue
healthcheck:
test: curl -f localhost:9644/v1/status/ready
interval: 1s
timeout: 5s
retries: 5
restart: always
volumes:
meta-0:
external: false
grafana-0:
external: false
minio-0:
external: false
prometheus-0:
external: false
message_queue:
external: false
5 changes: 1 addition & 4 deletions e2e_test/batch/catalog/rw_depend.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ statement ok
drop sink sink1;

statement ok
drop sink sink2;

statement ok
drop table t2;
drop table t2 cascade;

statement ok
drop materialized view mv2;
Expand Down
10 changes: 10 additions & 0 deletions e2e_test/batch/order/test_limit.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ SELECT a FROM test order by 1 LIMIT 1;
----
11

query I
SELECT a FROM test order by 1 LIMIT 1::bigint;
----
11

query I
SELECT a FROM test order by 1 LIMIT 1::bigint OFFSET 1::bigint;
----
12

# decimal limit
# query I
# SELECT a FROM test order by 1 LIMIT 1.25;
Expand Down
1 change: 1 addition & 0 deletions src/cmd_all/src/single_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ pub fn map_single_node_opts_to_standalone_opts(opts: SingleNodeOpts) -> ParsedSt
// Set listen addresses (force to override)
meta_opts.listen_addr = "0.0.0.0:5690".to_string();
meta_opts.advertise_addr = "127.0.0.1:5690".to_string();
meta_opts.dashboard_host = Some("0.0.0.0:5691".to_string());
compute_opts.listen_addr = "0.0.0.0:5688".to_string();
compactor_opts.listen_addr = "0.0.0.0:6660".to_string();
if let Some(frontend_addr) = &opts.node_opts.listen_addr {
Expand Down
11 changes: 10 additions & 1 deletion src/sqlparser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5007,13 +5007,22 @@ impl Parser {
if self.parse_keyword(Keyword::ALL) {
Ok(None)
} else {
Ok(Some(self.parse_number_value()?))
let number = self.parse_number_value()?;
// TODO(Kexiang): support LIMIT expr
if self.consume_token(&Token::DoubleColon) {
self.expect_keyword(Keyword::BIGINT)?
}
Ok(Some(number))
}
}

/// Parse an OFFSET clause
pub fn parse_offset(&mut self) -> Result<String, ParserError> {
let value = self.parse_number_value()?;
// TODO(Kexiang): support LIMIT expr
if self.consume_token(&Token::DoubleColon) {
self.expect_keyword(Keyword::BIGINT)?;
}
_ = self.parse_one_of_keywords(&[Keyword::ROW, Keyword::ROWS]);
Ok(value)
}
Expand Down
22 changes: 21 additions & 1 deletion src/tests/simulation/src/slt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ fn is_create_table_as(sql: &str) -> bool {
parts.len() >= 4 && parts[0] == "create" && parts[1] == "table" && parts[3] == "as"
}

fn is_sink_into_table(sql: &str) -> bool {
let parts: Vec<String> = sql.split_whitespace().map(|s| s.to_lowercase()).collect();

parts.len() >= 4 && parts[0] == "create" && parts[1] == "sink" && parts[3] == "into"
}

#[derive(Debug, PartialEq, Eq)]
enum SqlCmd {
/// Other create statements.
Create {
is_create_table_as: bool,
},
/// Create sink.
CreateSink {
is_sink_into_table: bool,
},
/// Create Materialized views
CreateMaterializedView {
name: String,
Expand Down Expand Up @@ -69,7 +79,11 @@ impl SqlCmd {
| SqlCmd::Flush
| SqlCmd::Alter
| SqlCmd::Create {
is_create_table_as: true
is_create_table_as: true,
..
}
| SqlCmd::CreateSink {
is_sink_into_table: true,
}
)
}
Expand Down Expand Up @@ -110,6 +124,9 @@ fn extract_sql_command(sql: &str) -> SqlCmd {
SqlCmd::CreateMaterializedView { name }
}
}
"sink" => SqlCmd::CreateSink {
is_sink_into_table: is_sink_into_table(&sql),
},
_ => SqlCmd::Create {
is_create_table_as: is_create_table_as(&sql),
},
Expand Down Expand Up @@ -367,6 +384,9 @@ pub async fn run_slt_task(
SqlCmd::Create {
is_create_table_as: false,
}
| SqlCmd::CreateSink {
is_sink_into_table: false,
}
| SqlCmd::CreateMaterializedView { .. }
if i != 0
&& e.to_string().contains("exists")
Expand Down

0 comments on commit 9ab55fe

Please sign in to comment.