jintaoguan commented on a change in pull request #3237:
URL: https://github.com/apache/hudi/pull/3237#discussion_r666405806



##########
File path: 
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/HoodieReadClient.java
##########
@@ -144,7 +145,15 @@ private void assertSqlContext() {
 
     // record locations might be same for multiple keys, so need a unique list
     Set<String> uniquePaths = new HashSet<>(paths);
-    Dataset<Row> originalDF = 
sqlContextOpt.get().read().parquet(uniquePaths.toArray(new 
String[uniquePaths.size()]));
+    Dataset<Row> originalDF = null;
+    if (uniquePaths.size() == 0) {

Review comment:
       The `paths` here could be an empty List. And the unit test 
`TestHoodieReadClient`  expects an `AnalysisException` thrown when `paths` is 
an empty List. If we merge with 
`paths.get(0).endsWith(HoodieFileFormat.PARQUET.getFileExtension()`, we will 
have `ArrayIndexOutOfBoundsException` instead of  `AnalysisException` if 
`paths` is empty. 




-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to