Community Articles

Find and share helpful community-sourced technical articles.
Labels (2)
avatar

Issue:

Supposedly if the table has large no of partitions in the order of 2800 or above and you wanted the API call to return all the partitions of the table in JSON format then you'll end up with the above error

API:

curl --negotiate -u: http://mrt1.openstacklocal:50111/templeton/v1/ddl/database/<db name>/table/<table name>/partition > /tmp/partition_json

Resolution:

The error message is not because of the no. of partitions in the table. JSON responses are limited to 1MB in size. Responses over this limit must be stored into HDFS using provided options instead of being directly returned.

Workaround:

You can use HCatalog, if your DDL command return results greater than 1MB

/usr/hdp/<hdp version>/hive/bin/hcat -e "use <dbname>; show partitions <tablename>; " -D hive.ddl.output.format=json -D hive.format=json -D hive.metastore.token.signature=hcat -D proxy.user.name=<username>

Reference:

https://cwiki.apache.org/confluence/display/Hive/WebHCat+UsingWebHCat

785 Views
0 Kudos