2020-07-27 04:49:21 -04:00
|
|
|
.. 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.
|
|
|
|
|
|
|
|
|
|
|
|
=========
|
|
|
|
Spark SQL
|
|
|
|
=========
|
|
|
|
|
|
|
|
Core Classes
|
|
|
|
------------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
SparkSession
|
|
|
|
DataFrame
|
|
|
|
Column
|
|
|
|
Row
|
|
|
|
GroupedData
|
2020-08-28 02:09:06 -04:00
|
|
|
PandasCogroupedOps
|
2020-07-27 04:49:21 -04:00
|
|
|
DataFrameNaFunctions
|
|
|
|
DataFrameStatFunctions
|
|
|
|
Window
|
|
|
|
|
|
|
|
|
|
|
|
Spark Session APIs
|
|
|
|
------------------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
The entry point to programming Spark with the Dataset and DataFrame API.
|
|
|
|
To create a Spark session, you should use ``SparkSession.builder`` attribute.
|
|
|
|
See also :class:`SparkSession`.
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
SparkSession.builder.appName
|
|
|
|
SparkSession.builder.config
|
|
|
|
SparkSession.builder.enableHiveSupport
|
|
|
|
SparkSession.builder.getOrCreate
|
|
|
|
SparkSession.builder.master
|
|
|
|
SparkSession.catalog
|
|
|
|
SparkSession.conf
|
|
|
|
SparkSession.createDataFrame
|
|
|
|
SparkSession.getActiveSession
|
|
|
|
SparkSession.newSession
|
|
|
|
SparkSession.range
|
|
|
|
SparkSession.read
|
|
|
|
SparkSession.readStream
|
|
|
|
SparkSession.sparkContext
|
|
|
|
SparkSession.sql
|
|
|
|
SparkSession.stop
|
|
|
|
SparkSession.streams
|
|
|
|
SparkSession.table
|
|
|
|
SparkSession.udf
|
|
|
|
SparkSession.version
|
|
|
|
|
|
|
|
|
2021-02-13 10:32:55 -05:00
|
|
|
Configuration
|
|
|
|
-------------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql.conf
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
RuntimeConfig
|
|
|
|
|
|
|
|
|
2020-07-27 04:49:21 -04:00
|
|
|
Input and Output
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
DataFrameReader.csv
|
|
|
|
DataFrameReader.format
|
|
|
|
DataFrameReader.jdbc
|
|
|
|
DataFrameReader.json
|
|
|
|
DataFrameReader.load
|
|
|
|
DataFrameReader.option
|
|
|
|
DataFrameReader.options
|
|
|
|
DataFrameReader.orc
|
|
|
|
DataFrameReader.parquet
|
|
|
|
DataFrameReader.schema
|
|
|
|
DataFrameReader.table
|
|
|
|
DataFrameWriter.bucketBy
|
|
|
|
DataFrameWriter.csv
|
|
|
|
DataFrameWriter.format
|
|
|
|
DataFrameWriter.insertInto
|
|
|
|
DataFrameWriter.jdbc
|
|
|
|
DataFrameWriter.json
|
|
|
|
DataFrameWriter.mode
|
|
|
|
DataFrameWriter.option
|
|
|
|
DataFrameWriter.options
|
|
|
|
DataFrameWriter.orc
|
|
|
|
DataFrameWriter.parquet
|
|
|
|
DataFrameWriter.partitionBy
|
|
|
|
DataFrameWriter.save
|
|
|
|
DataFrameWriter.saveAsTable
|
|
|
|
DataFrameWriter.sortBy
|
|
|
|
DataFrameWriter.text
|
|
|
|
|
|
|
|
|
|
|
|
DataFrame APIs
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
DataFrame.agg
|
|
|
|
DataFrame.alias
|
|
|
|
DataFrame.approxQuantile
|
|
|
|
DataFrame.cache
|
|
|
|
DataFrame.checkpoint
|
|
|
|
DataFrame.coalesce
|
|
|
|
DataFrame.colRegex
|
|
|
|
DataFrame.collect
|
|
|
|
DataFrame.columns
|
|
|
|
DataFrame.corr
|
|
|
|
DataFrame.count
|
|
|
|
DataFrame.cov
|
|
|
|
DataFrame.createGlobalTempView
|
|
|
|
DataFrame.createOrReplaceGlobalTempView
|
|
|
|
DataFrame.createOrReplaceTempView
|
|
|
|
DataFrame.createTempView
|
|
|
|
DataFrame.crossJoin
|
|
|
|
DataFrame.crosstab
|
|
|
|
DataFrame.cube
|
|
|
|
DataFrame.describe
|
|
|
|
DataFrame.distinct
|
|
|
|
DataFrame.drop
|
|
|
|
DataFrame.dropDuplicates
|
|
|
|
DataFrame.drop_duplicates
|
|
|
|
DataFrame.dropna
|
|
|
|
DataFrame.dtypes
|
|
|
|
DataFrame.exceptAll
|
|
|
|
DataFrame.explain
|
|
|
|
DataFrame.fillna
|
|
|
|
DataFrame.filter
|
|
|
|
DataFrame.first
|
|
|
|
DataFrame.foreach
|
|
|
|
DataFrame.foreachPartition
|
|
|
|
DataFrame.freqItems
|
|
|
|
DataFrame.groupBy
|
|
|
|
DataFrame.head
|
|
|
|
DataFrame.hint
|
|
|
|
DataFrame.inputFiles
|
|
|
|
DataFrame.intersect
|
|
|
|
DataFrame.intersectAll
|
|
|
|
DataFrame.isLocal
|
|
|
|
DataFrame.isStreaming
|
|
|
|
DataFrame.join
|
|
|
|
DataFrame.limit
|
|
|
|
DataFrame.localCheckpoint
|
|
|
|
DataFrame.mapInPandas
|
|
|
|
DataFrame.na
|
|
|
|
DataFrame.orderBy
|
|
|
|
DataFrame.persist
|
|
|
|
DataFrame.printSchema
|
|
|
|
DataFrame.randomSplit
|
|
|
|
DataFrame.rdd
|
|
|
|
DataFrame.registerTempTable
|
|
|
|
DataFrame.repartition
|
|
|
|
DataFrame.repartitionByRange
|
|
|
|
DataFrame.replace
|
|
|
|
DataFrame.rollup
|
|
|
|
DataFrame.sameSemantics
|
|
|
|
DataFrame.sample
|
|
|
|
DataFrame.sampleBy
|
|
|
|
DataFrame.schema
|
|
|
|
DataFrame.select
|
|
|
|
DataFrame.selectExpr
|
|
|
|
DataFrame.semanticHash
|
|
|
|
DataFrame.show
|
|
|
|
DataFrame.sort
|
|
|
|
DataFrame.sortWithinPartitions
|
|
|
|
DataFrame.stat
|
|
|
|
DataFrame.storageLevel
|
|
|
|
DataFrame.subtract
|
|
|
|
DataFrame.summary
|
|
|
|
DataFrame.tail
|
|
|
|
DataFrame.take
|
|
|
|
DataFrame.toDF
|
|
|
|
DataFrame.toJSON
|
|
|
|
DataFrame.toLocalIterator
|
|
|
|
DataFrame.toPandas
|
|
|
|
DataFrame.transform
|
|
|
|
DataFrame.union
|
|
|
|
DataFrame.unionAll
|
|
|
|
DataFrame.unionByName
|
|
|
|
DataFrame.unpersist
|
|
|
|
DataFrame.where
|
|
|
|
DataFrame.withColumn
|
|
|
|
DataFrame.withColumnRenamed
|
|
|
|
DataFrame.withWatermark
|
|
|
|
DataFrame.write
|
|
|
|
DataFrame.writeStream
|
|
|
|
DataFrame.writeTo
|
|
|
|
DataFrameNaFunctions.drop
|
|
|
|
DataFrameNaFunctions.fill
|
|
|
|
DataFrameNaFunctions.replace
|
|
|
|
DataFrameStatFunctions.approxQuantile
|
|
|
|
DataFrameStatFunctions.corr
|
|
|
|
DataFrameStatFunctions.cov
|
|
|
|
DataFrameStatFunctions.crosstab
|
|
|
|
DataFrameStatFunctions.freqItems
|
|
|
|
DataFrameStatFunctions.sampleBy
|
|
|
|
|
2020-10-26 20:52:09 -04:00
|
|
|
Column APIs
|
|
|
|
-----------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
Column.alias
|
|
|
|
Column.asc
|
|
|
|
Column.asc_nulls_first
|
|
|
|
Column.asc_nulls_last
|
|
|
|
Column.astype
|
|
|
|
Column.between
|
|
|
|
Column.bitwiseAND
|
|
|
|
Column.bitwiseOR
|
|
|
|
Column.bitwiseXOR
|
|
|
|
Column.cast
|
|
|
|
Column.contains
|
|
|
|
Column.desc
|
|
|
|
Column.desc_nulls_first
|
|
|
|
Column.desc_nulls_last
|
|
|
|
Column.dropFields
|
|
|
|
Column.endswith
|
|
|
|
Column.eqNullSafe
|
|
|
|
Column.getField
|
|
|
|
Column.getItem
|
|
|
|
Column.isNotNull
|
|
|
|
Column.isNull
|
|
|
|
Column.isin
|
|
|
|
Column.like
|
|
|
|
Column.name
|
|
|
|
Column.otherwise
|
|
|
|
Column.over
|
|
|
|
Column.rlike
|
|
|
|
Column.startswith
|
|
|
|
Column.substr
|
|
|
|
Column.when
|
|
|
|
Column.withField
|
2020-07-27 04:49:21 -04:00
|
|
|
|
|
|
|
Data Types
|
|
|
|
----------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql.types
|
|
|
|
|
|
|
|
.. autosummary::
|
2020-10-27 01:03:57 -04:00
|
|
|
:template: autosummary/class_with_docs.rst
|
2020-07-27 04:49:21 -04:00
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
ArrayType
|
|
|
|
BinaryType
|
|
|
|
BooleanType
|
|
|
|
ByteType
|
|
|
|
DataType
|
|
|
|
DateType
|
|
|
|
DecimalType
|
|
|
|
DoubleType
|
|
|
|
FloatType
|
|
|
|
IntegerType
|
|
|
|
LongType
|
|
|
|
MapType
|
|
|
|
NullType
|
|
|
|
ShortType
|
|
|
|
StringType
|
|
|
|
StructField
|
|
|
|
StructType
|
|
|
|
TimestampType
|
|
|
|
|
|
|
|
|
|
|
|
Row
|
|
|
|
---
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
Row.asDict
|
|
|
|
|
|
|
|
|
|
|
|
Functions
|
|
|
|
---------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql.functions
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
abs
|
|
|
|
acos
|
2020-11-26 21:00:09 -05:00
|
|
|
acosh
|
2020-07-27 04:49:21 -04:00
|
|
|
add_months
|
|
|
|
aggregate
|
|
|
|
approxCountDistinct
|
|
|
|
approx_count_distinct
|
|
|
|
array
|
|
|
|
array_contains
|
|
|
|
array_distinct
|
|
|
|
array_except
|
|
|
|
array_intersect
|
|
|
|
array_join
|
|
|
|
array_max
|
|
|
|
array_min
|
|
|
|
array_position
|
|
|
|
array_remove
|
|
|
|
array_repeat
|
|
|
|
array_sort
|
|
|
|
array_union
|
|
|
|
arrays_overlap
|
|
|
|
arrays_zip
|
|
|
|
asc
|
|
|
|
asc_nulls_first
|
|
|
|
asc_nulls_last
|
|
|
|
ascii
|
|
|
|
asin
|
2020-11-26 21:00:09 -05:00
|
|
|
asinh
|
[SPARK-32793][SQL] Add raise_error function, adds error message parameter to assert_true
## What changes were proposed in this pull request?
Adds a SQL function `raise_error` which underlies the refactored `assert_true` function. `assert_true` now also (optionally) accepts a custom error message field.
`raise_error` is exposed in SQL, Python, Scala, and R.
`assert_true` was previously only exposed in SQL; it is now also exposed in Python, Scala, and R.
### Why are the changes needed?
Improves usability of `assert_true` by clarifying error messaging, and adds the useful helper function `raise_error`.
### Does this PR introduce _any_ user-facing change?
Yes:
- Adds `raise_error` function to the SQL, Python, Scala, and R APIs.
- Adds `assert_true` function to the SQL, Python and R APIs.
### How was this patch tested?
Adds unit tests in SQL, Python, Scala, and R for `assert_true` and `raise_error`.
Closes #29947 from karenfeng/spark-32793.
Lead-authored-by: Karen Feng <karen.feng@databricks.com>
Co-authored-by: Hyukjin Kwon <gurwls223@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
2020-10-07 23:05:39 -04:00
|
|
|
assert_true
|
2020-07-27 04:49:21 -04:00
|
|
|
atan
|
2020-11-26 21:00:09 -05:00
|
|
|
atanh
|
2020-07-27 04:49:21 -04:00
|
|
|
atan2
|
|
|
|
avg
|
|
|
|
base64
|
|
|
|
bin
|
2021-02-01 19:29:40 -05:00
|
|
|
bitwise_not
|
2020-07-27 04:49:21 -04:00
|
|
|
bitwiseNOT
|
|
|
|
broadcast
|
|
|
|
bround
|
|
|
|
bucket
|
|
|
|
cbrt
|
|
|
|
ceil
|
|
|
|
coalesce
|
|
|
|
col
|
|
|
|
collect_list
|
|
|
|
collect_set
|
|
|
|
column
|
|
|
|
concat
|
|
|
|
concat_ws
|
|
|
|
conv
|
|
|
|
corr
|
|
|
|
cos
|
|
|
|
cosh
|
|
|
|
count
|
2021-02-01 19:29:40 -05:00
|
|
|
count_distinct
|
2020-07-27 04:49:21 -04:00
|
|
|
countDistinct
|
|
|
|
covar_pop
|
|
|
|
covar_samp
|
|
|
|
crc32
|
|
|
|
create_map
|
|
|
|
cume_dist
|
|
|
|
current_date
|
|
|
|
current_timestamp
|
|
|
|
date_add
|
|
|
|
date_format
|
|
|
|
date_sub
|
|
|
|
date_trunc
|
|
|
|
datediff
|
|
|
|
dayofmonth
|
|
|
|
dayofweek
|
|
|
|
dayofyear
|
|
|
|
days
|
|
|
|
decode
|
|
|
|
degrees
|
|
|
|
dense_rank
|
|
|
|
desc
|
|
|
|
desc_nulls_first
|
|
|
|
desc_nulls_last
|
|
|
|
element_at
|
|
|
|
encode
|
|
|
|
exists
|
|
|
|
exp
|
|
|
|
explode
|
|
|
|
explode_outer
|
|
|
|
expm1
|
|
|
|
expr
|
|
|
|
factorial
|
|
|
|
filter
|
|
|
|
first
|
|
|
|
flatten
|
|
|
|
floor
|
|
|
|
forall
|
|
|
|
format_number
|
|
|
|
format_string
|
|
|
|
from_csv
|
|
|
|
from_json
|
|
|
|
from_unixtime
|
|
|
|
from_utc_timestamp
|
|
|
|
get_json_object
|
|
|
|
greatest
|
|
|
|
grouping
|
|
|
|
grouping_id
|
|
|
|
hash
|
|
|
|
hex
|
|
|
|
hour
|
|
|
|
hours
|
|
|
|
hypot
|
|
|
|
initcap
|
|
|
|
input_file_name
|
|
|
|
instr
|
|
|
|
isnan
|
|
|
|
isnull
|
|
|
|
json_tuple
|
|
|
|
kurtosis
|
|
|
|
lag
|
|
|
|
last
|
|
|
|
last_day
|
|
|
|
lead
|
|
|
|
least
|
|
|
|
length
|
|
|
|
levenshtein
|
|
|
|
lit
|
|
|
|
locate
|
|
|
|
log
|
|
|
|
log10
|
|
|
|
log1p
|
|
|
|
log2
|
|
|
|
lower
|
|
|
|
lpad
|
|
|
|
ltrim
|
|
|
|
map_concat
|
|
|
|
map_entries
|
|
|
|
map_filter
|
|
|
|
map_from_arrays
|
|
|
|
map_from_entries
|
|
|
|
map_keys
|
|
|
|
map_values
|
|
|
|
map_zip_with
|
|
|
|
max
|
|
|
|
md5
|
|
|
|
mean
|
|
|
|
min
|
|
|
|
minute
|
|
|
|
monotonically_increasing_id
|
|
|
|
month
|
|
|
|
months
|
|
|
|
months_between
|
|
|
|
nanvl
|
|
|
|
next_day
|
2020-09-29 01:14:28 -04:00
|
|
|
nth_value
|
2020-07-27 04:49:21 -04:00
|
|
|
ntile
|
|
|
|
overlay
|
|
|
|
pandas_udf
|
|
|
|
percent_rank
|
|
|
|
percentile_approx
|
|
|
|
posexplode
|
|
|
|
posexplode_outer
|
|
|
|
pow
|
[SPARK-33678][SQL] Product aggregation function
### Why is this change being proposed?
This patch adds support for a new "product" aggregation function in `sql.functions` which multiplies-together all values in an aggregation group.
This is likely to be useful in statistical applications which involve combining probabilities, or financial applications that involve combining cumulative interest rates, but is also a versatile mathematical operation of similar status to `sum` or `stddev`. Other users [have noted](https://stackoverflow.com/questions/52991640/cumulative-product-in-spark) the absence of such a function in current releases of Spark.
This function is both much more concise than an expression of the form `exp(sum(log(...)))`, and avoids awkward edge-cases associated with some values being zero or negative, as well as being less computationally costly.
### Does this PR introduce _any_ user-facing change?
No - only adds new function.
### How was this patch tested?
Built-in tests have been added for the new `catalyst.expressions.aggregate.Product` class and its invocation via the (scala) `sql.functions.product` function. The latter, and the PySpark wrapper have also been manually tested in spark-shell and pyspark sessions. The SparkR wrapper is currently untested, and may need separate validation (I'm not an "R" user myself).
An illustration of the new functionality, within PySpark is as follows:
```
import pyspark.sql.functions as pf, pyspark.sql.window as pw
df = sqlContext.range(1, 17).toDF("x")
win = pw.Window.partitionBy(pf.lit(1)).orderBy(pf.col("x"))
df.withColumn("factorial", pf.product("x").over(win)).show(20, False)
+---+---------------+
|x |factorial |
+---+---------------+
|1 |1.0 |
|2 |2.0 |
|3 |6.0 |
|4 |24.0 |
|5 |120.0 |
|6 |720.0 |
|7 |5040.0 |
|8 |40320.0 |
|9 |362880.0 |
|10 |3628800.0 |
|11 |3.99168E7 |
|12 |4.790016E8 |
|13 |6.2270208E9 |
|14 |8.71782912E10 |
|15 |1.307674368E12 |
|16 |2.0922789888E13|
+---+---------------+
```
Closes #30745 from rwpenney/feature/agg-product.
Lead-authored-by: Richard Penney <rwp@rwpenney.uk>
Co-authored-by: Richard Penney <rwpenney@users.noreply.github.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
2021-03-02 02:51:07 -05:00
|
|
|
product
|
2020-07-27 04:49:21 -04:00
|
|
|
quarter
|
|
|
|
radians
|
[SPARK-32793][SQL] Add raise_error function, adds error message parameter to assert_true
## What changes were proposed in this pull request?
Adds a SQL function `raise_error` which underlies the refactored `assert_true` function. `assert_true` now also (optionally) accepts a custom error message field.
`raise_error` is exposed in SQL, Python, Scala, and R.
`assert_true` was previously only exposed in SQL; it is now also exposed in Python, Scala, and R.
### Why are the changes needed?
Improves usability of `assert_true` by clarifying error messaging, and adds the useful helper function `raise_error`.
### Does this PR introduce _any_ user-facing change?
Yes:
- Adds `raise_error` function to the SQL, Python, Scala, and R APIs.
- Adds `assert_true` function to the SQL, Python and R APIs.
### How was this patch tested?
Adds unit tests in SQL, Python, Scala, and R for `assert_true` and `raise_error`.
Closes #29947 from karenfeng/spark-32793.
Lead-authored-by: Karen Feng <karen.feng@databricks.com>
Co-authored-by: Hyukjin Kwon <gurwls223@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
2020-10-07 23:05:39 -04:00
|
|
|
raise_error
|
2020-07-27 04:49:21 -04:00
|
|
|
rand
|
|
|
|
randn
|
|
|
|
rank
|
|
|
|
regexp_extract
|
|
|
|
regexp_replace
|
|
|
|
repeat
|
|
|
|
reverse
|
|
|
|
rint
|
|
|
|
round
|
|
|
|
row_number
|
|
|
|
rpad
|
|
|
|
rtrim
|
|
|
|
schema_of_csv
|
|
|
|
schema_of_json
|
|
|
|
second
|
2021-05-19 07:07:28 -04:00
|
|
|
sentences
|
2020-07-27 04:49:21 -04:00
|
|
|
sequence
|
|
|
|
sha1
|
|
|
|
sha2
|
2021-02-01 19:29:40 -05:00
|
|
|
shiftleft
|
|
|
|
shiftright
|
|
|
|
shiftrightunsigned
|
2020-07-27 04:49:21 -04:00
|
|
|
shuffle
|
|
|
|
signum
|
|
|
|
sin
|
|
|
|
sinh
|
|
|
|
size
|
|
|
|
skewness
|
|
|
|
slice
|
|
|
|
sort_array
|
|
|
|
soundex
|
|
|
|
spark_partition_id
|
|
|
|
split
|
|
|
|
sqrt
|
|
|
|
stddev
|
|
|
|
stddev_pop
|
|
|
|
stddev_samp
|
|
|
|
struct
|
|
|
|
substring
|
|
|
|
substring_index
|
|
|
|
sum
|
2021-02-01 19:29:40 -05:00
|
|
|
sum_distinct
|
2020-07-27 04:49:21 -04:00
|
|
|
sumDistinct
|
|
|
|
tan
|
|
|
|
tanh
|
|
|
|
timestamp_seconds
|
|
|
|
toDegrees
|
|
|
|
toRadians
|
|
|
|
to_csv
|
|
|
|
to_date
|
|
|
|
to_json
|
|
|
|
to_timestamp
|
|
|
|
to_utc_timestamp
|
|
|
|
transform
|
|
|
|
transform_keys
|
|
|
|
transform_values
|
|
|
|
translate
|
|
|
|
trim
|
|
|
|
trunc
|
|
|
|
udf
|
|
|
|
unbase64
|
|
|
|
unhex
|
|
|
|
unix_timestamp
|
|
|
|
upper
|
|
|
|
var_pop
|
|
|
|
var_samp
|
|
|
|
variance
|
|
|
|
weekofyear
|
|
|
|
when
|
|
|
|
window
|
|
|
|
xxhash64
|
|
|
|
year
|
|
|
|
years
|
|
|
|
zip_with
|
|
|
|
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql.avro.functions
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
from_avro
|
|
|
|
to_avro
|
|
|
|
|
|
|
|
Window
|
|
|
|
------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
Window.currentRow
|
|
|
|
Window.orderBy
|
|
|
|
Window.partitionBy
|
|
|
|
Window.rangeBetween
|
|
|
|
Window.rowsBetween
|
|
|
|
Window.unboundedFollowing
|
|
|
|
Window.unboundedPreceding
|
|
|
|
WindowSpec.orderBy
|
|
|
|
WindowSpec.partitionBy
|
|
|
|
WindowSpec.rangeBetween
|
|
|
|
WindowSpec.rowsBetween
|
|
|
|
|
|
|
|
Grouping
|
|
|
|
--------
|
|
|
|
|
|
|
|
.. currentmodule:: pyspark.sql
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: api/
|
|
|
|
|
|
|
|
GroupedData.agg
|
|
|
|
GroupedData.apply
|
|
|
|
GroupedData.applyInPandas
|
|
|
|
GroupedData.avg
|
|
|
|
GroupedData.cogroup
|
|
|
|
GroupedData.count
|
|
|
|
GroupedData.max
|
|
|
|
GroupedData.mean
|
|
|
|
GroupedData.min
|
|
|
|
GroupedData.pivot
|
|
|
|
GroupedData.sum
|
2020-08-28 02:09:06 -04:00
|
|
|
PandasCogroupedOps.applyInPandas
|