You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Rajat Khandelwal (JIRA)" <ji...@apache.org> on 2015/06/24 08:35:42 UTC

[jira] [Commented] (LENS-630) Using Duration and Fact Weight Based Query Cost Calculator for Hive Driver

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

Rajat Khandelwal commented on LENS-630:
---------------------------------------

HiveDriver's estimate:

{noformat}

  @Override
  public QueryCost estimate(AbstractQueryContext qctx) throws LensException {
    log.info("Estimate: " + qctx.getDriverQuery(this));
    if (qctx.getDriverQuery(this) == null) {
      throw new NullPointerException("Null driver query for " + qctx.getUserQuery());
    }
    if (qctx.getDriverContext().getDriverQueryCost(this) != null) {
      // estimate called again and again
      return qctx.getDriverContext().getDriverQueryCost(this);
    }
    if (qctx.isOlapQuery()) {
      // if query is olap query and rewriting takes care of semantic validation
      // estimate is not doing anything as of now
      return HiveQueryPlan.HIVE_DRIVER_COST;
    } else {
      // its native table query. Do explain and return cost
      return explain(qctx).getCost();
    }
  }
{noformat}

Question is, what normalized cost should we return for native table queries?

> Using Duration and Fact Weight Based Query Cost Calculator for Hive Driver
> --------------------------------------------------------------------------
>
>                 Key: LENS-630
>                 URL: https://issues.apache.org/jira/browse/LENS-630
>             Project: Apache Lens
>          Issue Type: Improvement
>            Reporter: Himanshu Gahlaut
>            Assignee: Rajat Khandelwal
>
> Along with this, we can add a new field in QueryCost to return the query cost calculated by the implementation. normalizedQueryCost could be one name for that field.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)