Skip to content

Commit

Permalink
fix update rows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikyou1997 committed Nov 22, 2023
1 parent 64dadb9 commit 175c50e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void update(AnalysisInfo analyzedJob, TableIf tableIf) {
}
jobType = analyzedJob.jobType;
if (tableIf != null && analyzedJob.colToPartitions.keySet()
.containsAll(tableIf.getColumns().stream().map(Column::getName).collect(
.containsAll(tableIf.getBaseSchema().stream().map(Column::getName).collect(
Collectors.toSet()))) {
updatedRows.set(0);
}
Expand Down
26 changes: 26 additions & 0 deletions regression-test/suites/statistics/analyze_stats.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1249,4 +1249,30 @@ PARTITION `p599` VALUES IN (599)
assert all_finished(show_result)


// unique table update rows
sql """
CREATE TABLE unique_tbl_update_rows_test (col1 varchar(11451) not null,
col2 int not null, col3 int not null, col4 int not null)
DUPLICATE KEY(`col1`)
DISTRIBUTED BY HASH(col1)
BUCKETS 3
PROPERTIES(
"replication_num"="1"
);
"""

sql """insert into unique_tbl_update_rows_test values('21',5,1,7); """
sql """ANALYZE TABLE unique_tbl_update_rows_test WITH SYNC"""
sql """insert into unique_tbl_update_rows_test values('21',5,1,7); """
sql """ANALYZE TABLE unique_tbl_update_rows_test WITH SYNC"""
def unique_table_update_rows_result = sql """SHOW TABLE STATS unique_tbl_update_rows_test"""
def check_update_rows = { r ->
for (int i = 0; i < r.size; i++) {
if (r[i][0] == "0") {
return true
}
}
return false
}
check_update_rows(unique_table_update_rows_result)
}

0 comments on commit 175c50e

Please sign in to comment.