From a221785d161cbc3d8a91515573cedbeb5fce99d6 Mon Sep 17 00:00:00 2001 From: Sam An Date: Mon, 30 Mar 2020 18:12:55 -0700 Subject: [PATCH] MsckPartitionExpressionProxy should filter partitions Change-Id: I42da124c8da8045d7dc50a3389585798bdb5d073 --- .../MsckPartitionExpressionProxy.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java index d842825559..bc659ab74c 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java @@ -18,12 +18,18 @@ */ import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.FileMetadataExprType; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.ql.io.sarg.SearchArgument; +import org.apache.hadoop.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // This is added as part of moving MSCK code from ql to standalone-metastore. There is a metastore API to drop // partitions by name but we cannot use it because msck typically will contain partition value (year=2014). We almost @@ -36,6 +42,8 @@ // should use SearchArgument (storage-api) to construct the filter expression and not depend on ql, but the usecase // for msck is pretty simple and this specific implementation should suffice. public class MsckPartitionExpressionProxy implements PartitionExpressionProxy { + private static final Logger LOG = LoggerFactory.getLogger(MsckPartitionExpressionProxy.class); + @Override public String convertExprToFilter(final byte[] exprBytes, final String defaultPartitionName) throws MetaException { return new String(exprBytes, StandardCharsets.UTF_8); @@ -44,6 +52,38 @@ public String convertExprToFilter(final byte[] exprBytes, final String defaultPa @Override public boolean filterPartitionsByExpr(List partColumns, byte[] expr, String defaultPartitionName, List partitionNames) throws MetaException { + String partExpr = new String(expr, StandardCharsets.UTF_8); + LOG.debug(StringUtils.format("Partition expr: %s", expr)); + //This is to find in partitionNames all that match expr + //reverse of the Msck.makePartExpr + Set partValueSet = new HashSet<>(); + String[] parts = partExpr.split(" AND "); + for ( String part : parts){ + String[] colAndValue = part.split("="); + String key = colAndValue[0]; + String value = colAndValue[1].replace("'", ""); + partValueSet.add(key+"="+value); + } + + List partNamesSeq = new ArrayList<>(); + for (String partition : partitionNames){ + boolean isMatch = true; + for ( String col : partValueSet){ + if (partition.indexOf(col) == -1){ + isMatch = false; + break; + } + } + if (isMatch){ + partNamesSeq.add(partition); + } + } + partitionNames.clear(); + partitionNames.addAll(partNamesSeq); + LOG.info(StringUtils.format("The returned partition list is of size: %d", partitionNames.size())); + for(String s : partitionNames){ + LOG.debug("Matched partition: %s", s); + } return false; } -- 2.23.0 From 8659b6a923c9b3ec331b1484923834b072dce7bd Mon Sep 17 00:00:00 2001 From: Sam An Date: Wed, 1 Apr 2020 22:28:38 -0700 Subject: [PATCH] start unit test Change-Id: I34620093ba1aaac0156305dc9c15cad14b0e35c1 --- .../apache/hadoop/hive/metastore/Msck.java | 2 +- .../MsckPartitionExpressionProxy.java | 18 ++++++++---- .../metastore/TestPartitionManagement.java | 28 +++++++++++++++++++ 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java index fab83b6501..f4e109d1b0 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java @@ -394,7 +394,7 @@ public Void execute(int size) throws MetastoreException { }.run(); } - private static String makePartExpr(Map spec) + public static String makePartExpr(Map spec) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java index bc659ab74c..e53a709e00 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java @@ -26,6 +26,7 @@ import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.FileMetadataExprType; import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.metastore.utils.FileUtils; import org.apache.hadoop.hive.ql.io.sarg.SearchArgument; import org.apache.hadoop.util.StringUtils; import org.slf4j.Logger; @@ -53,15 +54,17 @@ public String convertExprToFilter(final byte[] exprBytes, final String defaultPa public boolean filterPartitionsByExpr(List partColumns, byte[] expr, String defaultPartitionName, List partitionNames) throws MetaException { String partExpr = new String(expr, StandardCharsets.UTF_8); - LOG.debug(StringUtils.format("Partition expr: %s", expr)); + if (LOG.isDebugEnabled()) { + LOG.debug("Partition expr: {}", expr); + } //This is to find in partitionNames all that match expr //reverse of the Msck.makePartExpr Set partValueSet = new HashSet<>(); String[] parts = partExpr.split(" AND "); for ( String part : parts){ String[] colAndValue = part.split("="); - String key = colAndValue[0]; - String value = colAndValue[1].replace("'", ""); + String key = FileUtils.unescapePathName(colAndValue[0]); + String value = FileUtils.unescapePathName(colAndValue[1].substring(1, colAndValue[1].length())); partValueSet.add(key+"="+value); } @@ -69,6 +72,9 @@ public boolean filterPartitionsByExpr(List partColumns, byte[] expr for (String partition : partitionNames){ boolean isMatch = true; for ( String col : partValueSet){ + //list of partitions [year=2001/month=1, year=2002/month=2, year=2001/month=3] + //Given expr: e.g. year='2001' AND month='1'. Only when all the expressions in the expr can be found, + //do we add the partition to the filtered result [year=2001/month=1] if (partition.indexOf(col) == -1){ isMatch = false; break; @@ -80,9 +86,11 @@ public boolean filterPartitionsByExpr(List partColumns, byte[] expr } partitionNames.clear(); partitionNames.addAll(partNamesSeq); - LOG.info(StringUtils.format("The returned partition list is of size: %d", partitionNames.size())); + LOG.info("The returned partition list is of size: {}", partitionNames.size()); for(String s : partitionNames){ - LOG.debug("Matched partition: %s", s); + if (LOG.isDebugEnabled()) { + LOG.debug("Matched partition: {}", s); + } } return false; } diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java index 1961a70cd7..3b58fb8c69 100644 --- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java +++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -40,6 +41,7 @@ import org.apache.hadoop.hive.metastore.annotation.MetastoreUnitTest; import org.apache.hadoop.hive.metastore.api.Catalog; import org.apache.hadoop.hive.metastore.api.Database; +import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.Partition; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants; @@ -669,4 +671,30 @@ public Column(final String colName, final String colType) { this.colType = colType; } } + + + @Test + public void testPartitionExpressionFilter(){ + String dbName = "db_repl1"; + String tableName = "tbl_repl1"; + Map colMap = buildAllColumns(); + List partKeys = Lists.newArrayList("state", "dt"); + List partKeyTypes = Lists.newArrayList("string", "date"); + List> partVals = Lists.newArrayList( + Lists.newArrayList("__HIVE_DEFAULT_PARTITION__", "1990-01-01"), + Lists.newArrayList("CA", "1986-04-28"), + Lists.newArrayList("MN", "2018-11-31")); + Map spec = new HashMap<>(); + spec.put("Year", "2020"); + spec.put("Month", "1"); + byte[] expr; + try { + String pe = Msck.makePartExpr(spec); + expr = pe.getBytes(StandardCharsets.UTF_8); + }catch (MetaException me){ + + } + + + } } -- 2.23.0 From 2400cdfd130e173bb74f1a70e0fac3c1301e504b Mon Sep 17 00:00:00 2001 From: Sam An Date: Sun, 5 Apr 2020 12:20:17 -0700 Subject: [PATCH] save work Change-Id: Ib5bff3047a0306c6cc2ac97ee27e877813d4a4e2 --- .../metastore/TestPartitionManagement.java | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java index 3b58fb8c69..1df2c2524f 100644 --- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java +++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java @@ -656,6 +656,45 @@ public void testNoPartitionRetentionForReplTarget() throws TException, Interrupt assertEquals(3, partitions.size()); } + @Test + public void testPartitionExprFilter() throws TException, IOException { + String dbName = "db4"; + String tableName = "tbl4"; + Map colMap = buildAllColumns(); + List partKeys = Lists.newArrayList("state", "dt"); + List partKeyTypes = Lists.newArrayList("string", "date"); + List> partVals = Lists.newArrayList( + Lists.newArrayList("__HIVE_DEFAULT_PARTITION__", "1990-01-01"), + Lists.newArrayList("CA", "1986-04-28"), + Lists.newArrayList("MN", "2018-11-31")); + createMetadata(DEFAULT_CATALOG_NAME, dbName, tableName, partKeys, partKeyTypes, partVals, colMap, false); + Table table = client.getTable(dbName, tableName); + List partitions = client.listPartitions(dbName, tableName, (short) -1); + assertEquals(3, partitions.size()); + String tableLocation = table.getSd().getLocation(); + URI location = URI.create(tableLocation); + Path tablePath = new Path(location); + FileSystem fs = FileSystem.get(location, conf); + Path newPart1 = new Path(tablePath, "state=WA/dt=2018-12-01"); + Path newPart2 = new Path(tablePath, "state=UT/dt=2018-12-02"); + fs.mkdirs(newPart1); + fs.mkdirs(newPart2); + assertEquals(5, fs.listStatus(tablePath).length); + table.getParameters().put(PartitionManagementTask.DISCOVER_PARTITIONS_TBLPROPERTY, "true"); + client.alter_table(dbName, tableName, table); + // no match for this db pattern, so we will see only 3 partitions + conf.set(MetastoreConf.ConfVars.PARTITION_MANAGEMENT_DATABASE_PATTERN.getVarname(), "*dbfoo*"); + runPartitionManagementTask(conf); + partitions = client.listPartitions(dbName, tableName, (short) -1); + assertEquals(3, partitions.size()); + + // matching db pattern, we will see all 5 partitions now + conf.set(MetastoreConf.ConfVars.PARTITION_MANAGEMENT_DATABASE_PATTERN.getVarname(), "*db4*"); + runPartitionManagementTask(conf); + partitions = client.listPartitions(dbName, tableName, (short) -1); + assertEquals(5, partitions.size()); + } + private void runPartitionManagementTask(Configuration conf) { PartitionManagementTask task = new PartitionManagementTask(); task.setConf(conf); @@ -673,28 +712,4 @@ public Column(final String colName, final String colType) { } - @Test - public void testPartitionExpressionFilter(){ - String dbName = "db_repl1"; - String tableName = "tbl_repl1"; - Map colMap = buildAllColumns(); - List partKeys = Lists.newArrayList("state", "dt"); - List partKeyTypes = Lists.newArrayList("string", "date"); - List> partVals = Lists.newArrayList( - Lists.newArrayList("__HIVE_DEFAULT_PARTITION__", "1990-01-01"), - Lists.newArrayList("CA", "1986-04-28"), - Lists.newArrayList("MN", "2018-11-31")); - Map spec = new HashMap<>(); - spec.put("Year", "2020"); - spec.put("Month", "1"); - byte[] expr; - try { - String pe = Msck.makePartExpr(spec); - expr = pe.getBytes(StandardCharsets.UTF_8); - }catch (MetaException me){ - - } - - - } } -- 2.23.0 From 0efb80fec4d42cb281dbba4144bda618d92bc7dc Mon Sep 17 00:00:00 2001 From: Sam An Date: Sun, 5 Apr 2020 17:41:26 -0700 Subject: [PATCH] add unit test Change-Id: I64064fa1209dfbd0c5f864f674eeca18958731f1 --- .../MsckPartitionExpressionProxy.java | 3 +- .../metastore/TestPartitionManagement.java | 31 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java index e53a709e00..11ca1fd8b9 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java @@ -64,7 +64,8 @@ public boolean filterPartitionsByExpr(List partColumns, byte[] expr for ( String part : parts){ String[] colAndValue = part.split("="); String key = FileUtils.unescapePathName(colAndValue[0]); - String value = FileUtils.unescapePathName(colAndValue[1].substring(1, colAndValue[1].length())); + //take the value inside without the single quote marks '2018-10-30' becomes 2018-10-31 + String value = FileUtils.unescapePathName(colAndValue[1].substring(1, colAndValue[1].length()-1)); partValueSet.add(key+"="+value); } diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java index 1df2c2524f..0813dba252 100644 --- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java +++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java @@ -658,8 +658,8 @@ public void testNoPartitionRetentionForReplTarget() throws TException, Interrupt @Test public void testPartitionExprFilter() throws TException, IOException { - String dbName = "db4"; - String tableName = "tbl4"; + String dbName = "db10"; + String tableName = "tbl10"; Map colMap = buildAllColumns(); List partKeys = Lists.newArrayList("state", "dt"); List partKeyTypes = Lists.newArrayList("string", "date"); @@ -669,30 +669,27 @@ public void testPartitionExprFilter() throws TException, IOException { Lists.newArrayList("MN", "2018-11-31")); createMetadata(DEFAULT_CATALOG_NAME, dbName, tableName, partKeys, partKeyTypes, partVals, colMap, false); Table table = client.getTable(dbName, tableName); + + table.getParameters().put(PartitionManagementTask.DISCOVER_PARTITIONS_TBLPROPERTY, "true"); + table.getParameters().put("EXTERNAL", "true"); + table.setTableType(TableType.EXTERNAL_TABLE.name()); + client.alter_table(dbName, tableName, table); + List partitions = client.listPartitions(dbName, tableName, (short) -1); assertEquals(3, partitions.size()); + String tableLocation = table.getSd().getLocation(); URI location = URI.create(tableLocation); Path tablePath = new Path(location); FileSystem fs = FileSystem.get(location, conf); - Path newPart1 = new Path(tablePath, "state=WA/dt=2018-12-01"); - Path newPart2 = new Path(tablePath, "state=UT/dt=2018-12-02"); - fs.mkdirs(newPart1); - fs.mkdirs(newPart2); - assertEquals(5, fs.listStatus(tablePath).length); - table.getParameters().put(PartitionManagementTask.DISCOVER_PARTITIONS_TBLPROPERTY, "true"); - client.alter_table(dbName, tableName, table); - // no match for this db pattern, so we will see only 3 partitions - conf.set(MetastoreConf.ConfVars.PARTITION_MANAGEMENT_DATABASE_PATTERN.getVarname(), "*dbfoo*"); - runPartitionManagementTask(conf); - partitions = client.listPartitions(dbName, tableName, (short) -1); - assertEquals(3, partitions.size()); + Path newPart1 = new Path(tablePath, "state=MN/dt=2018-11-31"); + fs.delete(newPart1); - // matching db pattern, we will see all 5 partitions now - conf.set(MetastoreConf.ConfVars.PARTITION_MANAGEMENT_DATABASE_PATTERN.getVarname(), "*db4*"); + conf.set(MetastoreConf.ConfVars.PARTITION_MANAGEMENT_DATABASE_PATTERN.getVarname(), "*db10*"); + conf.set(ConfVars.PARTITION_MANAGEMENT_TABLE_TYPES.getVarname(), TableType.EXTERNAL_TABLE.name()); runPartitionManagementTask(conf); partitions = client.listPartitions(dbName, tableName, (short) -1); - assertEquals(5, partitions.size()); + assertEquals(2, partitions.size()); } private void runPartitionManagementTask(Configuration conf) { -- 2.23.0 From ff35eece8fbfc38c0bd4db9b124f88f94c927640 Mon Sep 17 00:00:00 2001 From: Sam An Date: Mon, 6 Apr 2020 16:51:10 -0700 Subject: [PATCH] Timestamp unit test case, and use exact match instead of substring match --- .../metastore/MsckPartitionExpressionProxy.java | 11 ++++++----- .../hive/metastore/TestPartitionManagement.java | 14 ++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java index 11ca1fd8b9..bdf9e134d1 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java @@ -72,11 +72,12 @@ public boolean filterPartitionsByExpr(List partColumns, byte[] expr List partNamesSeq = new ArrayList<>(); for (String partition : partitionNames){ boolean isMatch = true; - for ( String col : partValueSet){ - //list of partitions [year=2001/month=1, year=2002/month=2, year=2001/month=3] - //Given expr: e.g. year='2001' AND month='1'. Only when all the expressions in the expr can be found, - //do we add the partition to the filtered result [year=2001/month=1] - if (partition.indexOf(col) == -1){ + //list of partitions [year=2001/month=1, year=2002/month=2, year=2001/month=3] + //Given expr: e.g. year='2001' AND month='1'. Only when all the expressions in the expr can be found, + //do we add the partition to the filtered result [year=2001/month=1] + String [] partnames = partition.split("/"); + for (String part: partnames) { + if (!partValueSet.contains(FileUtils.unescapePathName(part))){ isMatch = false; break; } diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java index 0813dba252..732d7eefea 100644 --- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java +++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionManagement.java @@ -661,12 +661,13 @@ public void testPartitionExprFilter() throws TException, IOException { String dbName = "db10"; String tableName = "tbl10"; Map colMap = buildAllColumns(); - List partKeys = Lists.newArrayList("state", "dt"); - List partKeyTypes = Lists.newArrayList("string", "date"); + List partKeys = Lists.newArrayList("state", "dt", "modts"); + List partKeyTypes = Lists.newArrayList("string", "date", "timestamp"); + List> partVals = Lists.newArrayList( - Lists.newArrayList("__HIVE_DEFAULT_PARTITION__", "1990-01-01"), - Lists.newArrayList("CA", "1986-04-28"), - Lists.newArrayList("MN", "2018-11-31")); + Lists.newArrayList("__HIVE_DEFAULT_PARTITION__", "1990-01-01", "__HIVE_DEFAULT_PARTITION__"), + Lists.newArrayList("CA", "1986-04-28", "2020-02-21 08:30:01"), + Lists.newArrayList("MN", "2018-11-31", "2020-02-21 08:19:01")); createMetadata(DEFAULT_CATALOG_NAME, dbName, tableName, partKeys, partKeyTypes, partVals, colMap, false); Table table = client.getTable(dbName, tableName); @@ -682,7 +683,8 @@ public void testPartitionExprFilter() throws TException, IOException { URI location = URI.create(tableLocation); Path tablePath = new Path(location); FileSystem fs = FileSystem.get(location, conf); - Path newPart1 = new Path(tablePath, "state=MN/dt=2018-11-31"); + String partPath = partitions.get(1).getSd().getLocation(); + Path newPart1 = new Path(tablePath, partPath); fs.delete(newPart1); conf.set(MetastoreConf.ConfVars.PARTITION_MANAGEMENT_DATABASE_PATTERN.getVarname(), "*db10*"); -- 2.23.0 From 5201bbc192340ed8b14a80bb7a40753f229145db Mon Sep 17 00:00:00 2001 From: Sam An Date: Mon, 6 Apr 2020 17:01:52 -0700 Subject: [PATCH] if statement outside --- .../hadoop/hive/metastore/MsckPartitionExpressionProxy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java index bdf9e134d1..f9f0c86bfa 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MsckPartitionExpressionProxy.java @@ -89,8 +89,8 @@ public boolean filterPartitionsByExpr(List partColumns, byte[] expr partitionNames.clear(); partitionNames.addAll(partNamesSeq); LOG.info("The returned partition list is of size: {}", partitionNames.size()); - for(String s : partitionNames){ - if (LOG.isDebugEnabled()) { + if (LOG.isDebugEnabled()) { + for(String s : partitionNames){ LOG.debug("Matched partition: {}", s); } } -- 2.23.0