dtenedor commented on code in PR #60679:
URL: https://github.com/apache/spark/pull/60679#discussion_r4636243080


##########
docs/sql-migration-guide.md:
##########
@@ -26,6 +26,7 @@ license: |
 
 - Since Spark 5.0, the Spark Thrift Server refuses to start when 
`hive.server2.enable.doAs` is `true` and `hive.server2.authentication` verifies 
user identities (any recognized type other than `NONE`/`NOSASL`). It 
impersonates the connecting user for Hive metastore calls and driver-side file 
system access, but executor-side data access still runs as the server's own 
service identity, so storage-level permissions are checked against the service 
principal rather than the connecting user (SPARK-5159). Spark 4.4 logs a 
warning for the same configuration. To restore the previous behavior, set 
`spark.sql.hive.thriftServer.allowIneffectiveDoAs` to `true`. Setting 
`hive.server2.enable.doAs` to `false` also starts the server, but note that it 
stops impersonating metastore calls as well, so it is not a no-op.
 - Since Spark 5.0, Spark requires Java 21 or later. Users who ran Spark 4.x on 
Java 17 can see two differences that come from Java. The datetime pattern 
letter `F` is the aligned week of month instead of the aligned day of week in 
month (JDK-8282081). For example, `date_format(date '2019-12-31', 'F')` returns 
`5` instead of `3`. Converting a `FLOAT` or `DOUBLE` value to a string gives 
the shortest decimal that represents the value (JDK-4511638). For example, 
`CAST(CAST(4567890123456789 AS FLOAT) AS STRING)` returns `4.56789E15` instead 
of `4.5678899E15`. A cast from `FLOAT` or `DOUBLE` to `DECIMAL` goes through 
this string, so its result can change as well. For example, 
`CAST(1.0751133388005187E17D AS DECIMAL(38, 0))` returns `107511333880051870` 
instead of `107511333880051872`.
+- Since Spark 5.0, the vectorized Parquet and ORC readers return the existence 
default value of a column missing from a file when that default contains no map 
and holds a decimal whose unscaled value does not fit in a long (at the top 
level or inside a struct or array) or a NULL inside a struct or array. 
Previously such reads failed with `FAILED_READ_FILE`. To restore the previous 
behavior, set 
`spark.sql.legacy.vectorizedReader.failOnNullFieldOrWideDecimalDefault` to 
`true`.

Review Comment:
   Thanks. With the legacy conf gone, there is no migration-guide entry or conf 
version left to target. It is now a plain bug fix (the `WritableColumnVector` 
change plus a test), so it can go to 4.4.0 when it merges.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -6834,6 +6834,19 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val LEGACY_VECTORIZED_READER_FAIL_ON_NULL_FIELD_OR_WIDE_DECIMAL_DEFAULT =

Review Comment:
   Agreed, dropped it in 42937cdf. The conf, its migration-guide entry, the 
three-argument `appendObjects` overload, the new `OrcColumnarBatchReader` 
constructor and the `ParquetColumnVector` parameter are all gone, and the 
readers are back to their master versions. `appendObjects(length, value)` now 
fills unless the value contains a map. The `toUnscaledLong()` call that runs 
only for its exception stays for that one case: it keeps the old 
`ArithmeticException` for a map-containing default that holds a wide decimal, 
as its comment now says.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -6834,6 +6834,19 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val LEGACY_VECTORIZED_READER_FAIL_ON_NULL_FIELD_OR_WIDE_DECIMAL_DEFAULT =
+    
buildConf("spark.sql.legacy.vectorizedReader.failOnNullFieldOrWideDecimalDefault")
+      .internal()
+      .doc("When true, the vectorized Parquet and ORC readers fail on a 
missing " +
+        "column whose existence default contains no map and holds a NULL 
inside a struct or " +
+        "array or a decimal whose unscaled value overflows a long, as before 
Spark 5.0. When " +
+        "false (the default), they return the default value. Defaults that 
contain a map fail " +

Review Comment:
   This goes away with the conf. The Javadoc of `appendObjects` keeps the 
precise wording: a NULL or a wide decimal is appended "unless the value 
contains a map", in which case it "keeps failing as it did before". An ordinary 
map default is unaffected. I'll also fix the same imprecision in the PR 
description.



-- 
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