René's URL Explorer Experiment


Title: Unions and Outer Joins · Issue #264 · datajoint/datajoint-python · GitHub

Open Graph Title: Unions and Outer Joins · Issue #264 · datajoint/datajoint-python

X Title: Unions and Outer Joins · Issue #264 · datajoint/datajoint-python

Description: So far DataJoint has not offered the union operator and the outer join operators. These two operators are closely related. I propose to implement outer join/union as the + operator. Syntax a + b # full outer join of relations `a` and `b`...

Open Graph Description: So far DataJoint has not offered the union operator and the outer join operators. These two operators are closely related. I propose to implement outer join/union as the + operator. Syntax a + b # ...

X Description: So far DataJoint has not offered the union operator and the outer join operators. These two operators are closely related. I propose to implement outer join/union as the + operator. Syntax a + b # ...

Opengraph URL: https://github.com/datajoint/datajoint-python/issues/264

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unions and Outer Joins","articleBody":"So far DataJoint has not offered the union operator and the outer join operators.  These two operators are closely related.  I propose to implement outer join/union as the `+` operator.\r\n\r\n## Syntax\r\n```python\r\na + b    # full outer join of relations `a` and `b` \r\n```\r\nIncidentally, outer join is equivalent to union when the two arguments have the same sets of attributes.  \r\n\r\nNote that MySQL does not implement full outer joins, so internally it will be implemented as a left join followed by a union with the right argument.\r\n\r\n## Rules \r\nThe full outer join follows the same rules as the join operator `a*b`:\r\n1.  The primary key of the expression `a+b` is the union of the primary key attributes of `a` and `b`.\r\n1.   The matching attributes in `a` and `b`, i.e. those sharing the same names in both relations must be of compatible datatypes and must belong to the primary key of either `a` or `b`.  An exception will be raised if a non-key attribute with the same name is present in both relations. \r\n1.  The order of attributes in the arguments does not matter and is not guaranteed in the result.\r\n\r\n## Equivalence to OUTER JOIN\r\n`a+b` is equivalent to the natural outer join operator in relational algebra.  \r\n\r\n## Equivalence to SQL's UNION\r\n`a+b` is equivalent to relational union if `a` and `b` have the same sets of attributes. \r\n\r\n## Implementation of LEFT and RIGHT OUTER JOINs\r\nThe natural left join (`a NATURAL LEFT JOIN b`) can now be expressed as\r\n```python\r\na * b + a\r\n```\r\nor, equivalently, as\r\n```python\r\n(a + b) \u0026 a\r\n```\r\nor, equivalently, as\r\n```python\r\na + (b \u0026 a) \r\n```\r\nor, equivalently\r\n```python\r\n(a - b) + b\r\n``` \r\n\r\nIt is difficult to make DataJoint recognize all these patterns and to convert them into efficient SQL, so let's introduce the special syntax indicating left or right joins:\r\n\r\n```python\r\na * ~b      # left outer join  (all rows of `a` are kept).\r\n~a * b      # right outer join (all rows of `b` are kept). \r\n~a * ~b  # outer join (equivalent to `a+b`)\r\n```\r\n\r\nThe outer flag `~` survives projections and restrictions but not other operators:\r\n```python\r\n~(a \u0026 cond) * b    # equivalent to   (~a \u0026 cond) * b\r\n~a.proj() * b    # equivalent to   (~a).proj() * b\r\n```\r\n\r\n## Examples\r\n### Example 1:  Simple union\r\nLet relation `a` with primary key (i, k) equal \r\n\r\n| *i \t| *k \t| \r\n|:-:\t|:-:\t|\r\n|   1\t|  1 \t|\r\n|   1\t|  2\t|\r\n|   2\t|  1 \t|\r\n\r\nLet relation `b` with primary key (k) equal \r\n\r\n| *k \t|  i \t| \r\n|:-:\t|:-:\t|\r\n|   1\t|   1\t|\r\n|   2\t|   1\t|\r\n|   2\t|  3\t|\r\n\r\nThen `a+b` will be\r\n\r\n| *i \t| *k \t| \r\n|:-:\t|:-:\t|\r\n|   1\t|  1 \t|\r\n|   1\t|  2\t|\r\n|   2\t|  1 \t|\r\n|   3\t|  2 \t|\r\n\r\n### Example 2: No matching attributes:  outer join = inner join\r\n\r\nLet relation `a` with primary key (i) equal \r\n\r\n| *i \t| m | \r\n|:-:\t|:-: |\r\n|   1\t|  6  |\r\n|   2\t|  6 \t|\r\n\r\nLet relation `b` with primary key (i, k) equal \r\n\r\n|  *k \t| n | \r\n|:-:\t|:-: |\r\n|   1\t|   8 |\r\n|   2\t|   8 |\r\n\r\nThen `a+b` will be\r\n\r\n| *i \t| *k \t| m  | n  |\r\n|:-:\t|:-:\t|:-:  |:-:  |\r\n|   1\t|   1\t| 6 | 8 |\r\n|   1\t|   2\t| 6 | 8 |\r\n|   2\t|   1\t| 6 | 8 |\r\n|   2 |    2  | 6 | 8 |\r\n\r\n\r\n### Example 3:  Simple outer join\r\n\r\nLet relation `a` with primary key (i) equal \r\n\r\n| *i \t| m | \r\n|:-:\t|:-: |\r\n|   1\t|  6  |\r\n|   2\t|  6 \t|\r\n|   3\t|  6 \t|\r\n\r\nLet relation `b` with primary key (i, k) equal \r\n\r\n| *i \t|  *k \t| n | \r\n|:-:\t|:-:\t|:-: |\r\n|   1\t|   1\t| 8 |\r\n|   1\t|   2\t| 8 |\r\n|   2\t|  3\t| 8 |\r\n|   4 |   1  | 8 |\r\n\r\nThen `a+b` will be\r\n\r\n| *i \t| *k \t| m  | n  |\r\n|:-:\t|:-:\t|:-:  |:-:  |\r\n|   1\t|   1\t| 6 | 8 |\r\n|   1\t|   2\t| 6 | 8 |\r\n|   2\t|  3\t| 6 | 8 |\r\n|   4 |   1  | NULL | 8 |\r\n|   3  |  NULL | 6 | NULL\r\n\r\nNote `a+b` may produce NULLs in the primary key. ","author":{"url":"https://github.com/dimitri-yatsenko","@type":"Person","name":"dimitri-yatsenko"},"datePublished":"2016-11-22T21:55:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/264/datajoint-python/issues/264"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:544af3b9-8be5-bbc2-70a6-93081ad2597c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9FEA:380AD5:F13732:1480D57:6A4D61D6
html-safe-nonce5d51975e1a01f300b55dfba7ad6135873ff5831c38e9fbec32e043a19fc438cf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkVBOjM4MEFENTpGMTM3MzI6MTQ4MEQ1Nzo2QTRENjFENiIsInZpc2l0b3JfaWQiOiI4MDU0NzY5MzE1MjQ3MTQ5NjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace68681e92a59553d99d4f484e5f8214203af298ab5027df975f56de5e013c61f
hovercard-subject-tagissue:191134812
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/264/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3ae655eec1215b0628ba0470bdcc0629b98b10b3f111f21777d0198d9d9f5e69/datajoint/datajoint-python/issues/264
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3ae655eec1215b0628ba0470bdcc0629b98b10b3f111f21777d0198d9d9f5e69/datajoint/datajoint-python/issues/264
og:image:altSo far DataJoint has not offered the union operator and the outer join operators. These two operators are closely related. I propose to implement outer join/union as the + operator. Syntax a + b # ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedimitri-yatsenko
hostnamegithub.com
expected-hostnamegithub.com
Nonee6658d7c7808aeed776f841e0839b885fce343c9b96244be612c779298e7661e
turbo-cache-controlno-preview
go-importgithub.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git
octolytics-dimension-user_id2375501
octolytics-dimension-user_logindatajoint
octolytics-dimension-repository_id5866704
octolytics-dimension-repository_nwodatajoint/datajoint-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id5866704
octolytics-dimension-repository_network_root_nwodatajoint/datajoint-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea438513d3a22ffcd713795ed948c3e5525007665
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/datajoint/datajoint-python/issues/264#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdatajoint%2Fdatajoint-python%2Fissues%2F264
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdatajoint%2Fdatajoint-python%2Fissues%2F264
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=datajoint%2Fdatajoint-python
Reloadhttps://github.com/datajoint/datajoint-python/issues/264
Reloadhttps://github.com/datajoint/datajoint-python/issues/264
Reloadhttps://github.com/datajoint/datajoint-python/issues/264
Please reload this pagehttps://github.com/datajoint/datajoint-python/issues/264
datajoint https://github.com/datajoint
datajoint-pythonhttps://github.com/datajoint/datajoint-python
Notifications https://github.com/login?return_to=%2Fdatajoint%2Fdatajoint-python
Fork 96 https://github.com/login?return_to=%2Fdatajoint%2Fdatajoint-python
Star 194 https://github.com/login?return_to=%2Fdatajoint%2Fdatajoint-python
Code https://github.com/datajoint/datajoint-python
Issues 7 https://github.com/datajoint/datajoint-python/issues
Pull requests 4 https://github.com/datajoint/datajoint-python/pulls
Discussions https://github.com/datajoint/datajoint-python/discussions
Actions https://github.com/datajoint/datajoint-python/actions
Security and quality 0 https://github.com/datajoint/datajoint-python/security
Insights https://github.com/datajoint/datajoint-python/pulse
Code https://github.com/datajoint/datajoint-python
Issues https://github.com/datajoint/datajoint-python/issues
Pull requests https://github.com/datajoint/datajoint-python/pulls
Discussions https://github.com/datajoint/datajoint-python/discussions
Actions https://github.com/datajoint/datajoint-python/actions
Security and quality https://github.com/datajoint/datajoint-python/security
Insights https://github.com/datajoint/datajoint-python/pulse
Unions and Outer Joinshttps://github.com/datajoint/datajoint-python/issues/264#top
https://github.com/dimitri-yatsenko
Release 0.9https://github.com/datajoint/datajoint-python/milestone/2
https://github.com/dimitri-yatsenko
dimitri-yatsenkohttps://github.com/dimitri-yatsenko
on Nov 22, 2016https://github.com/datajoint/datajoint-python/issues/264#issue-191134812
dimitri-yatsenkohttps://github.com/dimitri-yatsenko
Release 0.9https://github.com/datajoint/datajoint-python/milestone/2
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.