-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add better automated tests for Arrow columnar copy in HostColumnarToG…
…pu (#1665) * Add Data source v2 test classes Signed-off-by: Thomas Graves <tgraves@nvidia.com> * update v2 source testing * fix batch num rows and logging * update the numberin batch * Fix issue with reading booleans from ArrowColumnVectors and add more tests * move test file so pytest regex pick it up * add comments * fix line length Signed-off-by: Thomas Graves <tgraves@nvidia.com>
- Loading branch information
Showing
4 changed files
with
391 additions
and
104 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
integration_tests/src/main/python/datasourcev2_read_test.py
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) 2021, NVIDIA CORPORATION. | ||
# | ||
# Licensed 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. | ||
|
||
import pytest | ||
|
||
from asserts import assert_gpu_and_cpu_are_equal_collect | ||
|
||
columnarClass = 'com.nvidia.spark.rapids.tests.datasourcev2.parquet.ArrowColumnarDataSourceV2' | ||
|
||
def readTable(types, classToUse): | ||
return lambda spark: spark.read\ | ||
.option("arrowTypes", types)\ | ||
.format(classToUse).load()\ | ||
.orderBy("col1") | ||
|
||
def test_read_int(): | ||
assert_gpu_and_cpu_are_equal_collect(readTable("int", columnarClass)) | ||
|
||
def test_read_strings(): | ||
assert_gpu_and_cpu_are_equal_collect(readTable("string", columnarClass)) | ||
|
||
def test_read_all_types(): | ||
assert_gpu_and_cpu_are_equal_collect( | ||
readTable("int,bool,byte,short,long,string,float,double,date,timestamp", columnarClass), | ||
conf={'spark.rapids.sql.castFloatToString.enabled': 'true'}) | ||
|
||
def test_read_arrow_off(): | ||
assert_gpu_and_cpu_are_equal_collect( | ||
readTable("int,bool,byte,short,long,string,float,double,date,timestamp", columnarClass), | ||
conf={'spark.rapids.arrowCopyOptmizationEnabled': 'false', | ||
'spark.rapids.sql.castFloatToString.enabled': 'true'}) |
Oops, something went wrong.