This is an automated email from the ASF dual-hosted git repository.
csun5285 pushed a commit to branch auto-pick-70162-branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/auto-pick-70162-branch-4.2 by
this push:
new b4d1f7fe14f [fix](test) Adapt hidden column short-circuit tests to
branch-4.2
b4d1f7fe14f is described below
commit b4d1f7fe14f992eb72748359d2f365847c1586d2
Author: csun5285 <[email protected]>
AuthorDate: Wed Nov 4 10:26:40 2026 +0000
[fix](test) Adapt hidden column short-circuit tests to branch-4.2
branch-4.2 has no changelog feature: Config.enable_feature_changelog, the
"changelog.enable" table property and __DORIS_COMMIT_TSO_COL__ do not exist,
so the cherry-picked FE UT failed to compile. Merge-on-write unique tables
already carry __DORIS_VERSION_COL__ by default here, so keep the coverage on
__DORIS_VERSION_COL__ and __DORIS_DELETE_SIGN__ and drop the commit TSO
cases.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
.../rules/rewrite/ShortCircuitPointQueryTest.java | 27 ++++++++--------------
.../test_short_circuit_rowset_hidden_columns.out | 3 ---
...test_short_circuit_rowset_hidden_columns.groovy | 11 ++-------
3 files changed, 12 insertions(+), 29 deletions(-)
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ShortCircuitPointQueryTest.java
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ShortCircuitPointQueryTest.java
index 8d7450212c9..1bddd27fadf 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ShortCircuitPointQueryTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/ShortCircuitPointQueryTest.java
@@ -21,7 +21,6 @@ import org.apache.doris.catalog.Database;
import org.apache.doris.catalog.Env;
import org.apache.doris.catalog.OlapTable;
import org.apache.doris.catalog.Tablet;
-import org.apache.doris.common.Config;
import org.apache.doris.common.FeConstants;
import org.apache.doris.datasource.doris.RemoteOlapTable;
import org.apache.doris.nereids.trees.expressions.StatementScopeIdGenerator;
@@ -51,7 +50,6 @@ class ShortCircuitPointQueryTest extends TestWithFeService
@Override
protected void runBeforeAll() throws Exception {
- Config.enable_feature_changelog = true;
createDatabase("test");
useDatabase("test");
createTable("CREATE TABLE `tbl_point_query` (\n"
@@ -82,8 +80,8 @@ class ShortCircuitPointQueryTest extends TestWithFeService
+ " \"light_schema_change\" = \"true\",\n"
+ " \"store_row_column\" = \"true\"\n"
+ ");");
- // Carries both __DORIS_VERSION_COL__ and __DORIS_COMMIT_TSO_COL__.
- createTable("CREATE TABLE `tbl_changelog_point_query` (\n"
+ // Merge-on-write unique tables carry __DORIS_VERSION_COL__ by default.
+ createTable("CREATE TABLE `tbl_hidden_col_point_query` (\n"
+ " `key` int(11) NULL,\n"
+ " `v1` varchar(30) NULL\n"
+ ") ENGINE=OLAP\n"
@@ -93,32 +91,27 @@ class ShortCircuitPointQueryTest extends TestWithFeService
+ " \"replication_num\" = \"1\",\n"
+ " \"enable_unique_key_merge_on_write\" = \"true\",\n"
+ " \"light_schema_change\" = \"true\",\n"
- + " \"store_row_column\" = \"true\",\n"
- + " \"changelog.enable\" = \"true\"\n"
+ + " \"store_row_column\" = \"true\"\n"
+ ");");
}
@Test
void testHiddenColumnsDoNotUseShortCircuit() {
- // The row store returned 0 for __DORIS_VERSION_COL__ and
__DORIS_COMMIT_TSO_COL__ instead
- // of the rowset version and commit TSO.
- rewrite("select __DORIS_VERSION_COL__ from tbl_changelog_point_query
where `key` = 1");
-
Assertions.assertFalse(connectContext.getStatementContext().isShortCircuitQuery());
-
- rewrite("select __DORIS_COMMIT_TSO_COL__, v1 from
tbl_changelog_point_query where `key` = 1");
+ // The row store returned 0 for __DORIS_VERSION_COL__ instead of the
rowset version.
+ rewrite("select __DORIS_VERSION_COL__ from tbl_hidden_col_point_query
where `key` = 1");
Assertions.assertFalse(connectContext.getStatementContext().isShortCircuitQuery());
- rewrite("select __DORIS_COMMIT_TSO_COL__ + 1 from
tbl_changelog_point_query where `key` = 1");
+ rewrite("select __DORIS_VERSION_COL__ + 1 from
tbl_hidden_col_point_query where `key` = 1");
Assertions.assertFalse(connectContext.getStatementContext().isShortCircuitQuery());
- rewrite("select __DORIS_DELETE_SIGN__, v1 from
tbl_changelog_point_query where `key` = 1");
+ rewrite("select __DORIS_DELETE_SIGN__, v1 from
tbl_hidden_col_point_query where `key` = 1");
Assertions.assertFalse(connectContext.getStatementContext().isShortCircuitQuery());
// show_hidden_columns makes `select *` return hidden columns as well.
boolean originalShowHidden =
connectContext.getSessionVariable().showHiddenColumns();
try {
connectContext.getSessionVariable().setShowHiddenColumns(true);
- rewrite("select * from tbl_changelog_point_query where `key` = 1");
+ rewrite("select * from tbl_hidden_col_point_query where `key` =
1");
Assertions.assertFalse(connectContext.getStatementContext().isShortCircuitQuery());
} finally {
connectContext.getSessionVariable().setShowHiddenColumns(originalShowHidden);
@@ -128,10 +121,10 @@ class ShortCircuitPointQueryTest extends TestWithFeService
@Test
void testQueryWithoutHiddenColumnsUsesShortCircuit() {
// `select *` skips hidden columns by default.
- rewrite("select * from tbl_changelog_point_query where `key` = 1");
+ rewrite("select * from tbl_hidden_col_point_query where `key` = 1");
Assertions.assertTrue(connectContext.getStatementContext().isShortCircuitQuery());
- rewrite("select v1 from tbl_changelog_point_query where `key` = 1");
+ rewrite("select v1 from tbl_hidden_col_point_query where `key` = 1");
Assertions.assertTrue(connectContext.getStatementContext().isShortCircuitQuery());
}
diff --git
a/regression-test/data/point_query_p0/test_short_circuit_rowset_hidden_columns.out
b/regression-test/data/point_query_p0/test_short_circuit_rowset_hidden_columns.out
index d7cbd41dd1b..c7548602f44 100644
---
a/regression-test/data/point_query_p0/test_short_circuit_rowset_hidden_columns.out
+++
b/regression-test/data/point_query_p0/test_short_circuit_rowset_hidden_columns.out
@@ -2,9 +2,6 @@
-- !version --
2 7
--- !commit_tso --
-true 7
-
-- !select_star --
1 7
diff --git
a/regression-test/suites/point_query_p0/test_short_circuit_rowset_hidden_columns.groovy
b/regression-test/suites/point_query_p0/test_short_circuit_rowset_hidden_columns.groovy
index e9755540b03..a39c739a0b1 100644
---
a/regression-test/suites/point_query_p0/test_short_circuit_rowset_hidden_columns.groovy
+++
b/regression-test/suites/point_query_p0/test_short_circuit_rowset_hidden_columns.groovy
@@ -17,7 +17,7 @@
suite("test_short_circuit_rowset_hidden_columns", "p0") {
// Queries reading hidden columns do not use the short circuit: it used to
return 0 for
- // __DORIS_VERSION_COL__ and __DORIS_COMMIT_TSO_COL__ instead of version 2
and the commit TSO.
+ // __DORIS_VERSION_COL__ instead of version 2.
sql "DROP TABLE IF EXISTS short_circuit_rowset_hidden_columns"
sql """
CREATE TABLE short_circuit_rowset_hidden_columns (
@@ -30,8 +30,7 @@ suite("test_short_circuit_rowset_hidden_columns", "p0") {
"replication_num" = "1",
"enable_unique_key_merge_on_write" = "true",
"light_schema_change" = "true",
- "store_row_column" = "true",
- "changelog.enable" = "true"
+ "store_row_column" = "true"
)
"""
sql "INSERT INTO short_circuit_rowset_hidden_columns VALUES (1, 7), (2, 8)"
@@ -42,12 +41,6 @@ suite("test_short_circuit_rowset_hidden_columns", "p0") {
}
qt_version "SELECT __DORIS_VERSION_COL__, v FROM
short_circuit_rowset_hidden_columns WHERE id = 1"
- explain {
- sql "SELECT __DORIS_COMMIT_TSO_COL__ > 0, v FROM
short_circuit_rowset_hidden_columns WHERE id = 1"
- notContains "SHORT-CIRCUIT"
- }
- qt_commit_tso "SELECT __DORIS_COMMIT_TSO_COL__ > 0, v FROM
short_circuit_rowset_hidden_columns WHERE id = 1"
-
// show_hidden_columns makes `select *` return hidden columns as well.
sql "SET show_hidden_columns = true"
explain {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]