-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql, tests: change empty strings rendering in sqllogictest suite #17162
Conversation
Cool. Can you please check your implementation against the test files that get run by the |
Yes, I'll have a look. |
I sure hope you knew about the Review status: 0 of 40 files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from Reviewable |
Thanks for the hard work. I am not completely fond of the approach taken. Regarding the bigtest I would be surprised if it passes.
Should you go forward with your current approach I have two requests however:
Reviewed 1 of 1 files at r1. Comments from Reviewable |
@RaduBerinde I wasn't smart enough to read the code, so I have to reinvent the wheel ;) Thankfully, it didn't take much time. Regarding # ramp @ thinkpad430s in ~/soft/go/src/github.com/cockroachdb/cockroach on git:issue17134 x [18:56:37]
$ make testlogic
GOPATH set to /home/ramp/soft/go
Running make with -j4
Running make with -j4
cd pkg/sql/logictest && logictest.test -test.run "TestLogic" -test.v -bigtest
I170724 18:58:08.244535 1 rand.go:76 Random seed: 4101253071964275013
... (omitted)
# ramp @ thinkpad430s in ~/soft/go/src/github.com/cockroachdb/cockroach on git:issue17134 x [19:40:29]
$ echo $?
0 However, since you were suspecting them to fail, I think now that probably I wasn't running it correctly. I've changed Makefile to always include Next, my intention was to try to comply with original ref spec. However, I'm completely flexible with a solution. Right now the problem is with empty string value being either at the first or the last position. I can come with different approach if other criterion is better than sqlite spec compliance. |
This is the way to run
and
It should take a while to run. It's possible that there are no empty cases in the bigtest. Review status: 1 of 40 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/sql/logictest/testdata/logic_test/aggregate, line 256 at r2 (raw file):
All these lines have extra whitespaces at the end, which can be annoying when editing, and more importantly this will generate a lot of diffs next time someone uses Comments from Reviewable |
Review status: 1 of 40 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/sql/logictest/testdata/logic_test/aggregate, line 256 at r2 (raw file): Previously, RaduBerinde wrote…
Sure, it's already on my TODO list. I planned to wait for more feedback and probably revert previous commit first so it be easier to review. Comments from Reviewable |
Different invocation options didn't change the result I'm getting: # ramp @ thinkpad430s in ~/soft/go/src/github.com/cockroachdb/cockroach on git:issue17134 x [12:34:15]
$ make test TESTFLAGS="-v -bigtest -config default" TESTTIMEOUT='24h' PKG='./pkg/sql/logictest' TESTS='^TestLogic$$'
... (omitting most output)
PASS
ok github.com/cockroachdb/cockroach/pkg/sql/logictest 2548.112s I've also rebased the branch (to resolve the conflict) and included only the commit with generated files by For now I didn't changed the solution. Waiting for more feedback on it. |
I'll let @knz have the final word on this. The only thing that's not great is that the output of |
So overall I'm happy if the Regarding the remaining I am still concerned about readability, and my previous request stands: use another string than " Reviewed 1 of 39 files at r4. Comments from Reviewable |
How about "∅" (empty set) or "␀" (nul symbol)? I'd prefer the former as the latter is a bit hard to read. Review status: 2 of 40 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful. Comments from Reviewable |
Middle dot symbol is a better alternative to an "(empty)" because it looks nicer. Test files were changed with `-rewrite-results-in-testfiles`.
This looks good, but please squash the two commits together before we can merge this PR. Review status: 0 of 41 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful. Comments from Reviewable |
Excellent! Thanks for your contribution! |
Thanks for accepting! |
Right now empty string values are not rendered as documentation suggests:
Some problems arise with empty strings. Sometimes empty string is not added to the row (while parsing test file and query result), and sorting sorts "interleaved" rows instead (because it expects 5 columns and get only 4 thus taking 1 element from neighbor row). Simple fix solves that but requires to rewrite logictest files.
This PR renders empty strings with "(empty)" and modifies all logic test files to make tests pass.
Closes #17134.