Custom migration from external DB I'm trying to migrate content from an Expression Engine database to Drupal 8.

I set up a $databases['migrate']['default'] in settings.php and copied and modified BeerNode.php from migrate_plus migrate_example module in a custom module.
This is my query code in BlogNode.php.

  public function query() {
    // $this-&gt;configuration['ignore_map'] = true;
    $query = $this-&gt;select('exp_weblog_titles', 'tab1');
    $query-&gt;addField('tab1', 'entry_id', 'bid');
    $query-&gt;addField('tab1', 'title', 'name');
    $query-&gt;addField('tab2', 'field_id_10', 'body');
    $query-&gt;innerJoin('exp_weblog_data', 'tab2', 'tab1.entry_id = tab2.entry_id');
    $query-&gt;condition('tab1.weblog_id', 10, '=');
    return $query;
  }


Now Drush complains about a missing column:


  Migration failed with source plugin exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'b.bid' in 'on clause':

SELECT tab1.entry_id AS bid, tab1.title AS name, tab2.field_id_196 AS body, map.sourceid1 AS migrate_map_sourceid1, map.source_row_status AS
migrate_map_source_row_status
FROM
{exp_weblog_titles} tab1
INNER JOIN {exp_weblog_data} tab2 ON tab1.entry_id = tab2.entry_id
LEFT OUTER JOIN destinationdatabase.migrate_map_blog_node map ON b.bid = map.sourceid1
WHERE  (tab1.weblog_id = :db_condition_placeholder_0) AND( (map.sourceid1 IS NULL ) OR (map.source_row_status = :db_condition_placeholder_1) );



This is the implementation of getIds():

  public function getIds() {
    return array(
      'bid' =&gt; array(
        'type' =&gt; 'integer',
        'alias' =&gt; 'b',
      ),
    );
  }


I assume that the second part of the query should be ON tab1.entry_id = map.sourceid1 but I can't set anything other than bid.

I kind of resolved by temporarily setting $this-&gt;configuration['ignore_map'] = true; before the query losing some traking functionality though.
Remove 'alias' => 'b', from your getIds() call, that parameter is only needed if you need to remove any ambiguity from the source query.