Skip to content

[AutoSparkUT] [SPARK-31238: compatibility with Spark 2.4 in reading dates] - GPU Execution Issue #15470

Description

@wjxiz1992

Describe the bug

The GPU ORC reader returns the wrong pre-Gregorian date when reading the Spark
2.4 compatibility resource. Spark CPU returns 1200-01-01; GPU returns
1200-01-08. The mismatch reproduces in V1 and V2 with both row and vectorized
ORC reader settings.

Steps/code to reproduce

Build the exact PR head, then use Spark 3.3.0 and the complete RAPIDS UT
configuration:

mvn package -DskipTests -pl dist -am -Dbuildver=330 \
  -Dmaven.repo.local=./.mvn-repo

$SPARK_HOME/bin/spark-shell \
  --master local[2] \
  --conf spark.sql.optimizer.excludedRules=org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation,org.apache.spark.sql.catalyst.optimizer.ConstantFolding \
  --conf spark.rapids.sql.enabled=true \
  --conf spark.plugins=com.nvidia.spark.SQLPlugin \
  --conf spark.sql.queryExecutionListeners=org.apache.spark.sql.rapids.ExecutionPlanCaptureCallback \
  --conf spark.rapids.sql.explain=ALL \
  --conf spark.rapids.sql.test.isFoldableNonLitAllowed=true \
  --conf spark.rapids.sql.csv.read.decimal.enabled=true \
  --conf spark.rapids.sql.format.avro.enabled=true \
  --conf spark.rapids.sql.format.avro.read.enabled=true \
  --conf spark.rapids.sql.format.hive.text.write.enabled=true \
  --conf spark.rapids.sql.format.json.enabled=true \
  --conf spark.rapids.sql.format.json.read.enabled=true \
  --conf spark.rapids.sql.incompatibleDateFormats.enabled=true \
  --conf spark.rapids.sql.python.gpu.enabled=true \
  --conf spark.rapids.sql.rowBasedUDF.enabled=true \
  --conf spark.rapids.sql.window.collectList.enabled=true \
  --conf spark.rapids.sql.window.collectSet.enabled=true \
  --conf spark.rapids.sql.window.range.byte.enabled=true \
  --conf spark.rapids.sql.window.range.short.enabled=true \
  --conf spark.rapids.sql.expression.Ascii=true \
  --conf spark.rapids.sql.expression.Conv=true \
  --conf spark.rapids.sql.expression.GetJsonObject=true \
  --conf spark.rapids.sql.expression.JsonToStructs=true \
  --conf spark.rapids.sql.expression.StructsToJson=true \
  --conf spark.rapids.sql.exec.CollectLimitExec=true \
  --conf spark.rapids.sql.exec.FlatMapCoGroupsInPandasExec=true \
  --conf spark.rapids.sql.exec.WindowInPandasExec=true \
  --conf spark.rapids.sql.hasExtendedYearValues=false \
  --conf spark.unsafe.exceptionOnMemoryLeak=true \
  --conf spark.sql.session.timeZone=America/Los_Angeles \
  --jars $RAPIDS_JAR

Run extract-test-configs.scala first. In the same session, run GPU first and
CPU second for V1/V2 and for
spark.sql.orc.enableVectorizedReader=false,true:

import java.util.TimeZone
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"))
spark.conf.set("spark.sql.orc.impl", "native")

val path = "/path/to/before_1582_date_v2_4.snappy.orc"
val df = spark.read.orc(path)
println(df.collect().toSeq)
println(df.queryExecution.executedPlan)

Resource SHA-256:
d9825513aff412c2357cdd0db4587b4af39ba9ce09c6beaedd9aac2627d4c682.

Actual output

RAPIDS Enabled = YES
Plugins Loaded = YES
SPARK_VERSION = 3.3.0

GPU-V1, vectorized=false: rows=[[1200-01-08]]; plan=GpuFileGpuScan orc
GPU-V1, vectorized=true:  rows=[[1200-01-08]]; plan=GpuFileGpuScan orc
GPU-V2, vectorized=false: rows=[[1200-01-08]]; plan=GpuBatchScan ... GpuOrcScan
GPU-V2, vectorized=true:  rows=[[1200-01-08]]; plan=GpuBatchScan ... GpuOrcScan

CPU-V1/V2, vectorized=false/true: rows=[[1200-01-01]]

Expected behavior

GPU should return 1200-01-01, matching Spark CPU's Spark 2.4 ORC calendar
compatibility behavior.

Environment

  • Local Spark 3.3.0, revision f74867bddfbcdd4d08076db36851e88b15e66556
  • cudf-spark f7457eeee116ca033ffa84eadbe84226e01b2ff7, version
    26.10.0-SNAPSHOT, CUDA 12 JAR
  • NVIDIA RTX 5880 Ada Generation, driver 580.95.05
  • Java 17

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    ? - Needs TriageNeed team to review and classifybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions