Example #1
0
    def test_alter_partition(self):
        self.catalog.create_database(self.db1, self.create_db(), False)
        self.catalog.create_table(self.path1, self.create_partitioned_table(),
                                  False)
        self.catalog.create_partition(self.path1, self.create_partition_spec(),
                                      self.create_partition(), False)

        cp = self.catalog.get_partition(self.path1,
                                        self.create_partition_spec())
        self.check_catalog_partition_equals(self.create_partition(), cp)
        self.assertIsNone(cp.get_properties().get("k"))

        gateway = get_gateway()
        j_partition = gateway.jvm.GenericCatalogPartition(
            {
                "is_streaming": "false",
                "k": "v"
            }, "Generic batch table")
        another = CatalogPartition(j_partition)
        self.catalog.alter_partition(self.path1, self.create_partition_spec(),
                                     another, False)

        cp = self.catalog.get_partition(self.path1,
                                        self.create_partition_spec())
        self.check_catalog_partition_equals(another, cp)
        self.assertEqual("v", cp.get_properties().get("k"))
Example #2
0
    def test_alter_partition(self):
        self.catalog.create_database(self.db1, self.create_db(), False)
        self.catalog.create_table(self.path1, self.create_partitioned_table(), False)
        self.catalog.create_partition(self.path1, self.create_partition_spec(),
                                      self.create_partition(), False)

        cp = self.catalog.get_partition(self.path1, self.create_partition_spec())
        self.check_catalog_partition_equals(self.create_partition(), cp)
        self.assertIsNone(cp.get_properties().get("k"))

        another = CatalogPartition.create_instance(
            {"is_streaming": "false", "k": "v"}, "catalog partition")
        self.catalog.alter_partition(self.path1, self.create_partition_spec(), another, False)

        cp = self.catalog.get_partition(self.path1, self.create_partition_spec())
        self.check_catalog_partition_equals(another, cp)
        self.assertEqual("v", cp.get_properties().get("k"))
Example #3
0
 def create_partition():
     gateway = get_gateway()
     j_partition = gateway.jvm.GenericCatalogPartition(
         CatalogTestBase.get_batch_table_properties(),
         "Generic batch table")
     return CatalogPartition(j_partition)
Example #4
0
 def create_partition():
     gateway = get_gateway()
     j_partition = gateway.jvm.CatalogPartitionImpl(
         CatalogTestBase.get_batch_table_properties(),
         "catalog partition tests")
     return CatalogPartition(j_partition)
Example #5
0
 def create_partition():
     return CatalogPartition.create_instance(
         CatalogTestBase.get_batch_table_properties(),
         "catalog partition tests")