Kikyou1997 commented on code in PR #25079:
URL: https://github.com/apache/doris/pull/25079#discussion_r1349894796
##########
fe/fe-core/src/main/java/org/apache/doris/statistics/BaseAnalysisTask.java:
##########
@@ -222,23 +226,23 @@ protected String getDataSizeFunction(Column column) {
return "COUNT(1) * " + column.getType().getSlotSize();
}
- protected String getSampleExpression() {
+ protected TableSample getTableSample() {
if (info.forceFull) {
- return "";
+ return null;
}
- int sampleRows = info.sampleRows;
+ long sampleRows = info.sampleRows;
if (info.analysisMethod == AnalysisMethod.FULL) {
if (Config.enable_auto_sample
&& tbl.getDataSize(true) >
Config.huge_table_lower_bound_size_in_bytes) {
sampleRows = Config.huge_table_default_sample_rows;
} else {
- return "";
+ return null;
}
}
if (info.samplePercent > 0) {
- return String.format("TABLESAMPLE(%d PERCENT)",
info.samplePercent);
+ return new TableSample(true, (long) info.samplePercent);
Review Comment:
1. Sample percent doesn't have higher priority, we sample by rows by
default, if user set sample by percent explicitly then sample by percent, docs
has already explained this
2. sample rows by default has been fully discussed in the group
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]