Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
dl239 committed Jun 26, 2023
2 parents 3640df8 + 4b88184 commit e8b3b53
Show file tree
Hide file tree
Showing 47 changed files with 1,644 additions and 613 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,42 @@ jobs:
- name: coverage configure
run: |
make coverage-configure
make coverage-configure COVERAGE_NO_DEPS=ON
- name: start service
run: |
./steps/ut_zookeeper.sh start
# make coverage-cpp will gen 16G build/ (no run), run test will take 2G more, so split make and test
- name: Coverage CPP
run: |
make coverage-cpp
# rm some irrelevant files
rm -rf .deps/build
# only build tests: no build output by ctest, so we use cmake
# ctest --build-and-test . build --build-nocmake --build-generator "Unix Makefiles" -j $NPROC
# split make too, delete irrelavant files in the middle
cmake --build build --target help | grep -Eo "\S+_test$" | awk '{if(NR <80) printf(" %s ",$0)}' | xargs cmake --build build -j $NPROC --target
# rm some in the middle, leave ~7.4G
rm -f build/bin/* # no need anymore
find build -name "*.a" -type f -delete
du -d 1 -h build
df -h
cmake --build build --target help | grep -Eo "\S+_test$" | awk '{if(NR >=80) printf(" %s ",$0)}' | xargs cmake --build build -j $NPROC --target
# ~11G
# rm some irrelevant files, *.dir/Makefile/*.make can't be deleted, test in bin won't test by coverage
rm -f build/bin/*
find build \( -name "*.a" -o -name "*.o" -o -name "*.o.d" -o -name "cmake*.cmake" \) -delete
du -d 1 -h build
df -h
# Makefile target coverage, not the cmake target(won't build tests again), total 119(120-api_server_test)
cd build
SQL_CASE_BASE_DIR=$(pwd)/.. YAML_CASE_BASE_DIR=$(pwd)/.. make coverage
- name: debug
if: always()
run: |
du -d 1 -h build
df -h
- name: Upload Coverage Report
uses: codecov/codecov-action@v3
Expand Down
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ option(SQL_PYSDK_ENABLE "Enable sql pysdk" OFF)
option(SQL_JAVASDK_ENABLE "Enable sql javasdk" OFF)
option(MAC_TABLET_ENABLE "Enable Table on Mac OS" ON)
option(COVERAGE_ENABLE "Enable Coverage" OFF)
option(COVERAGE_NO_DEPS "Coverage without test deps, should ensure test built" OFF)
option(SANITIZER_ENABLE "Enable AddressSanitizer in Debug mode" OFF)
# add_library can reply on this variable
# see https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html#variable:BUILD_SHARED_LIBS
Expand Down Expand Up @@ -173,6 +174,7 @@ if (COVERAGE_ENABLE)
message(FATAL_ERROR "Coverage is only supported on linux")
endif ()
find_program(LCOV_EXE NAMES lcov DOC "coverage requires lcov installed" REQUIRED)
message(STATUS "include CodeCoverage, if file not found, please git submodule update --init to get file")
include(CodeCoverage)
APPEND_COVERAGE_COMPILER_FLAGS()
endif ()
Expand Down Expand Up @@ -285,10 +287,15 @@ link_directories(
add_subdirectory(src)

if (COVERAGE_ENABLE AND CMAKE_COMPILER_IS_GNUCXX)
# FIXME(aceforeverd): api_server_test failed to run on debug mode, skip temporarily
SETUP_TARGET_FOR_COVERAGE_LCOV(NAME coverage
EXECUTABLE ctest --force-new-ctest-process --output-on-failure -E "api_server_test"
DEPENDENCIES ${test_list})
if (COVERAGE_NO_DEPS)
SETUP_TARGET_FOR_COVERAGE_LCOV(NAME coverage
EXECUTABLE ctest --force-new-ctest-process --output-on-failure -E "api_server_test")
else ()
# FIXME(aceforeverd): api_server_test failed to run on debug mode, skip temporarily
SETUP_TARGET_FOR_COVERAGE_LCOV(NAME coverage
EXECUTABLE ctest --force-new-ctest-process --output-on-failure -E "api_server_test"
DEPENDENCIES ${test_list})
endif ()
endif ()


Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ endif
ifdef COVERAGE_ENABLE
OPENMLDB_CMAKE_FLAGS += -DCOVERAGE_ENABLE=$(COVERAGE_ENABLE)
endif
ifdef COVERAGE_NO_DEPS
OPENMLDB_CMAKE_FLAGS += -DCOVERAGE_NO_DEPS=$(COVERAGE_NO_DEPS)
endif
ifdef SANITIZER_ENABLE
OPENMLDB_CMAKE_FLAGS += -DSANITIZER_ENABLE=$(SANITIZER_ENABLE)
endif
Expand Down
39 changes: 39 additions & 0 deletions cases/plan/cmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,45 @@ cases:
+-node[CMD]
+-cmd_type: show jobs
+-args: []
- id: show jobs from taskmanager
sql: SHOW JOBS FROM TASKMANAGER
expect:
node_tree_str: |
+-node[kShowStmt]
+-show type: Jobs
+-target: TASKMANAGER
+-like_str: <nil>
plan_tree_str: |
+-[kPlanTypeShow]
+-show type: Jobs
+-target: TASKMANAGER
+-like_str: <nil>
- id: show jobs from nameserver
sql: SHOW JOBS FROM NAMESERVER
expect:
node_tree_str: |
+-node[kShowStmt]
+-show type: Jobs
+-target: NAMESERVER
+-like_str: <nil>
plan_tree_str: |
+-[kPlanTypeShow]
+-show type: Jobs
+-target: NAMESERVER
+-like_str: <nil>
- id: show jobs from nameserver like
sql: SHOW JOBS FROM NAMESERVER LIKE '1'
expect:
node_tree_str: |
+-node[kShowStmt]
+-show type: Jobs
+-target: NAMESERVER
+-like_str: 1
plan_tree_str: |
+-[kPlanTypeShow]
+-show type: Jobs
+-target: NAMESERVER
+-like_str: 1
- id: show job
sql: SHOW JOB 1
expect:
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/sql/dql/GROUP_BY_CLAUSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For the standalone version, `GROUP BY` is supported in all conditions. For the c

| `SELECT` Statement Elements | Offline Mode | Online Preview Mode | Online Request Mode | Note |
|:-----------------------------------------------------------|--------------|---------------------|---------------------|:------------------------------------------------------------------------------------------------------------------------|
| GROUP BY Clause | **````** | | | The Group By clause is used to group the query results.The grouping conditions only support grouping on simple columns. |
| GROUP BY Clause | **````** | **``✓(since 0.6.4)``** | | The Group By clause is used to group the query results.The grouping conditions only support grouping on simple columns. |

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/sql/dql/HAVING_CLAUSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For the standalone version, `HAVING` is supported in all conditions. For the clu

| `SELECT` Statement Elements | Offline Mode | Online Preview Mode | Online Request Mode | Note |
|:-----------------------------------------------------------|--------------|---------------------|---------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| HAVING Clause | **````** | | | The Having clause is similar to the Where clause. The Having clause filters data after GroupBy, and the Where clause is used to filter records before aggregation. | |
| HAVING Clause | **````** | **``✓(since 0.6.4)``** | | The Having clause is similar to the Where clause. The Having clause filters data after GroupBy, and the Where clause is used to filter records before aggregation. | |

## Example

Expand Down
6 changes: 3 additions & 3 deletions docs/en/reference/sql/dql/SELECT_STATEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ TableAsName
| [`FROM Clause`](#tablerefs) | **````** | **````** | **````** | The FROM clause indicates the data source.<br />The data source can be one table (`select * from t;`) or multiple tables that LAST JOIN together (see [JOIN CLAUSE](../dql/JOIN_CLAUSE.md)) or no table ( `select 1+1;`), see [NO_TABLE SELECT](../dql/NO_TABLE_SELECT_CLAUSE.md) |
| [`JOIN` Clause](../dql/JOIN_CLAUSE.md) | **````** | **``x``** | **````** | The JOIN clause indicates that the data source comes from multiple joined tables. OpenMLDB currently only supports LAST JOIN. For Online Request Mode, please follow [the specification of LAST JOIN under Online Request Mode](../deployment_manage/ONLINE_REQUEST_REQUIREMENTS.md#the-usage-specification-of-last-join-under-online-serving) |
| [`WHERE` Clause](../dql/WHERE_CLAUSE.md) | | **````** | | The WHERE clause is used to set filter conditions, and only the data that meets the conditions will be included in the query result. |
| [`GROUP BY` Clause](../dql/GROUP_BY_CLAUSE.md) | **````** | | | The GROUP BY clause is used to group the query results.The grouping conditions only support simple columns. |
| [`HAVING` Clause](../dql/HAVING_CLAUSE.md) | **````** | | | The HAVING clause is similar to the WHERE clause. The HAVING clause filters data after GROUP BY, and the WHERE clause is used to filter records before aggregation. | |
| [`WINDOW` Clause](../dql/WINDOW_CLAUSE.md) | **````** | | **````** | The WINDOW clause is used to define one or several windows. Windows can be named or anonymous. Users can call aggregate functions on the window to perform analysis (```sql agg_func() over window_name```). For Online Request Mode, please follow the [specification of WINDOW Clause under Online Request Mode](../deployment_manage/ONLINE_REQUEST_REQUIREMENTS.md#window-usage-specification-under-online-serving) |
| [`GROUP BY` Clause](../dql/GROUP_BY_CLAUSE.md) | **````** | **````** | | The GROUP BY clause is used to group the query results.The grouping conditions only support simple columns. |
| [`HAVING` Clause](../dql/HAVING_CLAUSE.md) | **````** | **````** | | The HAVING clause is similar to the WHERE clause. The HAVING clause filters data after GROUP BY, and the WHERE clause is used to filter records before aggregation. | |
| [`WINDOW` Clause](../dql/WINDOW_CLAUSE.md) | **````** | **````** | **````** | The WINDOW clause is used to define one or several windows. Windows can be named or anonymous. Users can call aggregate functions on the window to perform analysis (```sql agg_func() over window_name```). For Online Request Mode, please follow the [specification of WINDOW Clause under Online Request Mode](../deployment_manage/ONLINE_REQUEST_REQUIREMENTS.md#window-usage-specification-under-online-serving) |
| [`LIMIT` Clause](../dql/LIMIT_CLAUSE.md) | **````** | **````** | | The LIMIT clause is used to limit the number of results. OpenMLDB currently only supports one parameter to limit the maximum number of rows of returned data. |
| `ORDER BY` Clause | | | | Standard SQL also supports the ORDER BY keyword, however OpenMLDB does not support this keyword currently. For example, the query `SELECT * from t1 ORDER BY col1;` is not supported in OpenMLDB. |

Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/sql/dql/WINDOW_CLAUSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ SELECT select_expr [,select_expr...], window_function_name(expr) OVER window_nam

| `SELECT` Statement Elements | Offline Mode | Online Preview Mode | Online Request Mode | Note |
|:-------------------------------------------------------|--------------|---------------------|---------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| WINDOW Clause | **````** | | **````** | The window clause is used to define one or several windows. Windows can be named or anonymous. Users can call aggregate functions on the window to perform analysis (```sql agg_func() over window_name```). For Online Request Mode, please follow the [specification of WINDOW Clause under Online Request](../deployment_manage/ONLINE_REQUEST_REQUIREMENTS.md#window-usage-specification-under-online-serving) |
| WINDOW Clause | **````** | **``✓(since 0.6.4)``** | **````** | The window clause is used to define one or several windows. Windows can be named or anonymous. Users can call aggregate functions on the window to perform analysis (```sql agg_func() over window_name```). For Online Request Mode, please follow the [specification of WINDOW Clause under Online Request](../deployment_manage/ONLINE_REQUEST_REQUIREMENTS.md#window-usage-specification-under-online-serving) |

## Basic WINDOW SPEC Syntax Elements

Expand Down
Loading

0 comments on commit e8b3b53

Please sign in to comment.