Repository: risingwavelabs/risingwave (language: python)

Issue:
Sqlsmith: Sql feature generation
As we add more features, these should be tested via sqlsmith as well.

SQL Features:
- [ ] Generate other table functions: `generate_series`, `unnest`. See: https://github.com/singularity-data/risingwave/issues/4540
- [ ] Generate array_agg, jsonb_agg, jsonb_object_agg
- [ ] Generate select from System Tables
- [ ] Generate `NATURAL JOIN`
- [ ] Generate `JOIN` with `USING`
- [ ] Generate query w/o `GROUP BY`
- [ ] Randomly toggle session variables
- [ ] Generate `pow`/`exp`.
- [ ] Generate TopN by group: https://www.risingwave.dev/docs/current/sql-pattern-topn/
- [ ] Generate jsonb exprs, see: https://github.com/risingwavelabs/risingwave/issues/7714
- [ ] #7132
- [x] Generate order-by-clauses with `NULLS { FIRST | LAST }` (will be done in https://github.com/risingwavelabs/risingwave/pull/10864/commits/000cbc11cbc04f20abfd127b1bf4b3fd24e75c44)
- [ ] Generate `max`,`min`,`count` for `timestamptz`
- [ ] Generate `bit_and`, `bit_or` and `big_xor` in batch queries, and `bit_xor` in streaming queries.
- [ ] Generate array range access.
- [ ] https://github.com/risingwavelabs/risingwave/issues/10241
- [ ] Generate window functions other than `row_number`, `rank`.
- [ ] Generate `ALTER` DDL statements.\
- [ ] https://github.com/risingwavelabs/risingwave/issues/10516
- [ ] Generate temporal filter in sqlsmith


Discussion / hints:

Fix patch:
diff --git a/src/meta/src/controller/streaming_job.rs b/src/meta/src/controller/streaming_job.rs
index 2da096268cff6..d3e170aff75ae 100644
--- a/src/meta/src/controller/streaming_job.rs
+++ b/src/meta/src/controller/streaming_job.rs
@@ -1332,9 +1332,8 @@ impl CatalogController {
                     }
                 });
             }
-            if is_fs_source && *fragment_type_mask == PbFragmentTypeFlag::FragmentUnspecified as i32
-            {
-                // when create table with fs connector, the fragment type is unspecified
+            if is_fs_source {
+                // scan all fragments for StreamFsFetch node if using fs connector
                 visit_stream_node(stream_node, |node| {
                     if let PbNodeBody::StreamFsFetch(node) = node {
                         if let Some(node_inner) = &mut node.node_inner


Test patch:
diff --git a/e2e_test/source_inline/fs/posix_fs.slt b/e2e_test/source_inline/fs/posix_fs.slt
index 96fb18e97e666..da56502e417e8 100644
--- a/e2e_test/source_inline/fs/posix_fs.slt
+++ b/e2e_test/source_inline/fs/posix_fs.slt
@@ -14,6 +14,22 @@ CREATE TABLE diamonds (
     source_rate_limit = 0
 ) FORMAT PLAIN ENCODE CSV ( without_header = 'false', delimiter = ',');
 
+statement ok
+CREATE SOURCE diamonds_source (
+    carat FLOAT,
+    cut TEXT,
+    color TEXT,
+    depth FLOAT,
+) WITH (
+    connector = 'posix_fs',
+    match_pattern = 'data*.csv',
+    posix_fs.root = 'e2e_test/source_inline/fs/data',
+    source_rate_limit = 0
+) FORMAT PLAIN ENCODE CSV ( without_header = 'false', delimiter = ',');
+
+statement ok
+create materialized view diamonds_mv as select * from diamonds_source;
+
 sleep 1s
 
 # no output due to rate limit
@@ -21,9 +37,16 @@ query TTTT rowsort
 select * from diamonds;
 ----
 
+query TTTT rowsort
+select * from diamonds_mv;
+----
+
 statement ok
 ALTER TABLE diamonds SET source_rate_limit TO DEFAULT;
 
+statement ok
+ALTER source diamonds_source SET source_rate_limit TO DEFAULT;
+
 sleep 10s
 
 query TTTT rowsort
@@ -40,5 +63,25 @@ select * from diamonds;
 1.28 Good J 63.1
 1.3 Fair E 64.7
 
+query TTTT rowsort
+select * from diamonds_mv;
+----
+0.22 Premium I 62
+0.23 Very Good H 57.5
+0.25 Ideal E 61.4
+0.28 Good J 63.1
+0.3 Fair E 64.7
+1.22 Premium I 62
+1.23 Very Good H 57.5
+1.25 Ideal E 61.4
+1.28 Good J 63.1
+1.3 Fair E 64.7
+
 statement ok
 DROP TABLE diamonds;
+
+statement ok
+drop materialized view diamonds_mv;
+
+statement ok
+drop source diamonds_source;