Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/14620#discussion_r74621246
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ParserUtilsSuite.scala
---
@@ -61,5 +88,39 @@ class ParserUtilsSuite extends SparkFunSuite {
// scalastyle:on nonascii
}
- // TODO: Add test cases for other methods in ParserUtils
+ test("command") {
+ assert(command(setConfContext) == "set
example.setting.name=setting.value")
+ assert(command(showFuncContext) == "show functions foo.bar")
+ assert(command(descFuncContext) == "describe function extended bar")
+ assert(command(showDbsContext) == "show databases like
'identifier_with_wildcards'")
+ }
+
+ test("source") {
+ assert(source(setConfContext) == "set
example.setting.name=setting.value")
+ assert(source(showFuncContext) == "show functions foo.bar")
+ assert(source(descFuncContext) == "describe function extended bar")
+ assert(source(showDbsContext) == "show databases like
'identifier_with_wildcards'")
+ }
+
+ test("remainder") {
+ assert(remainder(setConfContext) == "")
+ assert(remainder(showFuncContext) == "")
+ assert(remainder(descFuncContext) == "")
+ assert(remainder(showDbsContext) == "")
+
+ assert(remainder(setConfContext.SET.getSymbol) == "
example.setting.name=setting.value")
+ assert(remainder(showFuncContext.FUNCTIONS.getSymbol) == " foo.bar")
+ assert(remainder(descFuncContext.EXTENDED.getSymbol) == " bar")
+ assert(remainder(showDbsContext.LIKE.getSymbol) == "
'identifier_with_wildcards'")
+ }
+
+ test("string") {
+ assert(string(showDbsContext.pattern) == "identifier_with_wildcards")
--- End diff --
Could you also add a test for the other `string(node: TerminalNode)` code
path?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]