MaxGekk opened a new pull request, #56859:
URL: https://github.com/apache/spark/pull/56859

   ### What changes were proposed in this pull request?
   
   This PR assigns a proper name to the legacy error conditions 
`_LEGACY_ERROR_TEMP_3171` and `_LEGACY_ERROR_TEMP_3172` as part of the 
error-class migration (SPARK-37935).
   
   Both are thrown by Parquet aggregate push-down in `ParquetUtils` when the 
required column-chunk statistics are missing. They share the same parameters 
(`filePath`, `config`) and remedy, and differ only in which statistic is 
absent, so they are merged into a single parent condition with two 
sub-conditions:
   
   - `_LEGACY_ERROR_TEMP_3172` -> 
`PARQUET_AGGREGATE_PUSH_DOWN_UNSUPPORTED.NO_MIN_MAX` (thrown by 
`getCurrentBlockMaxOrMin` during MIN/MAX push-down when a column chunk has no 
non-null values).
   - `_LEGACY_ERROR_TEMP_3171` -> 
`PARQUET_AGGREGATE_PUSH_DOWN_UNSUPPORTED.NO_NUM_NULLS` (thrown by `getNumNulls` 
during COUNT push-down when the null count is not set).
   
   The new condition uses SQLSTATE `0A000` (feature not supported).
   
   ### Why are the changes needed?
   
   `_LEGACY_ERROR_TEMP_*` are temporary placeholder conditions with no proper 
name or SQLSTATE. Assigning real names is part of the ongoing error-class 
migration (SPARK-37935) and improves the user-facing error experience.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The error condition names, messages, and SQLSTATE for the two Parquet 
aggregate push-down errors change.
   
   Before:
   - `[_LEGACY_ERROR_TEMP_3172] No min/max found for Parquet file <filePath>. 
Set SQLConf <config> to false and execute again.`
   - `[_LEGACY_ERROR_TEMP_3171] Number of nulls not set for Parquet file 
<filePath>. Set SQLConf <config> to false and execute again.`
   
   After (SQLSTATE `0A000`):
   - `[PARQUET_AGGREGATE_PUSH_DOWN_UNSUPPORTED.NO_MIN_MAX] Aggregate push-down 
is not supported for Parquet file <filePath>. Set SQLConf <config> to false and 
execute again. No min/max value found in the column statistics.`
   - `[PARQUET_AGGREGATE_PUSH_DOWN_UNSUPPORTED.NO_NUM_NULLS] Aggregate 
push-down is not supported for Parquet file <filePath>. Set SQLConf <config> to 
false and execute again. The number of nulls is not set in the column 
statistics.`
   
   ### How was this patch tested?
   
   - Added a `checkError` test in `ParquetV2AggregatePushDownSuite` that writes 
a Parquet file with column statistics disabled 
(`parquet.column.statistics.enabled=false`) and asserts both sub-conditions via 
`MIN`/`COUNT` aggregate push-down.
   - `build/sbt "core/testOnly org.apache.spark.SparkThrowableSuite"`
   - `build/sbt "sql/testOnly *ParquetV2AggregatePushDownSuite 
*ParquetV1AggregatePushDownSuite"`
   - `build/sbt "sql/scalastyle" "sql/Test/scalastyle"`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor (Claude Opus 4.8)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to