zhaoyongjie commented on code in PR #20683:
URL: https://github.com/apache/superset/pull/20683#discussion_r924548571


##########
superset/datasets/commands/samples.py:
##########
@@ -78,3 +116,24 @@ def validate(self) -> None:
             security_manager.raise_for_ownership(self._model)
         except SupersetSecurityException as ex:
             raise DatasetForbiddenError() from ex
+
+    @staticmethod
+    def get_limit_clause(
+        page: Optional[int], per_page: Optional[int]
+    ) -> Dict[str, int]:
+        samples_row_limit = app.config.get("SAMPLES_ROW_LIMIT", 1000)

Review Comment:
   That's what this setting does. for example, the SAMPLES_ROW_LIMIT = 10, but 
the source of the table has 100 rows, the samples will return 10 records, but 
the query of count(*)  will return a total count is 100, so the total_count is 
full count for this dataset(or query), and size of result always following the 
`SAMPLES_ROW_LIMIT` setting.
   
   
![image](https://user-images.githubusercontent.com/2016594/179769804-4f3a2f3d-a9f4-4828-b6f8-24be1c5c76e7.png)
   



-- 
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]

Reply via email to