Skip to content

ES error on indexing flow #807

@janvanrijn

Description

@janvanrijn

This in wrong SQL

    public function index_flow($id, $start_id = 0, $altmetrics=True, $verbosity=0) {

        $params['index'] = 'openml';
        $params['type'] = 'flow';

        $flows = $this->db->query('select i.*, count(rid) as runs from implementation i left join algorithm_setup s on (s.implementation_id=i.id) left join run r on (r.setup=s.sid)' . ($id ? ' where i.id=' . $id : '') . ' group by i.id');


        if ($id and ! $flows)
            return 'Error: flow ' . $id . ' is unknown';
        elseif (! $flows)
            return 'Nothing to index';
        foreach ($flows as $d) {
            $params['body'][] = array(
                'index' => array(
                    '_id' => $d->id
                )
            );

            $params['body'][] = $this->build_flow($d);
        }

        $responses = $this->client->bulk($params);

        if($responses['errors'] == True){
    foreach ($responses['items'] as $res){
    if(array_key_exists('error',$res['index'])){
      $err = $res['index']['error'];
      return 'ERROR for ID ' . $res['index']['_id'] . ' : Type:' . $err['type'] . ' Reason: ' . $err['reason'] . (array_key_exists('caused_by', $err) ? ' Caused by: ' . $err['caused_by']['reason'] : '');
      }
    }
  }

As it results in the following error:

Error Number: 1055
	Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'openml_expdb.i.fullName' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
	select i.*, count(rid) as runs from implementation i left join algorithm_setup s on (s.implementation_id=i.id) left join run r on (r.setup=s.sid) group by i.id
	Filename: core/MY_Database_Read_Model.php
	Line Number: 31

I am still trying to figure out why this error has not manifested itself before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions