-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Orc writes don't fully support Booleans with nulls #11763
Merged
+156
−42
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
022eb61
Initial change, fix one failure in orc write test
kuhushukla 6d0e6f3
Merge branch 'branch-24.12' into issue_11736
kuhushukla 625e2ab
Allow tests for structs sans boolean in orc writes test
kuhushukla 507c75f
Fix test failures and address comments
kuhushukla eebf787
Fix tests and address review comments
kuhushukla b26e62c
Fix schema evolution test to avoid booleans for now
kuhushukla 5d582ba
Address comments from reviews
kuhushukla 6fa0db0
Merge remote-tracking branch 'refs/remotes/origin/branch-24.12' into …
kuhushukla 0ced895
Address a missed review comment
kuhushukla 2e2202b
Address missed review comments
kuhushukla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jlowe marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -24,9 +24,12 @@ | |||||||
from pyspark.sql.types import * | ||||||||
|
||||||||
pytestmark = pytest.mark.nightly_resource_consuming_test | ||||||||
# Use every type except boolean , see https://github.com/NVIDIA/spark-rapids/issues/11762 and | ||||||||
# https://github.com/rapidsai/cudf/issues/6763 . | ||||||||
# Once the first issue is fixed, add back boolean_gen | ||||||||
|
||||||||
jlowe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
orc_write_basic_gens = [byte_gen, short_gen, int_gen, long_gen, float_gen, double_gen, | ||||||||
string_gen, boolean_gen, DateGen(start=date(1590, 1, 1)), | ||||||||
string_gen, DateGen(start=date(1590, 1, 1)), | ||||||||
TimestampGen(start=datetime(1970, 1, 1, tzinfo=timezone.utc)) ] + \ | ||||||||
decimal_gens | ||||||||
|
||||||||
|
@@ -52,7 +55,8 @@ | |||||||
all_nulls_map_gen, | ||||||||
all_empty_map_gen] | ||||||||
|
||||||||
orc_write_basic_struct_gen = StructGen([['child'+str(ind), sub_gen] for ind, sub_gen in enumerate(orc_write_basic_gens)]) | ||||||||
orc_write_basic_struct_gen = StructGen( | ||||||||
[['child'+str(ind), sub_gen] for ind, sub_gen in enumerate(orc_write_basic_gens)]) | ||||||||
|
||||||||
orc_write_struct_gens_sample = [orc_write_basic_struct_gen, | ||||||||
StructGen([['child0', byte_gen], ['child1', orc_write_basic_struct_gen]]), | ||||||||
|
@@ -64,13 +68,14 @@ | |||||||
ArrayGen(StructGen([['child0', byte_gen], ['child1', string_gen], ['child2', float_gen]]))] | ||||||||
|
||||||||
orc_write_basic_map_gens = [simple_string_to_string_map_gen] + [MapGen(f(nullable=False), f()) for f in [ | ||||||||
jlowe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
BooleanGen, ByteGen, ShortGen, IntegerGen, LongGen, FloatGen, DoubleGen, | ||||||||
ByteGen, ShortGen, IntegerGen, LongGen, FloatGen, DoubleGen, | ||||||||
# Using timestamps from 1970 to work around a cudf ORC bug | ||||||||
# https://github.com/NVIDIA/spark-rapids/issues/140. | ||||||||
lambda nullable=True: TimestampGen(start=datetime(1970, 1, 1, tzinfo=timezone.utc), nullable=nullable), | ||||||||
lambda nullable=True: DateGen(start=date(1590, 1, 1), nullable=nullable), | ||||||||
lambda nullable=True: DecimalGen(precision=15, scale=1, nullable=nullable), | ||||||||
lambda nullable=True: DecimalGen(precision=36, scale=5, nullable=nullable)]] | ||||||||
lambda nullable=True: DecimalGen(precision=36, scale=5, nullable=nullable)]] + [MapGen( | ||||||||
f(nullable=False), f(nullable=False)) for f in [IntegerGen]] | ||||||||
|
||||||||
orc_write_gens_list = [orc_write_basic_gens, | ||||||||
orc_write_struct_gens_sample, | ||||||||
|
@@ -79,6 +84,10 @@ | |||||||
pytest.param([date_gen], marks=pytest.mark.xfail(reason='https://github.com/NVIDIA/spark-rapids/issues/139')), | ||||||||
pytest.param([timestamp_gen], marks=pytest.mark.xfail(reason='https://github.com/NVIDIA/spark-rapids/issues/140'))] | ||||||||
|
||||||||
bool_gen = [pytest.param([BooleanGen(nullable=True)], | ||||||||
marks=pytest.mark.allow_non_gpu('ExecutedCommandExec','DataWritingCommandExec')), | ||||||||
pytest.param([BooleanGen(nullable=False)], | ||||||||
marks=pytest.mark.allow_non_gpu('ExecutedCommandExec','DataWritingCommandExec'))] | ||||||||
@pytest.mark.parametrize('orc_gens', orc_write_gens_list, ids=idfn) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a nit that seemed to be missed. Would be nice to have whitespace separating the module variables from the methods. |
||||||||
@pytest.mark.parametrize('orc_impl', ["native", "hive"]) | ||||||||
@allow_non_gpu(*non_utc_allow) | ||||||||
|
@@ -91,6 +100,18 @@ def test_write_round_trip(spark_tmp_path, orc_gens, orc_impl): | |||||||
data_path, | ||||||||
conf={'spark.sql.orc.impl': orc_impl, 'spark.rapids.sql.format.orc.write.enabled': True}) | ||||||||
|
||||||||
@pytest.mark.parametrize('orc_gens', bool_gen, ids=idfn) | ||||||||
@pytest.mark.parametrize('orc_impl', ["native", "hive"]) | ||||||||
@allow_non_gpu('ExecutedCommandExec', 'DataWritingCommandExec', 'WriteFilesExec') | ||||||||
def test_write_round_trip_bools_only_fallback(spark_tmp_path, orc_gens, orc_impl): | ||||||||
gen_list = [('_c' + str(i), gen) for i, gen in enumerate(orc_gens)] | ||||||||
data_path = spark_tmp_path + '/ORC_DATA' | ||||||||
assert_gpu_and_cpu_writes_are_equal_collect( | ||||||||
lambda spark, path: gen_df(spark, gen_list).coalesce(1).write.orc(path), | ||||||||
lambda spark, path: spark.read.orc(path), | ||||||||
data_path, | ||||||||
conf={'spark.sql.orc.impl': orc_impl, 'spark.rapids.sql.format.orc.write.enabled': True}) | ||||||||
|
||||||||
@pytest.mark.parametrize('orc_gen', orc_write_odd_empty_strings_gens_sample, ids=idfn) | ||||||||
@pytest.mark.parametrize('orc_impl', ["native", "hive"]) | ||||||||
def test_write_round_trip_corner(spark_tmp_path, orc_gen, orc_impl): | ||||||||
|
@@ -103,7 +124,8 @@ def test_write_round_trip_corner(spark_tmp_path, orc_gen, orc_impl): | |||||||
conf={'spark.sql.orc.impl': orc_impl, 'spark.rapids.sql.format.orc.write.enabled': True}) | ||||||||
|
||||||||
orc_part_write_gens = [ | ||||||||
byte_gen, short_gen, int_gen, long_gen, boolean_gen, | ||||||||
# Add back boolean_gen when https://github.com/rapidsai/cudf/issues/6763 is fixed | ||||||||
byte_gen, short_gen, int_gen, long_gen, | ||||||||
# Some file systems have issues with UTF8 strings so to help the test pass even there | ||||||||
StringGen('(\\w| ){0,50}'), | ||||||||
# Once https://github.com/NVIDIA/spark-rapids/issues/139 is fixed replace this with | ||||||||
|
@@ -345,7 +367,7 @@ def test_orc_write_column_name_with_dots(spark_tmp_path): | |||||||
("f.g", int_gen), | ||||||||
("h", string_gen)])), | ||||||||
("i.j", long_gen)])), | ||||||||
("k", boolean_gen)] | ||||||||
("k", int_gen)] | ||||||||
assert_gpu_and_cpu_writes_are_equal_collect( | ||||||||
lambda spark, path: gen_df(spark, gens).coalesce(1).write.orc(path), | ||||||||
lambda spark, path: spark.read.orc(path), | ||||||||
|
jlowe marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jlowe marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit remove space after boolean