Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add better automated tests for Arrow columnar copy in HostColumnarToGpu #1665

Merged
merged 9 commits into from
Feb 4, 2021
Merged
104 changes: 0 additions & 104 deletions integration_tests/src/main/python/datasourcev2_read.py

This file was deleted.

42 changes: 42 additions & 0 deletions integration_tests/src/main/python/datasourcev2_read_test.py
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'})
Loading