Giter Site home page Giter Site logo

JOIN via JSON request about manticoresearch HOT 6 OPEN

donhardman avatar donhardman commented on July 22, 2024
JOIN via JSON request

from manticoresearch.

Comments (6)

sanikolaev avatar sanikolaev commented on July 22, 2024

This issue blocks manticoresoftware/manticoresearch-php#210

from manticoresearch.

sanikolaev avatar sanikolaev commented on July 22, 2024

It's not a big deal to implement it, but we need to prepare the syntax first. Let's discuss it together.

from manticoresearch.

donhardman avatar donhardman commented on July 22, 2024

Here is a suggestion for an interface we can use:

{
  "join": [
    {
      "type": "inner",
      "table": "another",
      "on": [
        {
          "left": {
            "table": "one",
            "field": "id"
          },
          "operator": "=",
          "right": {
            "table": "another",
            "field": "id"
          }
        }
      ]
    }
  ]
}

Explanation of the join syntax:

  • The join property is an array that contains one or more join objects.
  • Each join object represents a single join operation and has the following properties:
    • type: Specifies the type of join. In the example, it is set to "inner", indicating an inner join. Other possible values could be "left", "right", or "full" for left join, right join, or full outer join, respectively, depending on what Manticore supports.
    • table: Specifies the name of the table to join with.
    • on: An array of join conditions.
      • Each condition object represents a single join condition and has the following properties:
        • left: Represents the left side of the join condition.
          • table: Specifies the table name for the left side of the condition.
          • field: Specifies the field name for the left side of the condition.
        • operator: Specifies the comparison operator for the join condition. In the example, it is set to "=", indicating an equality condition. Other possible operators could be "<", ">", "<=", ">=", etc., depending on what Manticore currently supports.
        • right: Represents the right side of the join condition.
          • table: Specifies the table name for the right side of the condition.
          • field: Specifies the field name for the right side of the condition.

from manticoresearch.

sanikolaev avatar sanikolaev commented on July 22, 2024

@glookka pls review the proposed syntax, do you have any objections?

from manticoresearch.

glookka avatar glookka commented on July 22, 2024
  1. Is this syntax
          "left": {
            "table": "one",
            "field": "id"
          },
          "operator": "=",
          "right": {
            "table": "another",
            "field": "id"
          }

better than something like this?

"condition": "one.id=another.id"
  1. If we keep the abovementioned syntax, we still have range filters in our json queries that use syntax operation names "lt", "gte", "equals". We might want to keep these names consistent.

from manticoresearch.

sanikolaev avatar sanikolaev commented on July 22, 2024

better than something like this?
"condition": "one.id=another.id"

It seems so as the latter is not structured enough. Not the json way.

If we keep the abovementioned syntax, we still have range filters in our json queries that use syntax operation names "lt", "gte", "equals". We might want to keep these names consistent

Good point. Yes, we'd probably better stick to the existing names.

from manticoresearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.