Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/incubator-phoenix/pull/27#discussion_r11761250
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java ---
@@ -342,6 +347,112 @@ private static PTable getTable(Connection conn,
String name) throws SQLException
}
/**
+ * Get list of ColumnInfos that contain Column Name and its associated
+ * PDataType for an import. The supplied list of columns can be null
-- if it is non-null,
+ * it represents a user-supplied list of columns to be imported.
+ *
+ * @param conn Phoenix connection from which metadata will be read
+ * @param tableName Phoenix table name whose columns are to be
checked. Can include a schema
+ * name
+ * @param columns user-supplied list of import columns, can be null
+ */
+ public static List<ColumnInfo> generateColumnInfo(Connection conn,
+ String tableName, List<String> columns)
--- End diff --
Are these necessarily columns, or any expression, for example
UPPER(my_column)? Could you just concatenate these Strings with comma
separators to form the SELECT expressions and let the compile you do throw any
exceptions for unresolved/ambiguous columns?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---