-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-27445][SQL][TEST] Update SQLQueryTestSuite to process files ending with .sql
#24333
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
Conversation
|
Test build #104467 has finished for PR 24333 at commit
|
|
retest this please |
|
Test build #104472 has finished for PR 24333 at commit
|
attilapiros
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy somebody thinks about vim users (like me) and the change is fine but I think a solution which combines backlisting with whitelisting would be better: like every file with ".sql" extension and not backlisted.
This way much more editors which creates temporary files here could be safe to be used.
Even would be better for Vim itself:
The more .%.swX files are created whenever there are .%.swp and .%.swo and .%.swY files, where X and Y are characters defined in order by Vim.
And this condition is already satisfied:
$ find sql/core/src/test/resources/sql-tests/inputs/ -type f | wc -l
107
$ find sql/core/src/test/resources/sql-tests/inputs/ -type f -name "*.sql" | wc -l
107
What is your opinion?
|
These files aren't in the repo, and a .swp file only exists if you have the file open in vim. I don't think we should work around it for this reason. However, white-listing .sql files seems cleaner anyway so I'm OK with that. |
7fc82d7 to
4c0f1bd
Compare
|
@attilapiros @srowen White-listing .sql files sounds good to me :-) |
| private def listFilesRecursively(path: File): Seq[File] = { | ||
| val (dirs, files) = path.listFiles().partition(_.isDirectory) | ||
| files ++ dirs.flatMap(listFilesRecursively) | ||
| val filteredFiles = files.filter (_.getName matches validTestFileExtensionsRegEx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid postfix syntax.
Not that it matters, but it is probably a little more efficient to make the regex a regex above with .r and then match with that pattern here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen Thanks.. Sure... I will make the change. I wanted to confirm one thing.. so initially i had it as a regex as i thought, it may be easier for us to add more extensions o than just .sql in the future. But if we are going to stay with .sql, should we just do a endsWith check instead ? WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All sounds fine. The regex could match more patterns later, or could be many regexes. Or could indeed just check for suffixes for now for simplicity and make it more complicated later.
|
Test build #104492 has finished for PR 24333 at commit
|
|
Test build #104493 has finished for PR 24333 at commit
|
|
Test build #104494 has finished for PR 24333 at commit
|
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the PR title since this becomes a general approach. (Not specifically for .swp and .swo)
|
@dongjoon-hyun Thanks.. I have updated the title and description. Did we need a JIRA for this change ? Initially since i just added couple of cases to ignore list, i hadn't created a JIRA. |
.sql
|
I updated the PR title, @dilipbiswal . Please create a JIRA with that title, too. Thanks! |
.sql.sql
.sql.sql
attilapiros
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending tests otherwise LGTM
|
Test build #104519 has finished for PR 24333 at commit
|
.sql.sql
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM. Merged to master.
Thank you, @dilipbiswal , @srowen , @attilapiros , @HyukjinKwon !
|
Thanks a lot @dongjoon-hyun @srowen @HyukjinKwon @attilapiros |
What changes were proposed in this pull request?
While using vi or vim to edit the test files the .swp or .swo files are created and attempt to run the test suite in the presence of these files causes errors like below :
This minor pr adds these temp files in the ignore list.While computing the list of test files to process, only consider files with
.sqlextension. This makes sure the unwanted temp files created from various editors are ignored from processing.How was this patch tested?
Verified manually.