[ 
https://issues.apache.org/jira/browse/TAJO-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13957349#comment-13957349
 ] 

Jihoon Son commented on TAJO-494:
---------------------------------

For this, we need to standardize the JSON form of Tajo's query plan. 
I designed a prototype while considering human-readability and simplicity.
Here is the prototype.

{noformat}
SQL> select r_name from region where r_regionkey = 1;

JSON>
"Plan": {
  "PlanType": "SCAN"
  "RelationName": "region"
  "Projections": {
    "Projection": {
      "Name": "r_name"
    }
  }
  "Conditions": {
    "Cond": "r_regionkey = 1"
  }
}

SQL> select r_name, sum(r_regionkey) as sum_key from region group by r_name;

JSON> 
"Plan": {
  "PlanType": "GROUP_BY"
  "Keys": {
    "Key": "r_name"
  }
  "Measures": {
    "Measure": {
      "Name": "sum(r_regionkey)"
      "Alias": "sum_key"
    }
  }
  "Plan" {
    "PlanType": "SCAN"
    "RelationName": "region"
    "Projections": {
      "Projection": {
        "Name": "r_name"
      }
      "Projection": {
        "Name": "r_regionkey"
      }
    }
  }
}

SQL> select r_regionkey, n_nationkey from region, nation where r_regionkey = 
n_regionkey;

JSON>
"Plan": {
  "PlanType": "JOIN"
  "JoinType": "INNER"
  "Conditions": {
    "Cond": "r_regionkey = n_regionkey"
  }
  "Plans" {
    "Plan" {
      "PlanType": "SCAN"
      "RelationName": "region"
      "Projections": {
        "Projection": {
          "Name": "r_regionkey"
        }
      }
    }
    "Plan" {
      "PlanType": "SCAN"
      "RelationName": "nation"
      "Projections": {
        "Projection": {
          "Name": "n_regionkey"
        }
      }
    }
  }
}
{noformat}

In this prototype, "Plan" represents a logical node. It can contain one or more 
"Plan"s as its children.

This is just a prototype, so there may be a lot of aspects to be improved.
Please feel free to give me any suggestions. 

> Extend TajoClient to run a query with a plan context serialized as the JSON 
> form
> --------------------------------------------------------------------------------
>
>                 Key: TAJO-494
>                 URL: https://issues.apache.org/jira/browse/TAJO-494
>             Project: Tajo
>          Issue Type: New Feature
>          Components: client
>    Affects Versions: 0.8-incubating
>            Reporter: Jihoon Son
>
> In some OLAP applications which has a separate query engine such as Tajo, 
> they accept SQL-like languages and parse them to generate query plans. 
> Mondrian is a representative example of these applications. If TajoClient 
> accepts query plans of the JSON form, user queries can be efficiently 
> executed without the duplicated parse phase.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to