[ 
https://issues.apache.org/jira/browse/DRILL-7011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16802732#comment-16802732
 ] 

ASF GitHub Bot commented on DRILL-7011:
---------------------------------------

arina-ielchiieva commented on pull request #1711: DRILL-7011: Support schema in 
scan framework
URL: https://github.com/apache/drill/pull/1711#discussion_r269512903
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/scan/project/WildcardProjection.java
 ##########
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.physical.impl.scan.project;
+
+import java.util.List;
+
+import 
org.apache.drill.exec.physical.impl.scan.project.AbstractUnresolvedColumn.UnresolvedWildcardColumn;
+import org.apache.drill.exec.record.MaterializedField;
+import org.apache.drill.exec.record.metadata.TupleMetadata;
+
+/**
+ * Perform a wildcard projection. In this case, the query wants all
+ * columns in the source table, so the table drives the final projection.
+ * Since we include only those columns in the table, there is no need
+ * to create null columns. Example: SELECT *
+ */
+
+public class WildcardProjection extends ReaderLevelProjection {
+
+  public WildcardProjection(ScanLevelProjection scanProj,
+      TupleMetadata tableSchema,
+      ResolvedTuple rootTuple,
+      List<ReaderProjectionResolver> resolvers) {
+    super(resolvers);
+    for (ColumnProjection col : scanProj.columns()) {
+      if (col instanceof UnresolvedWildcardColumn) {
+        projectAllColumns(rootTuple, tableSchema);
+      } else {
+        resolveSpecial(rootTuple, col, tableSchema);
+      }
+    }
+  }
+
+  /**
+   * Project all columns from table schema to the output, in table
+   * schema order. Since we accept any map columns as-is, no need
+   * to do recursive projection.
+   *
+   * @param tableSchema
 
 Review comment:
   Please add column description to avoid warning in the IDE.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


> Allow hybrid model in the Row set-based scan framework
> ------------------------------------------------------
>
>                 Key: DRILL-7011
>                 URL: https://issues.apache.org/jira/browse/DRILL-7011
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.15.0
>            Reporter: Arina Ielchiieva
>            Assignee: Paul Rogers
>            Priority: Major
>             Fix For: 1.16.0
>
>
> As part of schema provisioning project we want to allow hybrid model for Row 
> set-based scan framework, namely to allow to pass custom schema metadata 
> which can be partial.
> Currently schema provisioning has SchemaContainer class that contains the 
> following information (can be obtained from metastore, schema file, table 
> function):
> 1. schema represented by org.apache.drill.exec.record.metadata.TupleMetadata
> 2. properties represented by Map<String, String>, can contain information if 
> schema is strict or partial (default is partial) etc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to