@@ -173,9 +173,9 @@ public DataFilePathFactory createDataFilePathFactory(BinaryRow partition, int bu
173173 createExternalPathProvider (partition , bucket ));
174174 }
175175
176- public DataFilePathFactory createFormatTableDataFilePathFactory (BinaryRow partition ) {
176+ public DataFilePathFactory createFormatTableDataFilePathFactory (BinaryRow partition , boolean onlyValue ) {
177177 return new DataFilePathFactory (
178- partitionPath (partition ),
178+ partitionPath (partition , onlyValue ),
179179 formatIdentifier ,
180180 dataFilePrefix ,
181181 changelogFilePrefix ,
@@ -184,6 +184,14 @@ public DataFilePathFactory createFormatTableDataFilePathFactory(BinaryRow partit
184184 createExternalPartitionPathProvider (partition ));
185185 }
186186
187+ private ExternalPathProvider createExternalPartitionPathProvider (BinaryRow partition , boolean onlyValue ) {
188+ if (externalPaths == null || externalPaths .isEmpty ()) {
189+ return null ;
190+ }
191+
192+ return new ExternalPathProvider (externalPaths , partitionPath (partition , onlyValue ));
193+ }
194+
187195 private ExternalPathProvider createExternalPartitionPathProvider (BinaryRow partition ) {
188196 if (externalPaths == null || externalPaths .isEmpty ()) {
189197 return null ;
@@ -192,9 +200,9 @@ private ExternalPathProvider createExternalPartitionPathProvider(BinaryRow parti
192200 return new ExternalPathProvider (externalPaths , partitionPath (partition ));
193201 }
194202
195- public Path partitionPath (BinaryRow partition ) {
203+ private Path partitionPath (BinaryRow partition , boolean onlyValue ) {
196204 Path relativeBucketPath = null ;
197- String partitionPath = getPartitionString (partition );
205+ String partitionPath = getPartitionString (partition , onlyValue );
198206 if (!partitionPath .isEmpty ()) {
199207 relativeBucketPath = new Path (partitionPath );
200208 }
@@ -207,6 +215,10 @@ public Path partitionPath(BinaryRow partition) {
207215 return relativeBucketPath != null ? new Path (root , relativeBucketPath ) : root ;
208216 }
209217
218+ public Path partitionPath (BinaryRow partition ) {
219+ return partitionPath (partition , false );
220+ }
221+
210222 @ Nullable
211223 private ExternalPathProvider createExternalPathProvider (BinaryRow partition , int bucket ) {
212224 if (externalPaths == null || externalPaths .isEmpty ()) {
@@ -248,6 +260,17 @@ public String getPartitionString(BinaryRow partition) {
248260 partition , "Partition row data is null. This is unexpected." )));
249261 }
250262
263+ public String getPartitionString (BinaryRow partition , boolean onlyValue ) {
264+ return PartitionPathUtils .generatePartitionPathUtil (
265+ partitionComputer .generatePartValues (
266+ Preconditions .checkNotNull (
267+ partition , "Partition row data is null. This is unexpected." )),
268+ onlyValue
269+ );
270+ }
271+
272+
273+
251274 // @TODO, need to be changed
252275 public List <Path > getHierarchicalPartitionPath (BinaryRow partition ) {
253276 return PartitionPathUtils .generateHierarchicalPartitionPaths (
0 commit comments