cgivre commented on a change in pull request #2211:
URL: https://github.com/apache/drill/pull/2211#discussion_r624710173
##########
File path:
contrib/format-excel/src/main/java/org/apache/drill/exec/store/excel/ExcelBatchReader.java
##########
@@ -566,6 +598,34 @@ private void writeMetadata() {
metadataColumnWriters.get(index).setTimestamp(Instant.ofEpochMilli(timeValue.getTime()));
}
}
+
+ // Write the sheet names. Since this is the only list field
+ int listIndex = IMPLICIT_STRING_COLUMN.values().length +
IMPLICIT_TIMESTAMP_COLUMN.values().length;
+ String sheetColumnName = IMPLICIT_LIST_COLUMN.SHEETS.fieldName;
+ List<String> sheetNames = listMetadata.get(sheetColumnName);
+
+ if (sheetNameWriter == null) {
+ int sheetColumnIndex =
rowWriter.tupleSchema().index(IMPLICIT_LIST_COLUMN.SHEETS.getFieldName());
+ if (sheetColumnIndex == -1) {
+ ColumnMetadata colSchema = MetadataUtils.newScalar(sheetColumnName,
MinorType.VARCHAR, DataMode.REPEATED);
+ colSchema.setBooleanProperty(ColumnMetadata.EXCLUDE_FROM_WILDCARD,
true);
Review comment:
> Great feature. Does this function also apply to other format plugins
(`EXCLUDE_FROM_WILDCARD ` set to true)?
The `EXCLUDE_FROM_WILDCARD` feature is meant for metadata fields or other
info that you'd want to access to, but you'd also want the user to explicitly
ask for. In this case, the sheet names...
Some other format plugins, such as the log reader, have some metadata fields
like this. I think there may be a few in various storage plugins as well.
--
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]