Github user maryannxue commented on a diff in the pull request:
https://github.com/apache/incubator-phoenix/pull/28#discussion_r11557199
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java ---
@@ -385,7 +392,37 @@ public Void visit(NamedTableNode tableNode) throws
SQLException {
@Override
public Void visit(DerivedTableNode subselectNode) throws
SQLException {
- throw new SQLFeatureNotSupportedException();
+ List<AliasedNode> selectNodes =
subselectNode.getSelect().getSelect();
+ List<PColumn> columns = new ArrayList<PColumn>();
+ int position = 0;
+ for (AliasedNode aliasedNode : selectNodes) {
+ String alias = aliasedNode.getAlias();
+ if (alias == null) {
+ ParseNode node = aliasedNode.getNode();
+ if (node instanceof WildcardParseNode
+ || node instanceof TableWildcardParseNode
+ || node instanceof FamilyWildcardParseNode)
+ throw new SQLException("Encountered wildcard in
subqueries.");
--- End diff --
Don't know if wildcard select makes sense here. Good reminder, though :)
Let me add a TODO here and check the specs.
---
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.
---