Github user shivzone commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/821#discussion_r72839760
--- Diff:
pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/utilities/ProtocolData.java
---
@@ -383,16 +383,40 @@ protected void parseFormat(String formatString) {
/*
* Sets the tuple description for the record
+ * Attribute Projection information is optional
*/
void parseTupleDescription() {
+
+ /* Process column projection info */
+ String columnProjStr = getOptionalProperty("ATTRS-PROJ");
+ List<Integer> columnProjList = new ArrayList<Integer>();
+ if(columnProjStr != null) {
+ int columnProj = Integer.parseInt(columnProjStr);
+ if(columnProj > 0) {
+ String columnProjIndexStr = getProperty("ATTRS-PROJ-IDX");
+ String columnProjIdx[] = columnProjIndexStr.split(",");
+ for(int i = 0; i < columnProj; i++) {
+ columnProjList.add(Integer.valueOf(columnProjIdx[i]));
+ }
+ } else {
+ /* This is a special case to handle aggregate queries not
related to any specific column
+ * eg: count(*) queries. */
+ columnProjList.add(0);
+ }
+ }
+
int columns = getIntProperty("ATTRS");
for (int i = 0; i < columns; ++i) {
String columnName = getProperty("ATTR-NAME" + i);
int columnTypeCode = getIntProperty("ATTR-TYPECODE" + i);
String columnTypeName = getProperty("ATTR-TYPENAME" + i);
-
- ColumnDescriptor column = new ColumnDescriptor(columnName,
- columnTypeCode, i, columnTypeName);
+ ColumnDescriptor column;
+ if(columnProjStr != null) {
+ column = new ColumnDescriptor(columnName, columnTypeCode,
i, columnTypeName, columnProjList.contains(i));
--- End diff --
Can't use contains with a primitive data type. Fix this
---
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.
---