Skip to content

03-Selection

Fun: bottom()
1. Sim case
2. Query on all data types
3. Input parameter with different values
4. Query on stable/normal table
5. Query on null data
6. Query on where clause
7. Query with filter
8. Error check

Fun: cols()
1. Basic query for input different params
2. Query on super/child/normal/empty table
3. Support types
4. Error cases
5. Query with filter conditions
6. Query with group/partition by/having/order by
7. Query with tags
8. Query with join/union/nest/interval/window
9. Check null value
10. Check single/multi output

Fun: first()
1. Sim case
2. Query on all data types
3. Input parameter with different values
4. Query on stable/normal table
5. Query on null data
6. Query on where clause
7. Query with filter
8. Error check

First Last with All Windows
1. select list only contains first, last and
_select_value functions with **INTERVAL** window
2. select list only contains first, last and
_select_value functions with **STATE** window
3. select list only contains first, last and
_select_value functions with **SESSION** window
4. select list only contains first, last and
_select_value functions with **EVENT** window
5. select list only contains first, last and
_select_value functions with **COUNT** window

Fun: lag()/lead()
1. Validate lag/lead can be parsed and executed in selection queries.
2. Validate optional default-parameter form is accepted.
3. Validate partition by tbname path can execute and return expected row count.
4. Validate multiple lag/lead combinations (same column and different columns) return correct results.
5. Validate lag/lead correctness on large result sets spanning multiple data blocks.
6. Validate lag/lead behavior with subqueries and window-query constraints.
7. Validate lag/lead behavior with partition by non-tbname on multi-subtable timelines.
8. Validate stream-query usage of lag/lead keeps current behavior unchanged.
9. Validate lag/lead with null inputs, descending timelines, empty results, and large offsets on small inputs.
10. Validate lag/lead support GEOMETRY input type.
11. Validate non-NULL default values for GEOMETRY and DECIMAL input types.

Fun: last()
1. Perform Last queries on child tables and supertables.
2. Test time windows, filtering on ordinary data columns, filtering on tag columns, GROUP BY, and PARTITION BY.
3. Test Last LRU (insufficient memory, multiple VGroups, complex queries).
4. Test scenarios where LAST() return multiple rows of data.
5. Test last_row, last function support 520 parameters.

Fun: last_row()
1. Including time windows, filtering on ordinary data columns, filtering on tag columns, GROUP BY, and PARTITION BY.
2. Set cacheModel = both and retest.
3. Query on super/child/normal table
4. Support types
5. Error cases
6. Query with filter conditions
7. Query with group by
8. Query with empty table
9. Query with subquery
10. Query with 512 parameters
11. Check boundary values

Fun: max()
1. Sim case including time windows, filtering on ordinary data columns, filtering on tag columns, GROUP BY, and PARTITION BY.
2. Query on super/child/normal table
3. Support types
4. Error cases
5. Query with filter conditions
6. Query with group by
7. Query with distribute aggregate
8. Check function status

Fun: min()
1. Sim case including time windows, filtering on ordinary data columns, filtering on tag columns, GROUP BY, and PARTITION BY.
2. Query on super/child/normal table
3. Support types
4. Error cases
5. Query with filter conditions
6. Query with group by
7. Query with distribute aggregate
8. Check function status

Fun: mode()
1. Query with basic params
2. Query on super/child/normal table
3. Support types
4. Check null value

Fun: tail()
1. Basic query for input different params
2. Query on super/child/normal/empty table
3. Support types
4. Error cases
5. Query with filter conditions
6. Query with group/partition by
7. Query with tags
8. Query with join/union/nest
9. Boundary values

Fun: top()
1. Sim case
2. Query on all data types
3. Input parameter with different values
4. Query on stable/normal table
5. Query on null data
6. Query on where clause
7. Query with filter
8. Error check

Fun: unique()
1. Basic query for input different params
2. Query on super/child/normal table
3. Support types
4. Error cases
5. Query with filter conditions
6. Query with group/partition/order by
7. Query with tags
8. Query with join/union/nest/interval/window
9. Check null value
10. Check boundary values

Select: all
test select function max, min

Select function bugs
1. Verify bug TD-19201 (max function obtain float max value error)
2. Verify bug TS-3581 (first function return 0 randomly)

Select: keepColumnName
Test that 'last(col) - first(col)' is not equal to zero when keepColumnName is 1.
Steps:
1. Create a database and a stable table.
2. Create sub-tables and insert data where the first and last values are different.
3. Set 'alter local 'keepColumnName' '1''.
4. Execute 'select last(tbcol) - first(tbcol) from stable_table group by tgcol'.
5. Verify that the result is the difference between the last and first value, which is not zero.

Select: keepColumnName first/last
Steps:
1. Create a database and a stable table.
2. Create sub-tables and insert data where the first and last timestamps are different.
3. Set 'alter local 'keepColumnName' '1''.
4. Execute 'select timediff(last(ts), first(ts)) from stable_table group by tgcol'.
5. Verify that the result is the difference between the last and first timestamp, which is not zero.

Last row interval
1. Query last row on super/normal table
2. Query last row with interval and sliding
3. Query last row with where condition
4. Query last row with time range condition
5. Query last row with mixed conditions
6. Query last row on multiple tables
7. Verify the results

cache read plan check
1. Create databases with different cache models and create tables
2. Check the explain plan with different cache models. Pay attention to
the column width of the scan columns.

Last blob data from cache
1. Query last/last row with blob data from cache and verify the results

Last Row/Last model
1. Check none model
2. Check last Value model
3. Check Last Row model
4. Check Both model
5. Check explain plan
6. Check last/last row model on nested

Select min/max/last interval
1. Insert 1500 rows random data
2. Get min/max/last value for expect
3. Query min/max/last with interval(1d)
4. Compare query result with expect

Select: with 520 columns
test last_row, first, last function support 520 parameters

Select: with json params
test select function with json params