nsivabalan commented on code in PR #18128:
URL: https://github.com/apache/hudi/pull/18128#discussion_r2790543400


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/utils/SparkValidatorUtils.java:
##########
@@ -201,7 +204,17 @@ public static Dataset<Row> 
getRecordsFromPendingCommits(SQLContext sqlContext,
         .collect(Collectors.toList());
 
     if (newFiles.isEmpty()) {
-      return sqlContext.emptyDataFrame();
+      // Empty write: return empty DataFrame with table schema so validators 
that reference
+      // columns (e.g. _row_key) do not fail with AnalysisException "Column 
... does not exist".
+      try {

Review Comment:
   can we move this to private method and reuse across. 
`getRecordsFromCommittedFiles` also seem to have similar code



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