You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2023/01/14 14:43:29 UTC
[GitHub] [spark] Kimahriman opened a new pull request, #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Kimahriman opened a new pull request, #39572:
URL: https://github.com/apache/spark/pull/39572
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
Adds a new config that uses the `LargeUtf8` and `LargeBinary` arrow types for arrow-based UDF operations. These arrow types make arrow use `LargeVarCharVector` and `LargeVarBinaryVector` instead of the regular `VarCharVector` and `VarBinaryVector` respectively. This config is disabled by default to maintain the current behavior.
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
`VarCharVector` and `VarBinaryVector` have a size limit of 2 GiB for a single vector. This is because they use 4 byte integers to track the offsets of each value in the vector. During certain operations, it is possible to hit this limit. The most affected way that we've run into this is during a `applyInPandas` operation, since the entire group is sent as a single RecordBatch, and there is no way to chunk up any smaller than the entire group. However, other map and UDF operations can benefit as well without having to find the right records per batch to not hit this limit.
The large vector types use an 8 byte long to track value offsets, removing the 2 GiB total size limit.
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
Adds an option that can help users get around what currently results in `IndexOutOfBoundsException`, though this exception being raised is a bug that was fixed in Arrow and it should actually be a `OversizedAllocationException` in the next release which suggests using the large variable width types instead.
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
A few new tests are added. I also enabled the setting by default for a full CI run and all existing tests passed. I can add more tests if needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Kimahriman commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by GitBox <gi...@apache.org>.
Kimahriman commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1383195213
Also while figuring out that benchmark, I think the limit is actually 1 GiB per vector and not 2. Because Integer.MAX_VALUE = 2 GiB - 1, and the vector doubles in size whenever it needs to grow, once you go past 1 GiB it tries to double to 2 GiB which is more than 2 GiB - 1, so the doubling fails whenever it tries to grow beyond 1 GiB.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #39572:
URL: https://github.com/apache/spark/pull/39572#discussion_r1227660209
##########
python/pyspark/sql/tests/pandas/test_pandas_map.py:
##########
@@ -68,6 +68,23 @@ def func(iterator):
expected = df.collect()
self.assertEqual(actual, expected)
+ def test_large_variable_types(self):
+ with self.sql_conf({"spark.sql.execution.arrow.useLargeVarTypes": True}):
+
+ def func(iterator):
+ for pdf in iterator:
+ assert isinstance(pdf, pd.DataFrame)
+ yield pdf
Review Comment:
Hm, just noticed that we missed to fix `to_arrow_type` here. Meaning that JVM -> Python will use `useLargeVarTypes` but Python -> JVM will use use `useLargeVarTypes`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1383312668
cc @BryanCutler @viirya @ueshin FYI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Kimahriman commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by GitBox <gi...@apache.org>.
Kimahriman commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1383183817
Threw together:
```
@F.udf
def func():
return uuid.uuid4().hex
df = spark.range(67108864).select(func().alias('uuid')).repartition(1)
df.explain()
df.cache()
df.count()
def pandas_func(pdfs: Iterator[pd.DataFrame]):
total_memory = 0
for pdf in pdfs:
total_memory += pdf.memory_usage(deep=True).sum()
yield pdf
print(f'Total memory passed to pandas: {total_memory}')
def arrow_func(batches: Iterator[pa.RecordBatch]):
total_memory = 0
for batch in batches:
print(batch.schema)
total_memory += batch.nbytes
yield batch
print(f'Total memory passed to arrow: {total_memory}')
def test_pandas(df: DataFrame):
start = datetime.now()
df = df.mapInPandas(pandas_func, 'uuid string')
# df.explain()
df.count()
print(f'Took pandas {datetime.now() - start}')
def test_arrow(df: DataFrame):
start = datetime.now()
df = df.mapInArrow(arrow_func, 'uuid string')
# df.explain()
df.count()
print(f'Took arrow {datetime.now() - start}')
spark.conf.set('spark.sql.execution.arrow.maxRecordsPerBatch', str(int(67108864 / 2)))
print('Regular variable width types')
test_pandas(df)
test_arrow(df)
spark.conf.set('spark.sql.execution.arrow.useLargeVarTypes', 'true')
print()
print('Large variable width types')
test_pandas(df)
test_arrow(df)
```
Basically creates 2 GiB of UUIDs (just wanted random strings), caches it so we don't need to worry about UUID performance, then single partition mapInPandas and mapInArrow to see speed and memory usage.
Output:
```
Regular variable width types
Total memory passed to pandas: 5972689152
Took pandas 0:01:04.841046
uuid: string
uuid: string
Total memory passed to arrow: 2415919104
Took arrow 0:00:18.196022
Large variable width types
Total memory passed to pandas: 5972689152
Took pandas 0:01:03.925820
uuid: large_string
uuid: large_string
Total memory passed to arrow: 2684354560
Took arrow 0:00:16.619154
```
Execution times seem equivalent (with large types slightly faster somehow), and memory usage is the same once it gets converted to pandas as would be expected, and is slightly higher directly in arrow also as expected. In fact that memory difference is exactly 4 extra bytes for offsets * 67108864 rows
Are you considering just using the large types everywhere by default?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Kimahriman commented on a diff in pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "Kimahriman (via GitHub)" <gi...@apache.org>.
Kimahriman commented on code in PR #39572:
URL: https://github.com/apache/spark/pull/39572#discussion_r1203932635
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -2825,6 +2825,16 @@ object SQLConf {
.intConf
.createWithDefault(10000)
+ val ARROW_EXECUTION_USE_LARGE_VAR_TYPES =
+ buildConf("spark.sql.execution.arrow.useLargeVarTypes")
+ .doc("When using Apache Arrow, use large variable width vectors for string and binary " +
+ "types. Regular string and binary types have a 2GiB limit for a column in a single " +
+ "record batch. Large variable types remove this limitation at the cost of higher memory " +
+ "usage per value.")
+ .version("3.4.0")
Review Comment:
Updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #39572:
URL: https://github.com/apache/spark/pull/39572#discussion_r1227753911
##########
python/pyspark/sql/tests/pandas/test_pandas_map.py:
##########
@@ -68,6 +68,23 @@ def func(iterator):
expected = df.collect()
self.assertEqual(actual, expected)
+ def test_large_variable_types(self):
+ with self.sql_conf({"spark.sql.execution.arrow.useLargeVarTypes": True}):
+
+ def func(iterator):
+ for pdf in iterator:
+ assert isinstance(pdf, pd.DataFrame)
+ yield pdf
Review Comment:
Made a followup at https://github.com/apache/spark/pull/41569
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1566316143
Merged to master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Kimahriman commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by GitBox <gi...@apache.org>.
Kimahriman commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1382774105
cc @HyukjinKwon
Wasn't sure whether to do the config based approach or just change everything to use it by default. I'm not sure if there's any other downsides other than the extra 4 bytes per value in the vector.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Kimahriman commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "Kimahriman (via GitHub)" <gi...@apache.org>.
Kimahriman commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1418087109
Created https://issues.apache.org/jira/browse/SPARK-42347 to track the arrow issue as a potential 3.4.0 blocker
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Kimahriman commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by GitBox <gi...@apache.org>.
Kimahriman commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1383163357
Any specific way I should try to benchmark? Just using the Scala vectors directly or some mapInArrows/mapInPandas test?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #39572:
URL: https://github.com/apache/spark/pull/39572#discussion_r1203896540
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -2825,6 +2825,16 @@ object SQLConf {
.intConf
.createWithDefault(10000)
+ val ARROW_EXECUTION_USE_LARGE_VAR_TYPES =
+ buildConf("spark.sql.execution.arrow.useLargeVarTypes")
+ .doc("When using Apache Arrow, use large variable width vectors for string and binary " +
+ "types. Regular string and binary types have a 2GiB limit for a column in a single " +
+ "record batch. Large variable types remove this limitation at the cost of higher memory " +
+ "usage per value.")
+ .version("3.4.0")
Review Comment:
maybe 3.5.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #39572:
URL: https://github.com/apache/spark/pull/39572#discussion_r1227732519
##########
python/pyspark/sql/tests/pandas/test_pandas_map.py:
##########
@@ -68,6 +68,23 @@ def func(iterator):
expected = df.collect()
self.assertEqual(actual, expected)
+ def test_large_variable_types(self):
+ with self.sql_conf({"spark.sql.execution.arrow.useLargeVarTypes": True}):
+
+ def func(iterator):
+ for pdf in iterator:
+ assert isinstance(pdf, pd.DataFrame)
+ yield pdf
Review Comment:
Let me make a followup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #39572:
URL: https://github.com/apache/spark/pull/39572#discussion_r1227660633
##########
python/pyspark/sql/tests/pandas/test_pandas_map.py:
##########
@@ -68,6 +68,23 @@ def func(iterator):
expected = df.collect()
self.assertEqual(actual, expected)
+ def test_large_variable_types(self):
+ with self.sql_conf({"spark.sql.execution.arrow.useLargeVarTypes": True}):
+
+ def func(iterator):
+ for pdf in iterator:
+ assert isinstance(pdf, pd.DataFrame)
+ yield pdf
Review Comment:
For pandas related API.
For Arrow API like `mapInArrow` alone should be fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1382993831
Can one of the admins verify this patch?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1383136515
I like this idea. Could you have rough benchmark for this so we can assess which default value is better?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] q-aaronzolnailucas commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "q-aaronzolnailucas (via GitHub)" <gi...@apache.org>.
q-aaronzolnailucas commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1506160074
this would be a great help to me
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon closed pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
URL: https://github.com/apache/spark/pull/39572
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Kimahriman commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "Kimahriman (via GitHub)" <gi...@apache.org>.
Kimahriman commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1531947878
> Currently (before this PR) if I do a groupby -> `.applyInPandas`, does the 2GB limit apply to the whole group or just each column in the group?
It's each column. And I think because of https://issues.apache.org/jira/browse/SPARK-42347 it's now limited to 1GB.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] q-aaronzolnailucas commented on pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "q-aaronzolnailucas (via GitHub)" <gi...@apache.org>.
q-aaronzolnailucas commented on PR #39572:
URL: https://github.com/apache/spark/pull/39572#issuecomment-1531778418
Currently (before this PR) if I do a groupby -> `.applyInPandas`, does the 2GB limit apply to the whole group or just a each column in the group?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39572: [SPARK-39979][SQL] Add option to use large variable width vectors for arrow UDF operations
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #39572:
URL: https://github.com/apache/spark/pull/39572#discussion_r1227732519
##########
python/pyspark/sql/tests/pandas/test_pandas_map.py:
##########
@@ -68,6 +68,23 @@ def func(iterator):
expected = df.collect()
self.assertEqual(actual, expected)
+ def test_large_variable_types(self):
+ with self.sql_conf({"spark.sql.execution.arrow.useLargeVarTypes": True}):
+
+ def func(iterator):
+ for pdf in iterator:
+ assert isinstance(pdf, pd.DataFrame)
+ yield pdf
Review Comment:
Let me make a followup.
##########
python/pyspark/sql/tests/pandas/test_pandas_map.py:
##########
@@ -68,6 +68,23 @@ def func(iterator):
expected = df.collect()
self.assertEqual(actual, expected)
+ def test_large_variable_types(self):
+ with self.sql_conf({"spark.sql.execution.arrow.useLargeVarTypes": True}):
+
+ def func(iterator):
+ for pdf in iterator:
+ assert isinstance(pdf, pd.DataFrame)
+ yield pdf
Review Comment:
https://github.com/apache/spark/pull/41569 will add some test cases soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org