[ 
https://issues.apache.org/jira/browse/SPARK-7331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nitin Goyal updated SPARK-7331:
-------------------------------
    Description: 
A new HiveConf is created per query in getAst method in HiveQl.scala

  def getAst(sql: String): ASTNode = {

    /*
     * Context has to be passed in hive0.13.1.
     * Otherwise, there will be Null pointer exception,
     * when retrieving properties form HiveConf.
     */

    val hContext = new Context(new HiveConf())

    val node = ParseUtils.findRootNonNullToken((new ParseDriver).parse(sql, 
hContext))

    hContext.clear()

    node

  }

Creating hiveConf adds a minimum of 90ms delay per query. So moving its 
creation in Object such that it gets initialised once.

  was:
A new HiveConf is created per query in getAst method in HiveQl.scala

  def getAst(sql: String): ASTNode = {
    /*
     * Context has to be passed in hive0.13.1.
     * Otherwise, there will be Null pointer exception,
     * when retrieving properties form HiveConf.
     */
    val hContext = new Context(new HiveConf())
    val node = ParseUtils.findRootNonNullToken((new ParseDriver).parse(sql, 
hContext))
    hContext.clear()
    node
  }

Creating hiveConf adds a minimum of 90ms delay per query. So moving its 
creation in Object such that it gets initialised once.


> Create HiveConf per application instead of per query in HiveQl.scala
> --------------------------------------------------------------------
>
>                 Key: SPARK-7331
>                 URL: https://issues.apache.org/jira/browse/SPARK-7331
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.2.0, 1.3.0
>            Reporter: Nitin Goyal
>            Priority: Minor
>
> A new HiveConf is created per query in getAst method in HiveQl.scala
>   def getAst(sql: String): ASTNode = {
>     /*
>      * Context has to be passed in hive0.13.1.
>      * Otherwise, there will be Null pointer exception,
>      * when retrieving properties form HiveConf.
>      */
>     val hContext = new Context(new HiveConf())
>     val node = ParseUtils.findRootNonNullToken((new ParseDriver).parse(sql, 
> hContext))
>     hContext.clear()
>     node
>   }
> Creating hiveConf adds a minimum of 90ms delay per query. So moving its 
> creation in Object such that it gets initialised once.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to