Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
2c5a06ca
Commit
2c5a06ca
authored
9 years ago
by
Reynold Xin
Browse files
Options
Downloads
Patches
Plain Diff
Update documentation for [SPARK-7980] [SQL] Support SQLContext.range(end)
parent
939e4f3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/pyspark/sql/context.py
+2
-0
2 additions, 0 deletions
python/pyspark/sql/context.py
sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala
+10
-10
10 additions, 10 deletions
...core/src/main/scala/org/apache/spark/sql/SQLContext.scala
with
12 additions
and
10 deletions
python/pyspark/sql/context.py
+
2
−
0
View file @
2c5a06ca
...
...
@@ -146,6 +146,8 @@ class SQLContext(object):
>>>
sqlContext
.
range
(
1
,
7
,
2
).
collect
()
[
Row
(
id
=
1
),
Row
(
id
=
3
),
Row
(
id
=
5
)]
If only one argument is specified, it will be used as the end value.
>>>
sqlContext
.
range
(
3
).
collect
()
[
Row
(
id
=
0
),
Row
(
id
=
1
),
Row
(
id
=
2
)]
"""
...
...
This diff is collapsed.
Click to expand it.
sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala
+
10
−
10
View file @
2c5a06ca
...
...
@@ -705,33 +705,33 @@ class SQLContext(@transient val sparkContext: SparkContext)
/**
* :: Experimental ::
* Creates a [[DataFrame]] with a single [[LongType]] column named `id`, containing elements
* in an range from
`start`
to `end`(exclusive) with step value 1.
* in an range from
0
to `end`
(exclusive) with step value 1.
*
* @since 1.4.
0
* @since 1.4.
1
* @group dataframe
*/
@Experimental
def
range
(
start
:
Long
,
end
:
Long
)
:
DataFrame
=
{
createDataFrame
(
sparkContext
.
range
(
start
,
end
).
map
(
Row
(
_
)),
StructType
(
StructField
(
"id"
,
LongType
,
nullable
=
false
)
::
Nil
))
}
def
range
(
end
:
Long
)
:
DataFrame
=
range
(
0
,
end
)
/**
* :: Experimental ::
* Creates a [[DataFrame]] with a single [[LongType]] column named `id`, containing elements
* in an range from
0
to `end`(exclusive) with step value 1.
* in an range from
`start`
to `end`
(exclusive) with step value 1.
*
* @since 1.4.0
* @group dataframe
*/
@Experimental
def
range
(
end
:
Long
)
:
DataFrame
=
range
(
0
,
end
)
def
range
(
start
:
Long
,
end
:
Long
)
:
DataFrame
=
{
createDataFrame
(
sparkContext
.
range
(
start
,
end
).
map
(
Row
(
_
)),
StructType
(
StructField
(
"id"
,
LongType
,
nullable
=
false
)
::
Nil
))
}
/**
* :: Experimental ::
* Creates a [[DataFrame]] with a single [[LongType]] column named `id`, containing elements
* in an range from `start` to `end`(exclusive) with an step value, with partition number
* in an range from `start` to `end`
(exclusive) with an step value, with partition number
* specified.
*
* @since 1.4.0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment