Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FILE_SEARCH_AT Order in Level 4 #7

Open
vinlin24 opened this issue Sep 24, 2024 · 0 comments
Open

FILE_SEARCH_AT Order in Level 4 #7

vinlin24 opened this issue Sep 24, 2024 · 0 comments

Comments

@vinlin24
Copy link

The tested operations for Level 4:

self.test_data_4 = [
    ["FILE_UPLOAD_AT", "2021-07-01T12:00:00", "Initial.txt", "100kb"], 
    ["FILE_UPLOAD_AT", "2021-07-01T12:05:00", "Update1.txt", "150kb", 3600], 
    ["FILE_GET_AT", "2021-07-01T12:10:00", "Initial.txt"], 
    ["FILE_COPY_AT", "2021-07-01T12:15:00", "Update1.txt", "Update1Copy.txt"], 
    ["FILE_UPLOAD_AT", "2021-07-01T12:20:00", "Update2.txt", "200kb", 1800], 
    ["ROLLBACK", "2021-07-01T12:10:00"], 
    ["FILE_GET_AT", "2021-07-01T12:25:00", "Update1.txt"], 
    ["FILE_GET_AT", "2021-07-01T12:25:00", "Initial.txt"], 
    ["FILE_SEARCH_AT", "2021-07-01T12:25:00", "Up"],
    ["FILE_GET_AT", "2021-07-01T12:25:00", "Update2.txt"]
]

And the expected output for the FILE_SEARCH_AT operation:

found at [Update1.txt, Update1Copy.txt, Update2.txt]

Why is Update2.txt at the end? According to the description of FILE_SEARCH from Level 2:

  • FILE_SEARCH(prefix)
    • Find top 10 files starting with the provided prefix. Order results by their size in descending order, and in case of a tie by file name.

Sorting by size descending is the primary sort key. From the test data, Update2.txt has the largest size (200 kB), followed by Update1.txt and UpdateCopy.txt (150 kB, which are themselves ordered ascending by their name as the secondary sort key).

Should the expected output not instead be:

found at [Update2.txt, Update1.txt, Update1Copy.txt]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant