Sort directories query to ensure all parents appear before their subdirectories #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We hit a new issue related to CLAS12's CCDB database containing rows in the
directories
table that appear before their parent directory if left unsorted. My understanding of SQL is that that's perfectly normal and unavoidable.However, the corresponding query in the CCDB Java library isn't sorted, and the result is passed unsorted to the routine that generates the hierarchical directory structure, which assumes parent directories appear before their daughters.
This causes those subdirectories (and their contents) to be inaccessible via the Java CCDB library. Well, unless you strip off their parent directory in the request, e.g., what should be accessible as "/dog/cat/llama" is really accessible as "cat/llama", where "cat" appears before "dog" in the unsorted query.
Simply sorting the query addresses that issue, and from what I gather, it's just the right thing to do?
Note, the CCDB website and the
ccdb
python CLI do not appear to be affected similarly, and I didn't try very hard to understand why. But my quick look at the C++ code suggests it should be affected similarly to Java. Has GlueX ever seen this issue?