Skip to content

06-ResultSaved

Result saved: comprehensive
1. Test [INTO [db_name.]table_name]
1.1 Test whether this option exists
1.1.1 Only notify without calculation and only notify without saving output can omit this option
1.1.2 Other scenarios must have this option
1.2 Test whether db_name is specified
1.3 Test output table types under different trigger conditions
1.3.1 With trigger grouping: output table is a super table
1.3.2 Without trigger grouping: output table is a normal table
1.4 Test scenarios where output table already exists
1.4.1 Existing table type matches output table type
1.4.2 Existing table type does not match output table type
2. Test [OUTPUT_SUBTABLE(tbname_expr)]
2.1 Test whether this option exists
2.1.1 With trigger grouping and exists (legal)
2.1.2 With trigger grouping and not exists (legal)
2.1.3 Without trigger grouping and exists (illegal)
2.1.4 Without trigger grouping and not exists (legal)
2.2 Test whether columns come from trigger table grouping columns
2.3 Test whether tbname_expr is an expression that outputs strings
2.4 Test scenarios where output length exceeds table maximum length (truncation)
3. Test [(column_name1, column_name2 [PRIMARY KEY][, ...])]
3.1 Test whether this option exists
3.1.1 Option exists
3.1.1.1 Test whether output table already exists
3.1.1.1.1 Output table exists and column names match existing table (legal)
3.1.1.1.2 Output table exists and column names don't match existing table (illegal)
3.1.1.1.3 Output table doesn't exist (legal)
3.1.1.2 Test whether [PRIMARY KEY] is specified
3.1.1.2.1 [PRIMARY KEY] specified
3.1.1.2.1.1 Second column is integer or string type (legal)
3.1.1.2.1.2 Second column is other type (illegal)
3.1.1.2.2 Not specified
3.1.2 Option doesn't exist
3.1.2.1 Test whether default output table column names match calculation result column names
4. Test [TAGS (tag_definition [, ...])]
4.1 Test whether this option exists
4.1.1 Option exists
4.1.1.1 Test whether output table already exists
4.1.1.1.1 Output table exists and tag types/names match existing table (legal)
4.1.1.1.2 Output table exists and tag types/names don't match existing table (illegal)
4.1.1.1.3 Output table doesn't exist (legal)
4.1.2 Option doesn't exist
4.1.2.1 Test whether default tag column definitions and values correspond to trigger grouping columns
4.1.2.2 Test whether tag column name is tag_tbname when grouping by table
4.2 Test whether grouping columns are specified
4.2.1 Grouping columns specified (legal)
4.2.2 Grouping columns not specified (illegal)
4.3 Test whether tag specified expr comes from trigger grouping columns
4.4 Test whether [COMMENT 'string_value'] is specified
4.5 Test correctness of generated column names in specified/unspecified scenarios
5. Test Target Table Management
5.1 Test deletion of target table after stream creation
5.1.1 Verify target table creation by stream
5.1.2 Test table deletion behavior
5.1.3 Test stream robustness after target table deletion
5.1.4 Verify error handling for missing target table

Result saved: summary
1. Test [INTO [db_name.]table_name]
1.1 Test whether this option exists
1.1.1 Only notify without calculation and only notify without saving output can omit this option
1.1.2 Other scenarios must have this option
1.2 Test whether db_name is specified
1.3 Test output table types under different trigger conditions
1.3.1 With trigger grouping: output table is a super table
1.3.2 Without trigger grouping: output table is a normal table
1.4 Test scenarios where output table already exists
1.4.1 Existing table type matches output table type
1.4.2 Existing table type does not match output table type
2. Test [OUTPUT_SUBTABLE(tbname_expr)]
2.1 Test whether this option exists
2.1.1 With trigger grouping and exists (legal)
2.1.2 With trigger grouping and not exists (legal)
2.1.3 Without trigger grouping and exists (illegal)
2.1.4 Without trigger grouping and not exists (legal)
2.2 Test whether columns come from trigger table grouping columns
2.3 Test whether tbname_expr is an expression that outputs strings
2.4 Test scenarios where output length exceeds table maximum length (truncation)
3. Test [(column_name1, column_name2 [PRIMARY KEY][, ...])]
3.1 Test whether this option exists
3.1.1 Option exists
3.1.1.1 Test whether output table already exists
3.1.1.1.1 Output table exists and column names match existing table (legal)
3.1.1.1.2 Output table exists and column names don't match existing table (illegal)
3.1.1.1.3 Output table doesn't exist (legal)
3.1.1.2 Test whether [PRIMARY KEY] is specified
3.1.1.2.1 [PRIMARY KEY] specified
3.1.1.2.1.1 Second column is integer or string type (legal)
3.1.1.2.1.2 Second column is other type (illegal)
3.1.1.2.2 Not specified
3.1.2 Option doesn't exist
3.1.2.1 Test whether default output table column names match calculation result column names
4. Test [TAGS (tag_definition [, ...])]
4.1 Test whether this option exists
4.1.1 Option exists
4.1.1.1 Test whether output table already exists
4.1.1.1.1 Output table exists and tag types/names match existing table (legal)
4.1.1.1.2 Output table exists and tag types/names don't match existing table (illegal)
4.1.1.1.3 Output table doesn't exist (legal)
4.1.2 Option doesn't exist
4.1.2.1 Test whether default tag column definitions and values correspond to trigger grouping columns
4.1.2.2 Test whether tag column name is tag_tbname when grouping by table
4.2 Test whether grouping columns are specified
4.2.1 Grouping columns specified (legal)
4.2.2 Grouping columns not specified (illegal)
4.3 Test whether tag specified expr comes from trigger grouping columns
4.4 Test whether [COMMENT 'string_value'] is specified
4.5 Test correctness of generated column names in specified/unspecified scenarios
5. Test Target Table Management
5.1 Test deletion of target table after stream creation
5.1.1 Verify target table creation by stream
5.1.2 Test table deletion behavior
5.1.3 Test stream robustness after target table deletion
5.1.4 Verify error handling for missing target table

Result saved: datatype precision
This test focuses on precise datatype validation and edge cases:
1. Test precise column length calculations
1.1 VARCHAR length from string functions (CONCAT, SUBSTR, LPAD, RPAD)
1.2 NCHAR vs VARCHAR type differences
1.3 Binary data type handling
1.4 Maximum and minimum length constraints
2. Test numeric type precision and boundaries
2.1 Integer overflow and underflow scenarios
2.2 Float and double precision preservation
2.3 Numeric type casting edge cases
2.4 Aggregation result type precision
3. Test tag type precision validation
3.1 Tag length calculation from expressions
3.2 Tag type inheritance from source columns
3.3 Computed tag type determination
3.4 Tag name length limits and truncation
4. Test special data type scenarios
4.1 JSON data type handling (if supported)
4.2 Timestamp precision levels
4.3 NULL value handling in different types
4.4 Unicode and multi-byte character handling

Result saved: error cases
This test covers error scenarios and boundary conditions for stream result saving:
1. Test error scenarios for [INTO [db_name.]table_name]
1.1 Missing INTO when required
1.2 Existing table with mismatched type
2. Test error scenarios for [OUTPUT_SUBTABLE(tbname_expr)]
2.1 OUTPUT_SUBTABLE without trigger grouping (illegal)
2.2 Invalid expressions in tbname_expr
3. Test error scenarios for [(column_name1, column_name2 [PRIMARY KEY][, ...])]
3.1 Column name mismatch with existing table
3.2 Invalid PRIMARY KEY column types
4. Test error scenarios for [TAGS (tag_definition [, ...])]
4.1 Tag mismatch with existing table
4.2 Missing grouping columns when tags specified
4.3 Invalid tag expressions

Result saved: primary key tests
This test focuses specifically on PRIMARY KEY functionality in stream result saving:
1. Test valid PRIMARY KEY scenarios
1.1 Second column is integer type with PRIMARY KEY
1.2 Second column is string type with PRIMARY KEY
1.3 Multiple columns with PRIMARY KEY
2. Test invalid PRIMARY KEY scenarios
2.1 Second column is float type with PRIMARY KEY (should fail)
2.2 Second column is timestamp type with PRIMARY KEY (should fail)
2.3 PRIMARY KEY on first column (timestamp) - should fail or be ignored
2.4 PRIMARY KEY on non-existent column
3. Test PRIMARY KEY with existing tables
3.1 Existing table already has PRIMARY KEY
3.2 Existing table without PRIMARY KEY
4. Test PRIMARY KEY with different table types
4.1 PRIMARY KEY with normal tables
4.2 PRIMARY KEY with super tables (should be ignored or fail)

Result saved: schema validation
This test focuses on precise validation of result table schemas:
1. Test column data types and lengths
1.1 Aggregation function result types (COUNT, SUM, AVG, MAX, MIN)
1.2 String function result types and lengths (CONCAT, SUBSTR, CAST)
1.3 Numeric type conversions and precision
1.4 Timestamp and datetime types
1.5 Boolean and binary types
2. Test tag data types and lengths
2.1 Tag types from trigger table columns
2.2 Computed tag expressions and their result types
2.3 Default tag lengths and custom tag lengths
2.4 Tag name length limits
3. Test column length calculations
3.1 VARCHAR length based on expressions
3.2 Fixed-length types (INT, BIGINT, DOUBLE, etc.)
3.3 Variable-length types (VARCHAR, NCHAR)
3.4 Maximum length constraints
4. Test PRIMARY KEY type validation
4.1 Valid PRIMARY KEY types and their specifications
4.2 Length constraints for PRIMARY KEY columns