-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIVY-19. Add Spark SQL support #148
base: master
Are you sure you want to change the base?
Conversation
Please update this pr to point to the livy bug: LIVY-19 |
Implementing a Livy SparkSql Intrepreter. This leaves the SparkInterpreter untouched and makes confines most of the changes to the livy-repl component. Task-Url: https://issues.cloudera.org/browse/LIVY-19
I updated the pull request description and reworded the commits to link to LIVY-19. |
Codecov Report@@ Coverage Diff @@
## master #148 +/- ##
===========================================
- Coverage 71.53% 60.83% -10.71%
===========================================
Files 91 73 -18
Lines 4697 3965 -732
Branches 811 651 -160
===========================================
- Hits 3360 2412 -948
- Misses 861 1243 +382
+ Partials 476 310 -166
Continue to review full report at Codecov.
|
override def close(): Unit = synchronized { | ||
if (hiveContext != null) { | ||
// clean up and close hive context here | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe set hiveContext as null
Another comment is that maybe we can reuse the SparkContext in SparkInterpreter. We can just add sql support in rest api. e.g.
So that for tools like hue and zeppelin, different paragraph can share data easily as they share the same SparkContext. |
Hi @meisam, Before we can even look at this patch, we need a signed ICLA and, if it applies, a signed CCLA from your employer. Please check the wiki: https://github.com/cloudera/livy/wiki/Contributing-to-Livy |
Without having looked at the code, I like that idea. |
@vanzin |
It's at the link I posted above. |
@zjffdu I was thinking more along these lines
This keeps |
@meisam That make sense. |
@meisam Please print, sign and email to [email protected] both the ICLA: |
39a5162
to
2d6e026
Compare
@ksakellis I mailed the ICLA and CCLA to [email protected] last week. |
Livy interpreters support 2 magics: To run a SQL statement, user can just |
Before that, I think we should implement sparkcontext sharing across language #178 , because it is very often user want to access table that is created in spark/pyspark/sparkr interpreter. |
Sorry let me clarify myself. I'm purposing to add |
@tc0312 How would a %sql magic work with SQL code that spans over multiple lines? Or queries that contain comments in them? |
It's up to us to define how %sql magic works. We can define it in a way that it works with multiple lines and comments. |
@tc0312 I guess I should clarify myself. My question is, which approach is easier to implement? Having a %sql magic? Or having a separate SQL interpreter? |
@tc0312 Actually there's a third approach that @zjffdu suggested: '{"sql":"select * from table_1"}' |
I think they are both easy to implement. I would prefer a magic approach because Livy already has magics and cloudera/hue is using it. |
What was the final result of this issue? |
It needs more careful design in https://issues.cloudera.org/browse/LIVY-194 |
Hi @zjffdu, Enabling shared spark context across scala/python/R is next phase and it may take sometime. But, when we support Scala, Python and R interpreters already, can we also add SQL interpreter? If we have direct SQL interpreter enabled, then it will be very easy for users to submit SQL statements directly to interpreter instead of wrapping it up with HiveContext (<2.0) or Spark Session (>2.0) or using SQL magic everytime. Please let me know your thoughts. Prabhu |
LIVY-19. Add Spark SQL support
This leaves the SparkInterpreter untouched and confines most of the changes to the livy-repl component.
The SparkSqlInterpreter is based on SparkInterpreter and needs to be polished.
Your feedback is really appreciated.
Task-Url: https://issues.cloudera.org/browse/LIVY-19