voonhous commented on code in PR #20039: URL: https://github.com/apache/hudi/pull/20039#discussion_r4093158126
########## hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/schema/TestVariantPushVariantIntoScan.scala: ########## @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +package org.apache.spark.sql.hudi.dml.schema + +import org.apache.hudi.{HoodieSparkUtils, SparkAdapterSupport} +import org.apache.hudi.common.model.HoodieRecord.HoodieRecordType + +import org.apache.spark.sql.execution.FileSourceScanExec +import org.apache.spark.sql.hudi.common.HoodieSparkSqlTestBase +import org.apache.spark.sql.types.{DataType, StructType} + +import scala.collection.mutable.ListBuffer +import scala.util.{Failure, Success, Try} + +/** + * The pushVariantIntoScan legs of master's TestVariantShreddingMixedLayouts (#19688, #19783), + * ported to release-1.2.1 over unshredded data only, since this branch has no shredding writer. + * spark.sql.variant.pushVariantIntoScan is swept on and off: both arms expect the very same rows, + * and only the plan tells them apart (whether the rule rewrote the variant into a projection + * struct inside the scan). Record types are swept too, which on table version 9 gives avro + * (AVRO) and parquet (SPARK) log blocks on the MOR legs. Review Comment: Keeping this one on purpose. `containsVariantProjection` is the code under test, so the assertion walks the plan with its own helper; a bug in that method cannot then hide itself. -- 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]
