Title: Inserting with `skip_duplicates=True` fails with error message "attr X is ambiguous" · Issue #451 · datajoint/datajoint-python · GitHub
Open Graph Title: Inserting with `skip_duplicates=True` fails with error message "attr X is ambiguous" · Issue #451 · datajoint/datajoint-python
X Title: Inserting with `skip_duplicates=True` fails with error message "attr X is ambiguous" · Issue #451 · datajoint/datajoint-python
Description: I'm encountering a case in which inserting with skip_duplicates=True results in an error. The effective query performed by the insert is: 'INSERT INTO `cortex_ex_machina_mesonet_analysis2018_02_20`.`__high_oracle_units` (`group_id`,`data...
Open Graph Description: I'm encountering a case in which inserting with skip_duplicates=True results in an error. The effective query performed by the insert is: 'INSERT INTO `cortex_ex_machina_mesonet_analysis2018_02_20`...
X Description: I'm encountering a case in which inserting with skip_duplicates=True results in an error. The effective query performed by the insert is: 'INSERT INTO `cortex_ex_machina_mesonet_analysis201...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/451
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inserting with `skip_duplicates=True` fails with error message \"attr X is ambiguous\"","articleBody":"I'm encountering a case in which inserting with `skip_duplicates=True` results in an error. The effective query performed by the insert is:\r\n\r\n```sql\r\n'INSERT INTO `cortex_ex_machina_mesonet_analysis2018_02_20`.`__high_oracle_units` (`group_id`,`data_hash`,`readout_key`,`neuron_id`) SELECT `group_id`,`data_hash`,`readout_key`,`neuron_id` FROM (SELECT * FROM `cortex_ex_machina_mesonet_analysis2018_02_20`.`__target_dataset__unit` WHERE ((`data_hash`=\\'a502f8a1ad8fab1f3fea0b3638af26a4\\') AND (`group_id`=4)) AND ((`group_id`,`readout_key`,`unit_id`,`animal_id`) in (SELECT `group_id`,`readout_key`,`unit_id`,`animal_id` FROM (SELECT `group_id`,`animal_id`,`session`,`scan_idx`,`window`,`unit_id`,`pearson`,concat_ws(\"-\", animal_id, session, scan_idx) as `readout_key` FROM `cortex_ex_machina_mesonet_data`.`__meso_net_all_oracle__unit_scores`) as `_s16` WHERE ((`group_id`,`animal_id`,`unit_id`,`readout_key`) in (SELECT `group_id`,`animal_id`,`unit_id`,`readout_key` FROM `cortex_ex_machina_mesonet_analysis2018_02_20`.`__target_dataset__unit` WHERE ((`data_hash`=\\'a502f8a1ad8fab1f3fea0b3638af26a4\\') AND (`group_id`=4)))) AND (pearson \u003e 0.395305)))) as `_s17` ON DUPLICATE KEY UPDATE `group_id`=`group_id`'\r\n```\r\n When the above query is attempted, it fails with an error: `\r\nInternalError: (1052, \"Column 'group_id' in field list is ambiguous\")`\r\n\r\nIt appears to have to do with the fact that the attribute `group_id` is present on both target and source of the insert. I'll need to look into this further, but it may be the case that our \"workaround\" for duplicate entry (i.e. the `ON DUPLICATE KEY UPDATE group_id=group_id`) is not compatible when inserting from another relation.","author":{"url":"https://github.com/eywalker","@type":"Person","name":"eywalker"},"datePublished":"2018-02-22T00:59:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/451/datajoint-python/issues/451"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8a0c373e-9734-1dc3-07e9-f9bfbfec5bd2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D484:3463DE:1526FCF:1CB1CB8:6A4F01FD |
| html-safe-nonce | e60dfd25aed7f8d2b6673c2f3e2a0a3c3df1634a53fb67b479eaf2594cebb9ba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDg0OjM0NjNERToxNTI2RkNGOjFDQjFDQjg6NkE0RjAxRkQiLCJ2aXNpdG9yX2lkIjoiODY4NjI1ODUyMTExNTY1NjcwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6824037f06f750fc9317b8005c7b69a326cb9725270efa19bc75548d1929d9d3 |
| hovercard-subject-tag | issue:299185644 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/451/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6a92489c03baf31abdcc254806c6d807b0e26131fdbc19a101a700b5d3914a48/datajoint/datajoint-python/issues/451 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6a92489c03baf31abdcc254806c6d807b0e26131fdbc19a101a700b5d3914a48/datajoint/datajoint-python/issues/451 |
| og:image:alt | I'm encountering a case in which inserting with skip_duplicates=True results in an error. The effective query performed by the insert is: 'INSERT INTO `cortex_ex_machina_mesonet_analysis2018_02_20`... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eywalker |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width