voonhous commented on code in PR #19709:
URL: https://github.com/apache/hudi/pull/19709#discussion_r3842330654


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/command/SqlKeyGenerator.scala:
##########
@@ -99,7 +99,15 @@ class SqlKeyGenerator(props: TypedProperties) extends 
BuiltinKeyGenerator(props)
 
   override def getPartitionPath(record: GenericRecord): String = {

Review Comment:
   Let's add it. The instrumentation establishes that the path is not entered 
today, not why, which is your own unreachable-as-verified framing. A size check 
does not depend on which gate currently excludes the pk-less merge, so it 
survives that gate moving; without it the failure mode is a bare 
`ArrayIndexOutOfBoundsException` out of a keygen, which is not diagnosable from 
the SQL that triggered it.
   
   `getRecordKey(GenericRecord)` reads `RECORD_KEY_META_FIELD_ORD` the same 
way, so worth covering both Avro arms while you are in there.
   
   Untestable from SQL is fine; a direct unit test on `MergeIntoKeyGenerator` 
with a short record pins it.
   



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

Reply via email to