GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/14190
[SPARK-16536][SQL][PYSPARK] Expose `sql` in PySpark Shell
## What changes were proposed in this pull request?
This PR exposes `sql` in PySpark Shell like Scala/R Shells.
**Background**
```scala
scala> sql("select 1 a")
res0: org.apache.spark.sql.DataFrame = [a: int]
```
```r
> sql("select 1")
SparkDataFrame[1:int]
```
**Before**
```python
>>> sql("select 1 a")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'sql' is not defined
```
**After**
```python
>>> sql("select 1 a")
DataFrame[a: int]
```
## How was this patch tested?
Manual.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-16536
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14190.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 #14190
----
commit c5dc2355a5d9afbe98499767bf714a112f55d784
Author: Dongjoon Hyun <[email protected]>
Date: 2016-07-13T23:43:59Z
[SPARK-16536][SQL][PYSPARK] Expose `sql` in PySpark Shell
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]