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

kdb ls produces additional keys #2456

Closed
kodebach opened this issue Mar 3, 2019 · 9 comments
Closed

kdb ls produces additional keys #2456

kodebach opened this issue Mar 3, 2019 · 9 comments
Labels

Comments

@kodebach
Copy link
Member

kodebach commented Mar 3, 2019

Steps to Reproduce the Problem

Have the spec plugin (global-)mounted and run:

kdb ls spec/tests/example

Expected Result

Only keys below spec/tests/example should be listed.

Actual Result

Cascading keys below /tests/example are also listed.

Further Comments

IMO kdb ls should never produce cascading keys, even if it is called with a cascading parent key. If I call kdb ls, I want to know about the actual keys present.

@markus2330
Copy link
Contributor

Thank you for reporting this problem. I fully agree!

Only with -v these keys should be part of the output.

@DaHopeman
Copy link
Contributor

I would like to do this as my first issue @markus2330

@markus2330
Copy link
Contributor

Good choice, this should be very easy. I assigned you.

@DaHopeman
Copy link
Contributor

@markus2330
I just want to make sure I understood the problem correctly:
using kdb ls should just list those keys that are directly in the given path and not "deeper down", right?
like this:
Screenshot from 2019-03-27 19-28-34

@markus2330
Copy link
Contributor

No, "deeper down" is a separate feature using -m and -M switches (man kdb ls). You should only filter out the keys which start with / and not filter the correct keys.

You get such keys by setting defaults:

kdb setmeta spec/tests/example default something
kdb ls spec/tests
#> spec/tests/example

Wanted output:

spec/tests/example

Current output:

/tests/example

Or also (maybe a different bug?):

kdb setmeta spec/tests/example default something
kdb ls spec/tests/example
#> spec/tests/example

Please also add test cases (the code above is already a shell recorder test, see tests/shell/shell_recorder/tutorial_wrapper/README.md)

@DaHopeman
Copy link
Contributor

I have modified the printResults method in my fork to filter out the keys which start with /.
I did not create a pull request however, because I am not sure if this is really the problem for this bug.

Using the input you mentioned above:

kdb setmeta spec/tests/example default something
kdb ls spec/tests

I get the following output:

/tests/example
spec/tests/example

I get both versions every time. Is this intentional or could there be a problem in the cut function, which is used to provide the Keyset for printResults?

@kodebach
Copy link
Member Author

could there be a problem in the cut function

Considering #2550 and that cur is also used in kdb rm, I agree that there probably is a bug in ksCut (the function underlying cut).

@markus2330
Copy link
Contributor

@kodebach is this resolved now?

@kodebach
Copy link
Member Author

As far as I can tell, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants