paul-rogers commented on a change in pull request #1696: DRILL-7095: Expose 
table schema (TupleMetadata) to physical operator (EasySubScan)
URL: https://github.com/apache/drill/pull/1696#discussion_r266213311
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/easy/EasySubScan.java
 ##########
 @@ -47,18 +48,20 @@
 
   @JsonCreator
   public EasySubScan(
-      @JsonProperty("userName") String userName,
-      @JsonProperty("files") List<FileWorkImpl> files,
-      @JsonProperty("storage") StoragePluginConfig storageConfig,
-      @JsonProperty("format") FormatPluginConfig formatConfig,
-      @JacksonInject StoragePluginRegistry engineRegistry,
-      @JsonProperty("columns") List<SchemaPath> columns,
-      @JsonProperty("selectionRoot") Path selectionRoot,
-      @JsonProperty("partitionDepth") int partitionDepth
-      ) throws ExecutionSetupException {
+    @JsonProperty("userName") String userName,
+    @JsonProperty("files") List<FileWorkImpl> files,
+    @JsonProperty("storage") StoragePluginConfig storageConfig,
+    @JsonProperty("format") FormatPluginConfig formatConfig,
+    @JacksonInject StoragePluginRegistry engineRegistry,
+    @JsonProperty("columns") List<SchemaPath> columns,
+    @JsonProperty("selectionRoot") Path selectionRoot,
+    @JsonProperty("partitionDepth") int partitionDepth,
+    @JsonProperty("schema") TupleSchema schema
+    ) throws ExecutionSetupException {
     super(userName);
     this.formatPlugin = (EasyFormatPlugin<?>) 
engineRegistry.getFormatPlugin(storageConfig, formatConfig);
     Preconditions.checkNotNull(this.formatPlugin);
+    this.formatPlugin.setSchema(schema);
 
 Review comment:
   Again, can't store this in the plugin: the plugin is (or should be) shared.
   
   Or, are we serializing the plugin (config) to handle table properties? If 
so, then the schema can be set via the Drill web console, which I don't think 
we want as it will encourage people to create plugin configs for table schema, 
but that will require that each file have a distinct file suffix, which will 
cause confusion. (Already does for CSV/CSVH).

----------------------------------------------------------------
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

Reply via email to