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

    https://github.com/apache/incubator-hawq/pull/477#discussion_r56933558
  
    --- Diff: 
pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/MetadataResponseFormatter.java
 ---
    @@ -55,50 +54,65 @@ public static String formatResponseString(Metadata 
metadata) throws IOException
          * To be used as the result string for HAWQ.
          * An example result is as follows:
          *
    -     * 
{"PXFMetadata":[{"table":{"dbName":"default","tableName":"t1"},"fields":[{"name":"a","type":"int"},{"name":"b","type":"float"}]}]}
    +     * 
{"PXFMetadata":[{"item":{"path":"default","name":"t1"},"fields":[{"name":"a","type":"int"},{"name":"b","type":"float"}]}]}
          */
    -    private static String metadataToJSON(Metadata metadata) throws 
IOException {
    +    private static String metadataToJSON(List<Metadata> metadataList) 
throws IOException {
    --- End diff --
    
    Have a look at the way we serialize the Fragments - we had a problem of 
having too many fragments, so we needed to serialize them inside a streaming 
object. 
    I think that now that the metadata can include multiple tables, the same 
approach should be taken here as well.
    The same applies also for the debug function that prints all of the items - 
if there are too many of them the StringBuilder will run out of memory. The 
solution in the fragments case was to print a log of one fragment at a time - 
perhaps the same should be done here as well.


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