@@ -1013,10 +1013,6 @@ private List<Partition> getPartitionsByNames(String catName, String dbName,
10131013 throws MetaException {
10141014 // Get most of the fields for the partNames provided.
10151015 // Assume db and table names are the same for all partition, as provided in arguments.
1016- String quotedPartNames = partNameList .stream ()
1017- .map (DirectSqlUpdatePart ::quoteString )
1018- .collect (Collectors .joining ("," ));
1019-
10201016 String queryText =
10211017 "select " + PARTITIONS + ".\" PART_ID\" ," + SDS + ".\" SD_ID\" ," + SDS + ".\" CD_ID\" ,"
10221018 + SERDES + ".\" SERDE_ID\" ," + PARTITIONS + ".\" CREATE_TIME\" ," + PARTITIONS
@@ -1028,12 +1024,12 @@ private List<Partition> getPartitionsByNames(String catName, String dbName,
10281024 + " left outer join " + SERDES + " on " + SDS + ".\" SERDE_ID\" = " + SERDES + ".\" SERDE_ID\" "
10291025 + " inner join " + TBLS + " on " + TBLS + ".\" TBL_ID\" = " + PARTITIONS + ".\" TBL_ID\" "
10301026 + " inner join " + DBS + " on " + DBS + ".\" DB_ID\" = " + TBLS + ".\" DB_ID\" "
1031- + " where \" PART_NAME\" in (" + quotedPartNames + ") "
1027+ + " where \" PART_NAME\" in (" + makeParams ( partNameList . size ()) + ") "
10321028 + " and " + TBLS + ".\" TBL_NAME\" = ? and " + DBS + ".\" NAME\" = ? and " + DBS
10331029 + ".\" CTLG_NAME\" = ? order by \" PART_NAME\" asc" ;
1034-
1035- Object [] params = new Object []{ tblName , dbName , catName } ;
1036- return getPartitionsByQuery (catName , dbName , tblName , queryText , params , isAcidTable , args );
1030+ List params = new ArrayList <>( partNameList );
1031+ params . addAll ( List . of ( tblName , dbName , catName )) ;
1032+ return getPartitionsByQuery (catName , dbName , tblName , queryText , params . toArray () , isAcidTable , args );
10371033 }
10381034
10391035 private List <Partition > getPartitionsByPartitionIdsInBatch (String catName , String dbName ,
0 commit comments