Skip to content

Conversation

@liancheng
Copy link
Contributor

This PR adds a new option spark.sql.hive.thriftServer.singleSession for disabling multi-session support in the Thrift server.

Note that this option is added as a Spark configuration (retrieved from SparkConf) rather than Spark SQL configuration (retrieved from SQLConf). This is because all SQL configurations are session-ized. Since multi-session support is by default on, no JDBC connection can modify global configurations like the newly added one.

@liancheng
Copy link
Contributor Author

Another approach for this problem is to have "global" options. For example, SET -g key=value sets key to value for all sessions. This adds a new concept and requires more work, but seems to be cleaner and in general more useful. What need to be done are:

  1. Add a new syntax SET -g
  2. Each HiveContext should remember its parent HiveContext so that we can retrieve the "root" one.
  3. When a global option is set, it's always set in the root HiveContext.

Another benefit of this approach is that we don't need to restart the Thrift server to switch between single-/multi-session modes.

@marmbrus @davies @yhuai Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that we only introduce a command line option here? (Not sure how the JDBC server is used).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like --single-session? The benefit of SparkConf option is that users can add it in spark-defaults.conf.

Command line options of start-thriftserver.sh are parsed by both SparkSubmit and HiveServer2.ServerOptionsProcessor. The latter isn't extensible. One option is to add a --single-session option in SparkSubmit and make a synonymous of --conf spark.sql.hive.thriftServer.singleSession=true. However, this option doesn't seem to be general enough to be added in SparkSubmit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks!

@davies
Copy link
Contributor

davies commented Nov 16, 2015

@liancheng I like the this approach more, all global configurations should be placed in SparkConf (could be override in current session)

@davies
Copy link
Contributor

davies commented Nov 16, 2015

@liancheng This option is only for backward compatibility purpose, could we document it somewhere? We should also mention this change (isolated sessions) in release note.

@liancheng
Copy link
Contributor Author

Yeah, I'll add it to the programming guide.

@marmbrus
Copy link
Contributor

+1 to this approach instead of adding a new concept.

@SparkQA
Copy link

SparkQA commented Nov 16, 2015

Test build #46000 has finished for PR 9740 at commit eeeb194.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@davies
Copy link
Contributor

davies commented Nov 16, 2015

@liancheng Will you update the programming guide in this PR?

@liancheng
Copy link
Contributor Author

Yeah, updating this one soon.

@SparkQA
Copy link

SparkQA commented Nov 17, 2015

Test build #46081 has finished for PR 9740 at commit 8b70477.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@marmbrus
Copy link
Contributor

Merging to master and 1.6.

asfgit pushed a commit that referenced this pull request Nov 17, 2015
…server

This PR adds a new option `spark.sql.hive.thriftServer.singleSession` for disabling multi-session support in the Thrift server.

Note that this option is added as a Spark configuration (retrieved from `SparkConf`) rather than Spark SQL configuration (retrieved from `SQLConf`). This is because all SQL configurations are session-ized. Since multi-session support is by default on, no JDBC connection can modify global configurations like the newly added one.

Author: Cheng Lian <[email protected]>

Closes #9740 from liancheng/spark-11089.single-session-option.

(cherry picked from commit 7b1407c)
Signed-off-by: Michael Armbrust <[email protected]>
@asfgit asfgit closed this in 7b1407c Nov 17, 2015
@liancheng liancheng deleted the spark-11089.single-session-option branch November 18, 2015 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants