felipepessoto commented on code in PR #13667:
URL: https://github.com/apache/gluten/pull/13667#discussion_r4692230106
##########
gluten-substrait/src/main/scala/org/apache/gluten/execution/BasicScanExecTransformer.scala:
##########
@@ -123,6 +124,20 @@ trait BasicScanExecTransformer extends
LeafTransformSupport with BaseDataSource
def getInputStats: Option[InputStats] = Option.empty
+ protected def validateExistenceDefaults(readSchema: StructType):
ValidationResult = {
+ val columns = readSchema.fields
+ .zip(ResolveDefaultColumns.getExistenceDefaultValues(readSchema))
+ .collect { case (field, value) if value != null => field.name }
+ if (columns.nonEmpty) {
Review Comment:
You're right: the metadata persists after rewrites, so the schema-only guard
can keep fully populated files on Spark. Added
`spark.gluten.sql.scan.fallbackOnExistenceDefaults.enabled` in 49abcc8ee. It
defaults to `true` (protective fallback on); `false` skips only this check, not
other scan validation.
The generated general configuration reference now covers plain Parquet/ORC
and Delta, explains the persistent-metadata trade-off, and warns that disabling
the check can produce incorrect results when files lack the columns. Updated
the Delta guide too. V1/V2 tests cover opt-out and restoration of the default
behavior; they pass on Spark 3.5 and 4.1.
##########
backends-velox/src/test/scala/org/apache/gluten/execution/VeloxScanSuite.scala:
##########
@@ -55,6 +57,64 @@ class VeloxScanSuite extends VeloxWholeStageTransformerSuite
{
checkGlutenPlan[T](df)
}
+ Seq(true, false).foreach {
+ useV1 =>
+ test(s"existence-default scan fallback and native controls
(useV1=$useV1)") {
+ withSQLConf(
+ SQLConf.USE_V1_SOURCE_LIST.key -> (if (useV1) "parquet" else ""),
+ GlutenConfig.NATIVE_WRITER_ENABLED.key -> "false") {
Review Comment:
It wasn't needed; removed the override in 49abcc8ee. The fixture now uses
the normal writer settings. Both V1/V2 cases pass on Spark 3.5 and 4.1 with the
default writer settings, and I also reran them with native writing disabled to
confirm they don't depend on which writer produces the id-only file.
--
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]