xabriel commented on a change in pull request #89: Make read-path Evaluators
honor case sensitivity flag. Expose flag in Spark Reader.
URL: https://github.com/apache/incubator-iceberg/pull/89#discussion_r263973715
##########
File path: api/src/main/java/com/netflix/iceberg/Schema.java
##########
@@ -207,13 +211,31 @@ public Schema select(String... names) {
* @return a projection schema from this schema, by name
*/
public Schema select(Collection<String> names) {
+ return select(names, true);
+ }
+
+ /**
+ * Creates a projection schema for a subset of columns, selected by name,
and with the specified case sensitivity.
+ * <p>
+ * Names that identify nested fields will select part or all of the field's
top-level column.
+ *
+ * @param names a List of String names for selected columns
+ * @return a projection schema from this schema, by name
+ */
+ public Schema select(Collection<String> names, boolean caseSensitive) {
Review comment:
Re this method signature, we could instead do the refinement pattern we've
done in other places like so:
`schema.caseSensitive(false).select(..)`
But I'm not sure refinements should be made against `Schema` objects as it
feels that they should strictly represent what the underlying schema is.
Otherwise it could get confusing if you do a
`schema.caseSensitive(false).asStruct()`.. should that return all fields
lowercase or not? Thus decided to not do refinement pattern and instead
overload the `select()` method.
LMK what you think @rdblue.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]