luocooong commented on code in PR #2515:
URL: https://github.com/apache/drill/pull/2515#discussion_r851626806


##########
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/scan/v3/schema/ScanSchemaResolver.java:
##########
@@ -189,7 +189,7 @@ private void insertColumn(ColumnMetadata col) {
     switch (mode) {
       case FIRST_READER_SCHEMA:
       case READER_SCHEMA:
-        if (schema.projectionType() != ProjectionType.ALL) {
+        if (schema.projectionType() != ProjectionType.ALL && !col.isArray()) {

Review Comment:
   Let's look at this case :
   1. batch reader received the project column, from ` SELECT path, data_type, 
file_name FROM ` in the constructor().
   2. schema is [TupleSchema [ProjectedColumn [`path` (LATE:REQUIRED)]], 
[ProjectedColumn [`data_type` (LATE:REQUIRED)]], [ProjectedColumn [`file_name` 
(LATE:REQUIRED)]]].
   3. ProjectionType = 'SOME'.
   4. batch reader create new repeated list column in next().
   5. do the project for the schema.
   ```java
   ColumnHandle existing = schema.find(colSchema.name());
    if (existing == null) {
     insertColumn(colSchema);
   }
   ```
   6. catch and throw the `IllegalStateException`.
   7. failed to reader the format data.
   
   In EVF1, creating repeated list fields dynamically is allowed and does not 
throw such exceptions.



-- 
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: dev-unsubscr...@drill.apache.org

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

Reply via email to