Github user mravi commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/27#discussion_r11746289
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java 
---
    @@ -126,4 +132,30 @@ public static String getExplainPlan(ResultSet rs) 
throws SQLException {
             }
             return buf.toString();
         }
    +    
    +    /**
    +     * 
    +     * @param tableName name of the table for which the select statement 
needs to be created.
    +     * @param columnInfos  list of columns to be projected in the select 
statement.
    +     * @return Select Query 
    +     */
    +    public static String constructSelectStatement(String tableName, 
List<ColumnInfo> columnInfos) {            
    +        if(columnInfos == null || columnInfos.isEmpty()) {
    +             throw new IllegalArgumentException("At least one column must 
be provided");
    +        }
    +        StringBuilder sb = new StringBuilder();
    +        sb.append("SELECT ");
    +        for (ColumnInfo cinfo : columnInfos) {
    +            if (cinfo != null) {
    +                String fullColumnName = 
getEscapedColumnFamily(cinfo.getColumnName());
    +                sb.append(fullColumnName);
    +                sb.append(",");
    +             }
    +         }
    +        // Remove the trailing comma
    +        sb.setLength(sb.length() - 1);
    +        sb.append(" FROM ");
    +        sb.append(tableName);
    --- End diff --
    
    Fixed this with the latest code push.


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

Reply via email to