Beispiel #1
0
    def test_partition_datetime_from_path_refined(self):
        expect = self.table_info['table2']['partitions_datetime'][0]
        path = self.table_info['table2']['partitions_path'][0]
        regex = r'.*/(year=.+)$'
        format = 'year=%Y/month=%m/day=%d/hour=%H'

        dt = HiveUtils.partition_datetime_from_path(path, regex, format)
        self.assertEqual(dt, expect)
Beispiel #2
0
    def test_partition_datetime_from_path_refined(self):
        expect = self.table_info['table2']['partitions_datetime'][0]
        path   = self.table_info['table2']['partitions_path'][0]
        regex  = r'.*/(year=.+)$'
        format ='year=%Y/month=%m/day=%d/hour=%H'

        dt     = HiveUtils.partition_datetime_from_path(path, regex, format)
        self.assertEqual(dt, expect)
Beispiel #3
0
    def test_partition_datetime_from_path_raw(self):
        expect = self.table_info['table1']['partitions_datetime'][0]
        path = self.table_info['table1']['partitions_path'][0]
        regex = r'.*/hourly/(.+)$'
        format = '%Y/%m/%d/%H'

        dt = HiveUtils.partition_datetime_from_path(path, regex, format)
        self.assertEqual(dt, expect)
Beispiel #4
0
    def test_partition_datetime_from_path_raw(self):
        expect = self.table_info['table1']['partitions_datetime'][0]
        path   = self.table_info['table1']['partitions_path'][0]
        regex  = r'.*/hourly/(.+)$'
        format = '%Y/%m/%d/%H'

        dt     = HiveUtils.partition_datetime_from_path(path, regex, format)
        self.assertEqual(dt, expect)