[PHP Palo] palo_getdata_export: limit ?

      [PHP Palo] palo_getdata_export: limit ?

      Hello Jedox and the Fellowship,

      I wonder whether there is a limit when using the PHP function palo_getdata_export.

      I use the following code to use this function:

      PHP Source Code

      1. $data=palo_getdata_export($connstring,$cube,TRUE,TRUE,NULL,$nblines,NULL,$dimensions_subcube);

      I have the impression that the $nblines parameter is mandatory to be able to query the whole bunch of data. If I use $nblines=10, only the 10 first records will be returned.

      That is why I wrote the following function:

      PHP Source Code

      1. // gets the cartesian product of the count in each dimension
      2. function get_number_elements($array)
      3. {
      4. $number_elts=1;
      5. foreach ($array as $arrayelt)
      6. {
      7. if (is_array($arrayelt))
      8. {
      9. $number_elts=$number_elts*count($arrayelt);
      10. }
      11. else
      12. {
      13. $number_elts=$number_elts*1;
      14. }
      15. }
      16. return $number_elts;
      17. }

      I pass to this function the array corresponding to the coordinates of the cells I want to query. Then it calculates the total number of cells of the subcube (this is a cartesian product).

      Of course the palo_getdata_export above restricts to non-empty cells. In my case I have $nblines ~= 40 000 000, thereof ~17000 are non-empty.

      When I launch the script with $nblines=get_number_elements($dimensions_subcube) (thus 40 000 000), I get the following error in the apache_error.log:

      PHP Warning: Unknown exception! bad allocation in C:\\Program Files\\Jedox\\Jedox Suite\\httpd\\app\\docroot\\tests.php on line 125

      the line 125 is the line of the palo_getdata_export function.

      But weirdly when I put manually $nblines=20000 it works.

      I tried to change the memory_size parameter in the php.ini but it does not work better.

      Do you have an idea ?

      thanks in advance!

      Post hoc, non est propter hoc
      You have to call the export function in a loop. I don't know the .NET params exactly, but for PHP there was a parameter $first_path. In first call of the export you leave the parameter empty, for all subsequent calls you use coordinates of last line from previous bulk. Repeat until you get less records than $max_rows.

      Source Code

      1. array
      2. palo_getdata_export(string $connection, string $cube_name, bool $ignore_empty, bool $base_only, double $lower_limit, double $upper_limit, string $lower_operator, string $upper_operator, string $compare_mode, int $max_rows, array $first_path, array $subcube, bool $use_rules)