[GitHub] incubator-carbondata pull request #623: [WIP] Add spark-sql CLI support for ...

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #623: [WIP] Add spark-sql CLI support for ...

qiuchenjian-2
GitHub user jackylk opened a pull request:

    https://github.com/apache/incubator-carbondata/pull/623

    [WIP] Add spark-sql CLI support for spark2.1 carbon integration

    Added classes for using CarbonSession in spark-sql CLI
    Usage: set the SPARK_HOME environment variable and execute bin/carbon-spark-sql

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jackylk/incubator-carbondata cli

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-carbondata/pull/623.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #623
   
----
commit 2228279f18acf133d0330c625a9b1ff5ca40269b
Author: jackylk <[hidden email]>
Date:   2017-03-05T12:24:34Z

    add spark-sql support for spark2.1 carbon integration

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #623: [WIP] Add spark-sql CLI support for spark2....

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/623
 
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1007/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #623: [WIP] Add spark-sql CLI support for spark2....

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/623
 
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1008/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #623: [CARBONDATA-746] Add spark-sql CLI support ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/623
 
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1011/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #623: [CARBONDATA-746] Add spark-sql CLI s...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/623#discussion_r104630150
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/hive/cli/CarbonContext.scala ---
    @@ -0,0 +1,30 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.sql.hive.cli
    +
    +import org.apache.spark.sql.{DataFrame, SparkSession}
    +import org.apache.spark.sql.hive.HiveContext
    +
    +class CarbonContext(
    --- End diff --
   
    I guess it is not required to create context , just use the context available in  CarbonSession would be enough.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #623: [CARBONDATA-746] Add spark-sql CLI s...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/623#discussion_r104629836
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/hive/cli/CarbonSQLCLIDriver.scala ---
    @@ -0,0 +1,64 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.sql.hive.cli
    +
    +import org.apache.spark.{SparkConf, SparkContext}
    +import org.apache.spark.sql.{SparkSession, SQLContext}
    +import org.apache.spark.sql.hive.thriftserver.{SparkSQLCLIDriver, SparkSQLEnv}
    +
    +import org.apache.carbondata.common.logging.LogServiceFactory
    +
    +object CarbonSQLCLIDriver {
    +
    +  private val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +  var hiveContext: SQLContext = _
    +  var sparkContext: SparkContext = _
    +
    +  def main(args: Array[String]): Unit = {
    +    init()
    +    SparkSQLEnv.sparkContext = sparkContext
    +    SparkSQLEnv.sqlContext = hiveContext
    +    SparkSQLCLIDriver.installSignalHandler()
    +    SparkSQLCLIDriver.main(args)
    +  }
    +
    +  def init() {
    +    if (hiveContext == null) {
    +      val sparkConf = new SparkConf(loadDefaults = true)
    +
    +      import org.apache.spark.sql.CarbonSession._
    +
    +      val storePath = System.getenv("CARBON_HOME") + "/bin/carbonsqlclistore"
    +      val warehouse = System.getenv("CARBON_HOME") + "/warehouse"
    +      val carbon = SparkSession
    +          .builder()
    +          .master(System.getProperty("spark.master"))
    +          .appName("CarbonSQLCLIDriver")
    +          .config("spark.sql.warehouse.dir", warehouse)
    +          .getOrCreateCarbonSession(storePath, storePath)
    +
    +      hiveContext = new CarbonContext(carbon)
    --- End diff --
   
    I guess it is not required to create context here, just use `carbon.sqlContext` is enough.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #623: [CARBONDATA-746] Add spark-sql CLI support ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/623
 
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1031/



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata issue #623: [CARBONDATA-746] Add spark-sql CLI support ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/623
 
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|

[GitHub] incubator-carbondata pull request #623: [CARBONDATA-746] Add spark-sql CLI s...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-carbondata/pull/623


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---