Browse Source

[metastore] Only return table sample when asked for it

Romain Rigaux 10 years ago
parent
commit
d933519
1 changed files with 1 additions and 1 deletions
  1. 1 1
      apps/metastore/src/metastore/views.py

+ 1 - 1
apps/metastore/src/metastore/views.py

@@ -234,7 +234,7 @@ def describe_table(request, database, table):
   if app_name != 'impala' and table.partition_keys:
     partitions = db.get_partitions(database, table, partition_spec=None, max_parts=None)
 
-  if request.REQUEST.get("format", "html") == "json":
+  if request.REQUEST.get("format", "html") == "json" and request.REQUEST.get("sample", "false") == "false":
     return JsonResponse({
         'status': 0,
         'partition_keys': [{'name': part.name, 'type': part.type} for part in table.partition_keys],