This is an automated email from the ASF dual-hosted git repository. joemcdonnell pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 4638a0e585a76e4a0b0aebf40eb7e4c34e2944d1 Author: Michael Smith <[email protected]> AuthorDate: Mon Oct 10 11:56:56 2022 -0700 IMPALA-11646 IMPALA-11562: Fix test_unsupported_text_compression in s3 Fixes test_unsupported_text_compression for S3 tests where hdfs_util.py was changed to expect a leading slash (and the pure HDFS implementation removes the leading slash). Skips removing the leading slash since HDFS now adds it and other filesystems expect the leading slash. Change-Id: I74724b2d5af0bd879d92d5e5febe92d01c972525 Reviewed-on: http://gerrit.cloudera.org:8080/19119 Reviewed-by: Joe McDonnell <[email protected]> Reviewed-by: Fang-Yu Rao <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- tests/metadata/test_partition_metadata.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/metadata/test_partition_metadata.py b/tests/metadata/test_partition_metadata.py index 0dd913182..47024b1d1 100644 --- a/tests/metadata/test_partition_metadata.py +++ b/tests/metadata/test_partition_metadata.py @@ -183,7 +183,7 @@ class TestPartitionMetadataUncompressedTextOnly(ImpalaTestSuite): lz4_year = 2009 lz4_month = 3 lz4_ym_partition_loc = self.__make_ym_partition_dir(TBL_LOCATION, lz4_year, lz4_month) - self.filesystem_client.create_file("{0}/fake.lz4".format(lz4_ym_partition_loc)[1:], + self.filesystem_client.create_file("{0}/fake.lz4".format(lz4_ym_partition_loc), "some test data") self.client.execute( "alter table {0} add partition (year={1}, month={2}) location '{3}'".format( @@ -195,7 +195,7 @@ class TestPartitionMetadataUncompressedTextOnly(ImpalaTestSuite): fake_comp_ym_partition_loc = self.__make_ym_partition_dir( TBL_LOCATION, fake_comp_year, fake_comp_month) self.filesystem_client.create_file( - "{0}/fake.fake_comp".format(fake_comp_ym_partition_loc)[1:], "fake compression") + "{0}/fake.fake_comp".format(fake_comp_ym_partition_loc), "fake compression") self.client.execute( "alter table {0} add partition (year={1}, month={2}) location '{3}'".format( FQ_TBL_NAME, fake_comp_year, fake_comp_month, fake_comp_ym_partition_loc)) @@ -204,7 +204,7 @@ class TestPartitionMetadataUncompressedTextOnly(ImpalaTestSuite): lzo_year = 2009 lzo_month = 5 lzo_ym_partition_loc = self.__make_ym_partition_dir(TBL_LOCATION, lzo_year, lzo_month) - self.filesystem_client.create_file("{0}/fake.lzo".format(lzo_ym_partition_loc)[1:], + self.filesystem_client.create_file("{0}/fake.lzo".format(lzo_ym_partition_loc), "some test data") self.client.execute( "alter table {0} add partition (year={1}, month={2}) location '{3}'".format( @@ -228,11 +228,11 @@ class TestPartitionMetadataUncompressedTextOnly(ImpalaTestSuite): """Create the year/month partition directory and return the path.""" y_partition_loc = "{0}/year={1}".format(tbl_location, year) ym_partition_loc = "{0}/month={1}".format(y_partition_loc, month) - if not self.filesystem_client.exists(tbl_location[1:]): - self.filesystem_client.make_dir(tbl_location[1:]) - if not self.filesystem_client.exists(y_partition_loc[1:]): - self.filesystem_client.make_dir(y_partition_loc[1:]) - if self.filesystem_client.exists(ym_partition_loc[1:]): - self.filesystem_client.delete_file_dir(ym_partition_loc[1:], recursive=True) - self.filesystem_client.make_dir(ym_partition_loc[1:]) + if not self.filesystem_client.exists(tbl_location): + self.filesystem_client.make_dir(tbl_location) + if not self.filesystem_client.exists(y_partition_loc): + self.filesystem_client.make_dir(y_partition_loc) + if self.filesystem_client.exists(ym_partition_loc): + self.filesystem_client.delete_file_dir(ym_partition_loc, recursive=True) + self.filesystem_client.make_dir(ym_partition_loc) return ym_partition_loc
