Skip to content

Commit 89ff143

Browse files
committed
Review fixes:
* ignore_unicode_prefix added * pyspark.sql.rst extended with avro * Note added to doc
1 parent dcd7b07 commit 89ff143

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

python/docs/pyspark.sql.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ pyspark.sql.functions module
2323
:members:
2424
:undoc-members:
2525

26+
pyspark.sql.avro.functions module
27+
---------------------------------
28+
.. automodule:: pyspark.sql.avro.functions
29+
:members:
30+
:undoc-members:
31+
2632
pyspark.sql.streaming module
2733
----------------------------
2834
.. automodule:: pyspark.sql.streaming

python/pyspark/sql/avro/functions.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@
2121

2222

2323
from pyspark import since, SparkContext
24+
from pyspark.rdd import ignore_unicode_prefix
2425
from pyspark.sql.column import Column, _to_java_column
2526
from pyspark.util import _print_missing_jar
2627

2728

29+
@ignore_unicode_prefix
2830
@since(3.0)
2931
def from_avro(data, jsonFormatSchema, options={}):
3032
"""
3133
Converts a binary column of avro format into its corresponding catalyst value. The specified
3234
schema must match the read data, otherwise the behavior is undefined: it may fail or return
3335
arbitrary result.
3436
35-
Avro is built-in but external data source module since Spark 2.4. Please deploy the application
36-
as per the deployment section of "Apache Avro Data Source Guide".
37+
Note: Avro is built-in but external data source module since Spark 2.4. Please deploy the
38+
application as per the deployment section of "Apache Avro Data Source Guide".
3739
3840
:param data: the binary column.
3941
:param jsonFormatSchema: the avro schema in JSON string format.
@@ -65,13 +67,14 @@ def from_avro(data, jsonFormatSchema, options={}):
6567
return Column(jc)
6668

6769

70+
@ignore_unicode_prefix
6871
@since(3.0)
6972
def to_avro(data):
7073
"""
7174
Converts a column into binary of avro format.
7275
73-
Avro is built-in but external data source module since Spark 2.4. Please deploy the application
74-
as per the deployment section of "Apache Avro Data Source Guide".
76+
Note: Avro is built-in but external data source module since Spark 2.4. Please deploy the
77+
application as per the deployment section of "Apache Avro Data Source Guide".
7578
7679
:param data: the data column.
7780

0 commit comments

Comments
 (0)