arina-ielchiieva commented on a change in pull request #2024: DRILL-7641
Convert Excel Reader to use Streaming Reader
URL: https://github.com/apache/drill/pull/2024#discussion_r399237699
##########
File path:
contrib/format-excel/src/main/java/org/apache/drill/exec/store/excel/ExcelBatchReader.java
##########
@@ -134,121 +126,131 @@ public ExcelBatchReader(ExcelReaderConfig
readerConfig) {
@Override
public boolean open(FileSchemaNegotiator negotiator) {
split = negotiator.split();
- loader = negotiator.build();
+ ResultSetLoader loader = negotiator.build();
rowWriter = loader.writer();
openFile(negotiator);
defineSchema();
return true;
}
+ /**
+ * This method opens the Excel file, initializes the Streaming Excel Reader,
and initializes the sheet variable.
+ * @param negotiator The Drill file negotiator object that represents the
file system
+ */
private void openFile(FileScanFramework.FileSchemaNegotiator negotiator) {
try {
fsStream =
negotiator.fileSystem().openPossiblyCompressedStream(split.getPath());
- workbook = new XSSFWorkbook(fsStream);
+
+ // Open streaming reader
+ workbook = StreamingReader.builder()
+ .rowCacheSize(100) // Possible configuration option?
Review comment:
Please either make values as conf options or create constants.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services