[
https://issues.apache.org/jira/browse/DRILL-8022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17436429#comment-17436429
]
ASF GitHub Bot commented on DRILL-8022:
---------------------------------------
luocooong commented on a change in pull request #2354:
URL: https://github.com/apache/drill/pull/2354#discussion_r739776980
##########
File path:
contrib/format-excel/src/main/java/org/apache/drill/exec/store/excel/ExcelBatchReader.java
##########
@@ -710,6 +785,40 @@ public void load(Cell cell) {
}
}
+
+ public static class IntStringWriter extends ExcelBatchReader.CellWriter {
+ IntStringWriter(ScalarWriter columnWriter) {
+ super(columnWriter);
+ }
+
+ @Override
+ public void load(Cell cell) {
+ if (cell == null) {
+ columnWriter.setNull();
+ } else {
+ String fieldValue = String.valueOf(cell.getNumericCellValue());
+ columnWriter.setString(fieldValue);
+ }
+ }
+ }
+
+ public static class IntCellWriter extends ExcelBatchReader.CellWriter {
+ IntCellWriter(ScalarWriter columnWriter) {
+ super(columnWriter);
+ }
+
+ @Override
+ public void load(Cell cell) {
+ if (cell == null) {
+ columnWriter.setNull();
+ } else {
+ int fieldNumValue = (int)cell.getNumericCellValue();
Review comment:
Add a space before `cell`.
##########
File path:
contrib/format-excel/src/main/java/org/apache/drill/exec/store/excel/ExcelBatchReader.java
##########
@@ -363,6 +407,22 @@ private void setFirstRow() {
}
}
+ /**
+ * This function is used to set the iterator to the first row of actual
data. When a schema is provided,
+ * we can safely skip the header row, and start reading the first row of
data.
+ */
+ private void setFirstDataRow() {
+ // Initialize
+ currentRow = rowIterator.next();
Review comment:
Is it possible to do this (?) :
```java
// 1. Remove this line
// 2. Add a loop once
for (int i = 0; i <= rowNumber + 1; i++) {
currentRow = rowIterator.next();
}
```
--
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]
> Add Provided Schema Support for Excel Reader
> --------------------------------------------
>
> Key: DRILL-8022
> URL: https://issues.apache.org/jira/browse/DRILL-8022
> Project: Apache Drill
> Issue Type: Improvement
> Components: Storage - Text & CSV
> Affects Versions: 1.19.0
> Reporter: Charles Givre
> Assignee: Charles Givre
> Priority: Major
> Fix For: 1.20.0
>
>
> Add support for provided schema for Excel files.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)