GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/11963
[MINOR][SQL] Fix substr/substring testcases.
## What changes were proposed in this pull request?
This PR fixes the following two testcases in order to test the correct
usages.
```
checkSqlGeneration("SELECT substr('This is a test', 'is')")
checkSqlGeneration("SELECT substring('This is a test', 'is')")
```
Actually, the testcases works but tests on exceptional cases.
```
scala> sql("SELECT substr('This is a test', 'is')")
res0: org.apache.spark.sql.DataFrame = [substring(This is a test, CAST(is
AS INT), 2147483647): string]
scala> sql("SELECT substr('This is a test', 'is')").collect()
res1: Array[org.apache.spark.sql.Row] = Array([null])
```
## How was this patch tested?
Pass the modified unit tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark fix_substr_testcase
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11963.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11963
----
commit 758a8a8c704ccd9d1471658ac9f26fb2ba8ec459
Author: Dongjoon Hyun <[email protected]>
Date: 2016-03-25T19:18:28Z
[MINOR][SQL] Fix substr/substring testcases.
----
---
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]