{"action":"opened","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5510","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5510/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5510/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5510/events","html_url":"https://github.com/orientechnologies/orientdb/issues/5510","id":123686382,"number":5510,"title":"suggestion: Not to throw when no edges created.","user":{"login":"gongdo","id":5451328,"avatar_url":"https://avatars.githubusercontent.com/u/5451328?v=3","gravatar_id":"","url":"https://api.github.com/users/gongdo","html_url":"https://github.com/gongdo","followers_url":"https://api.github.com/users/gongdo/followers","following_url":"https://api.github.com/users/gongdo/following{/other_user}","gists_url":"https://api.github.com/users/gongdo/gists{/gist_id}","starred_url":"https://api.github.com/users/gongdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongdo/subscriptions","organizations_url":"https://api.github.com/users/gongdo/orgs","repos_url":"https://api.github.com/users/gongdo/repos","events_url":"https://api.github.com/users/gongdo/events{/privacy}","received_events_url":"https://api.github.com/users/gongdo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-23T16:25:25Z","updated_at":"2015-12-23T16:25:25Z","closed_at":null,"body":"Currently, `CREATE EDGE` throws an exception when `FROM` statement or `TO` statement were not found.\r\n\r\nhttps://github.com/orientechnologies/orientdb/blob/ad7cbed6c7c5b3f920713d93bc8c98b219c200c8/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/OCommandExecutorSQLCreateEdge.java#L213-L219\r\n```java\r\n        if (edges.isEmpty()) {\r\n          if (fromIds.isEmpty())\r\n            throw new OCommandExecutionException(\"No edge has been created because no source vertices\");\r\n          else if (toIds.isEmpty())\r\n            throw new OCommandExecutionException(\"No edge has been created because no target vertices\");\r\n          throw new OCommandExecutionException(\"No edge has been created between \" + fromIds + \" and \" + toIds);\r\n        }\r\n```\r\n\r\nImagine you want to create possibly multiple edges from a RID to a sub-query.\r\nThe result of sub-query could be empty, it's not deterministic.\r\nIf you want to make sure that the edges will be created, than you should select-and-create in a transaction.\r\nWhy don't you let it go and just return a number of edges that actually created.\r\nI think it's not only easier to handle it, but also give better performance.\r\n"}}