@@ -348,7 +348,7 @@ public String getDataStore(String label, String parameters, Map<String, Object>
348348 }
349349
350350 public String getDataStoreAI (String label , String parameters , Map <String , Object > drivers , String selections ,
351- String likeSelections , int maxRowCount , String aggregations , String summaryRow , int offset , int fetchSize ,
351+ String likeSelections , Integer maxRowCount , String aggregations , String summaryRow , int offset , int fetchSize ,
352352 Boolean isNearRealtime , String options , Set <String > indexes , String widgetName ) {
353353 LOGGER .debug ("IN" );
354354 DatasetManagementAPI datasetManagementAPI = getDatasetManagementAPI ();
@@ -358,8 +358,14 @@ public String getDataStoreAI(String label, String parameters, Map<String, Object
358358
359359 int maxResults = Integer
360360 .parseInt (SingletonConfig .getInstance ().getConfigValue ("SPAGOBI.API.DATASET.MAX_ROWS_NUMBER" ));
361+
361362 LOGGER .debug ("Offset {}, fetch size {}, max results {}" , offset , fetchSize , maxResults );
362363
364+
365+ if (maxRowCount == null ) {
366+ maxRowCount = maxResults ;
367+ }
368+
363369 if (maxResults <= 0 ) {
364370 throw new SpagoBIRuntimeException (
365371 "SPAGOBI.API.DATASET.MAX_ROWS_NUMBER value cannot be a non-positive integer" );
@@ -371,7 +377,7 @@ public String getDataStoreAI(String label, String parameters, Map<String, Object
371377 }
372378 if (maxRowCount > maxResults ) {
373379 throw new IllegalArgumentException (
374- "The dataset requested is too big. Max row count is equals to [ " + maxResults + "]" );
380+ "The requested number of rows is too big [ " + maxRowCount + " ]. The limit is [ " + maxResults + " ]" );
375381 }
376382
377383 IDataSetDAO dataSetDao = DAOFactory .getDataSetDAO ();
@@ -491,6 +497,8 @@ public String getDataStoreAI(String label, String parameters, Map<String, Object
491497 return gridDataFeed .toString ();
492498 } catch (ValidationException v ) {
493499 throw v ;
500+ } catch (IllegalArgumentException i ) {
501+ throw i ;
494502 } catch (ParametersNotValorizedException p ) {
495503 throw p ;
496504 } catch (CatalogFunctionException c ) {
0 commit comments