[
https://issues.apache.org/jira/browse/HIVE-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844717#action_12844717
]
Paul Yang commented on HIVE-1238:
---------------------------------
Two questions were raised in an offline discussion:
1. Can we use null instead of an empty string when specifying wildcard values
of a partial partition specification?
Allowing nulls in in the list seems result in errors in the generated python
code. In particular, the part_vals is iterated through and writeString() is
called for each element. This results in an error when the string is None.
Seems like an issue with thrift...
{code}
File "./ThriftHiveMetastore-remote", line 269, in <module>
pp.pprint(client.get_partition_names_ps('default', 'srcpart', [None, '12'],
-1))
File "/tmp/nulltest/ThriftHiveMetastore.py", line 1164, in
get_partition_names_ps
self.send_get_partition_names_ps(db_name, tbl_name, part_vals, max_parts)
File "/tmp/nulltest/ThriftHiveMetastore.py", line 1174, in
send_get_partition_names_ps
args.write(self._oprot)
File "/tmp/nulltest/ThriftHiveMetastore.py", line 5673, in write
oprot.writeString(iter193)
File
"/usr/local/lib/python2.6/site-packages/thrift/protocol/TBinaryProtocol.py",
line 111, in writeString
self.writeI32(len(str))
TypeError: object of type 'NoneType' has no len()
{code}
2. Can dropping partitions in DDLTask.dropTable() be refactored to use
get_partition_names_ps()?
Currently, drop partition first gets a list of all the partition names and then
filters the list for for names that match the partition specification. Even
though the user may have specified multiple partition specifications, only a
single call to get_partition_names is needed. If we use
get_partition_names_ps(), it would need to be called for each partition
specification that the user specified.
> Get partitions with a partial specification
> --------------------------------------------
>
> Key: HIVE-1238
> URL: https://issues.apache.org/jira/browse/HIVE-1238
> Project: Hadoop Hive
> Issue Type: New Feature
> Components: Metastore
> Reporter: Paul Yang
> Assignee: Paul Yang
> Fix For: 0.6.0
>
> Attachments: HIVE-1238.1.patch
>
>
> Currently, the metastore API only allows retrieval of all the partitions of a
> table, or the retrieval of a single partition given a complete partition
> specification. For HIVE-936, a method to retrieve all partitions that match a
> partial partition specification would be useful.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.