hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sansanichfb <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-465. Implement stored procedure ...
Date Tue, 22 Mar 2016 23:44:02 GMT
Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/479#discussion_r57089286
  
    --- Diff: src/backend/catalog/external/externalmd.c ---
    @@ -129,45 +135,45 @@ HCatalogTable *ParseHCatalogTable(struct json_object *hcatalogMD)
     			const int numModifiers = json_object_array_length(jsonModifiers);
     			Assert(2 >= numModifiers);
     			
    -			hcatalogCol->nTypeModifiers = numModifiers;
    +			pxfField->nTypeModifiers = numModifiers;
     			for (int j = 0; j < numModifiers; j++)
     			{
     				struct json_object *jsonMod = json_object_array_get_idx(jsonModifiers, j);
    -				hcatalogCol->typeModifiers[j] = json_object_get_int(jsonMod);
    +				pxfField->typeModifiers[j] = json_object_get_int(jsonMod);
     				
    -				elog(DEBUG1, "modifier[%d]: %d", j, hcatalogCol->typeModifiers[j]);
    +				elog(DEBUG1, "modifier[%d]: %d", j, pxfField->typeModifiers[j]);
     			}
     		}
    -		hcatalogTable->columns = lappend(hcatalogTable->columns, hcatalogCol);
    +		pxfItem->fields = lappend(pxfItem->fields, pxfField);
     	}
     
    -	return hcatalogTable;
    +	return pxfItem;
     }
     
     /*
    - * LoadHcatalogTable
    - * 		Load the given hcatalog table into in-memory heap tables
    + * LoadPxfItem
    + * 		Load the given PXF item into in-memory heap tables
      */
    -void LoadHCatalogEntry(HCatalogTable *hcatalogTable)
    +void LoadPxfItem(PxfItem *pxfItem, Oid dboid)
     {
    -	Oid namespaceOid = LookupNamespaceId(hcatalogTable->dbName, HcatalogDbOid);
    +	Oid namespaceOid = LookupNamespaceId(pxfItem->path, dboid);
     
     	if (!OidIsValid(namespaceOid))
     	{
    -		/* hcatalog database name has not been mapped to a namespace yet: create it */
    -		namespaceOid = LoadHCatalogNamespace(hcatalogTable->dbName);
    -		elog(DEBUG1, "No namespace found: %s. Generated new namespace oid: %u", hcatalogTable->dbName,
namespaceOid);
    +		/* external database name has not been mapped to a namespace yet: create it */
    +		namespaceOid = LoadNamespace(pxfItem->path, dboid);
    +		elog(DEBUG1, "No namespace found: %s. Generated new namespace oid: %u", pxfItem->path,
namespaceOid);
     	}
     	
    -	LoadHCatalogTable(namespaceOid, hcatalogTable);
    +	LoadTable(namespaceOid, pxfItem);
     }
     
     /*
    - * CreateHCatalogNamespace
    - * 		Create an entry for the given HCatalog namespace in the in-memory heap tables and
    + * LoadNamespace
    + * 		Create an entry for the given PXF namespace in the in-memory heap tables and
      * 		return the reserved namespace oid
      */
    -Oid LoadHCatalogNamespace(const char *namespaceName)
    +Oid LoadNamespace(const char *namespaceName, Oid dboid)
     {
    --- End diff --
    
    Good catch.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message