Skip to content

Commit

Permalink
Obtain safely a sibling location
Browse files Browse the repository at this point in the history
  • Loading branch information
findinpath authored and findepi committed Jul 21, 2023
1 parent cb27662 commit 4ce5f46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public boolean isUnsafe()
public void write(ConnectorSession session, String clusterId, Location newLogEntryPath, byte[] entryContents)
{
TrinoFileSystem fileSystem = fileSystemFactory.create(session);
Location locksDirectory = newLogEntryPath.parentDirectory().appendPath(LOCK_DIRECTORY);
Location locksDirectory = newLogEntryPath.sibling(LOCK_DIRECTORY);
String newEntryFilename = newLogEntryPath.fileName();
Optional<LockInfo> myLockInfo = Optional.empty();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static long getPrecedingRowCount(
long rowCount = 0;
for (OriginalFileInfo originalFileInfo : originalFileInfos) {
if (originalFileInfo.getName().compareTo(splitPath.fileName()) < 0) {
Location path = splitPath.parentDirectory().appendPath(originalFileInfo.getName());
Location path = splitPath.sibling(originalFileInfo.getName());
TrinoInputFile inputFile = fileSystemFactory.create(identity)
.newInputFile(path, originalFileInfo.getFileSize());
rowCount += getRowsInFile(inputFile, options, stats);
Expand Down

0 comments on commit 4ce5f46

Please sign in to comment.