{"id":18806650,"url":"https://github.com/lefred/mysql-component-vector_operations","last_synced_at":"2026-01-08T18:30:15.996Z","repository":{"id":250102185,"uuid":"833469986","full_name":"lefred/mysql-component-vector_operations","owner":"lefred","description":"MySQL Component to deal with the VECTOR datatype","archived":false,"fork":false,"pushed_at":"2024-10-16T07:14:07.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T21:26:55.141Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lefred.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-25T05:58:05.000Z","updated_at":"2024-10-16T07:14:11.000Z","dependencies_parsed_at":"2024-11-07T22:49:17.960Z","dependency_job_id":"a19565d0-4f8a-42e7-8d03-67e30c826005","html_url":"https://github.com/lefred/mysql-component-vector_operations","commit_stats":null,"previous_names":["lefred/mysql-component-vector_operations"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefred%2Fmysql-component-vector_operations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefred%2Fmysql-component-vector_operations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefred%2Fmysql-component-vector_operations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lefred%2Fmysql-component-vector_operations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lefred","download_url":"https://codeload.github.com/lefred/mysql-component-vector_operations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239742416,"owners_count":19689309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T22:49:15.109Z","updated_at":"2026-01-08T18:30:15.964Z","avatar_url":"https://github.com/lefred.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysql-component-vector_operations\n\nExtending MySQL using the Component Infrastructure - Adding 4 basic mathematical operations \nfor vectors of the same size.\n\nThis code  is not intended for production use and is provided solely for illustrative purposes of a blog\npost series related to the VECTOR datatype in MySQL.\n\nThe VECTOR datatype was introduced in MySQL 9.0.\n\n```\n MySQL \u003e install component \"file://component_vector_operations\";\n Query OK, 0 rows affected (0.0005 sec)\n \n MySQL \u003e SELECT UDF_NAME FROM performance_schema.user_defined_functions  WHERE UDF_NAME LIKE 'VECTOR%';\n+-----------------------+\n| UDF_NAME              |\n+-----------------------+\n| VECTOR_DIVISION       |\n| VECTOR_MULTIPLICATION |\n| VECTOR_SUBTRACTION    |\n| VECTOR_ADDITION       |\n+-----------------------+\n4 rows in set (0.0016 sec)\n\nMySQL \u003e SELECT \n          VECTOR_ADDITION(\n             STRING_TO_VECTOR('[1,2,3]'), \n             STRING_TO_VECTOR('[4,5,6]')\n          ) result;\n+----------------------------+\n| result                     |\n+----------------------------+\n| 0x0000A0400000E04000001041 |\n+----------------------------+\n1 row in set (0.0006 sec)\n\nMySQL \u003e SELECT VECTOR_TO_STRING(\n          VECTOR_ADDITION(\n             STRING_TO_VECTOR('[1,2,3]'),\n             STRING_TO_VECTOR('[4,5,6]')\n          )\n        ) result;\n+---------------------------------------+\n| result                                |\n+---------------------------------------+\n| [5.00000e+00,7.00000e+00,9.00000e+00] |\n+---------------------------------------+\n1 row in set (0.0002 sec)\n\n\nMySQL \u003e SELECT VECTOR_TO_STRING(\n          VECTOR_DIVISION(\n             STRING_TO_VECTOR('[1,2,3]'), \n             STRING_TO_VECTOR('[4,5,6]')\n          )\n        ) result;\n+---------------------------------------+\n| result                                |\n+---------------------------------------+\n| [2.50000e-01,4.00000e-01,5.00000e-01] |\n+---------------------------------------+\n1 row in set (0.0003 sec)\n```\n\n## Errors Handling\n\n```\nMySQL \u003e SELECT VECTOR_TO_STRING(\n           VECTOR_ADDITION(\n              STRING_TO_VECTOR('[]'),\n              STRING_TO_VECTOR('[]')\n           )\n          ) result;\nERROR: 6138 (HY000): Data cannot be converted to a valid vector: '[]'\n\nMySQL \u003e SELECT VECTOR_TO_STRING(\n          VECTOR_DIVISION(\n             STRING_TO_VECTOR('[1,2,3]'),\n             STRING_TO_VECTOR('[4,5,6,2]')\n          )\n        ) result;\nvector operation UDF failed; both vectors must have the same size\n\nMySQL \u003e SELECT VECTOR_TO_STRING(\n          VECTOR_DIVISION(\n             STRING_TO_VECTOR('[1,2,3]'),\n             STRING_TO_VECTOR('[4,5,0]')\n          )\n        ) result;\nvector_division UDF failed; Division by zero is undefined\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flefred%2Fmysql-component-vector_operations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flefred%2Fmysql-component-vector_operations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flefred%2Fmysql-component-vector_operations/lists"}