示例#1
0
 def test_init_from_hive_spec(self):
     partition_spec = HiveUtils.partition_spec_from_partition_desc(
         self.partition_desc)
     hive_partition = HivePartition(partition_spec)
     should_be = [('datacenter', 'eqiad'), ('year', '2017'),
                  ('month', '11'), ('day', '2'), ('hour', '16')]
     self.assertEqual(hive_partition.items(), should_be)
示例#2
0
    def test_partition_spec_from_partition_desc(self):
        expect = self.table_info['table1']['partitions_spec'][0]

        spec = HiveUtils.partition_spec_from_partition_desc(
            self.table_info['table1']['partitions_desc'][0])
        self.assertEqual(spec, expect)