zachjsh commented on code in PR #13627:
URL: https://github.com/apache/druid/pull/13627#discussion_r1067583226


##########
server/src/main/java/org/apache/druid/catalog/model/table/InputFormatDefn.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * 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.druid.catalog.model.table;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.druid.catalog.model.ColumnSpec;
+import org.apache.druid.catalog.model.table.TableFunction.ParameterDefn;
+import org.apache.druid.data.input.InputFormat;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Metadata about a Druid {@link InputFormat}. Provides the logic to
+ * convert from a table spec or SQL function arguments to a specific
+ * form of {@code InputFormat}. There is one instance of this interface for 
each
+ * supported {@code InputFormat}.
+ */
+public interface InputFormatDefn
+{
+  /**
+   * @return the string used to identify the input format type in the 
serialized
+   * JSON for the input format. This is also the value used in the {@link 
format}
+   * property for SQL functions.
+   */
+  String typeValue();
+
+  /**
+   * Given a resolved table that has the serialized JSON converted to a Java 
map,
+   * validate the values of that map, typically by converting that map the 
target
+   * input format object (after adjustments and filling in dummy columns.) THe
+   * goal is to validate the information the user has provided in the table 
spec.
+   * The final format information is validated elsewhere.
+   */
+  void validate(ResolvedExternalTable table);
+
+  /**
+   * Obtain the parameters used to fully define an input format in a SQL 
function
+   * that defines an external table from scratch. Note that the final list of 
table
+   * function arguments combines parameters from all the various input 
sources. It
+   * is legal for multiple formats to define the same parameter, as long as 
both
+   * definitions are of the same type.
+   * @return
+   */
+  List<ParameterDefn> parameters();
+
+  /**
+   * Create an input format instance from the values provided as arguments that
+   * correspond to the defined parameters. The map provided is guaranteed to 
have
+   * a value for each parameter defined as non-optional, and those values will 
be
+   * of the type defined in the parameter. The map will also contain values for
+   * the input source: the format should values that don't correspond to 
parameters

Review Comment:
   theres some type here, think trying to say that the format shouldn't have 
values that don't correspond to parameters that it defined?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to