kyuubi/externals/kyuubi-spark-sql-engine
Kent Yao 352b4eb99e [KYUUBI #400] Implement a simpler toHiveString to convert spark row
![yaooqinn](https://badgen.net/badge/Hello/yaooqinn/green) [![Closes #400](https://badgen.net/badge/Preview/Closes%20%23400/blue)](https://github.com/yaooqinn/kyuubi/pull/400) ![192](https://badgen.net/badge/%2B/192/red) ![62](https://badgen.net/badge/-/62/green) ![9](https://badgen.net/badge/commits/9/yellow) ![Target Issue](https://badgen.net/badge/Missing/Target%20Issue/ff0000) ![Bug](https://badgen.net/badge/Label/Bug/) [&#10088;?&#10089;](https://pullrequestbadge.com/?utm_medium=github&utm_source=yaooqinn&utm_campaign=badge_info)<!-- PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/yaooqinn/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

Hive compatibility is essential! This PR tries to restore the previous behavior.

1. Not use Spark's internal class HiveResult to convert spark catalyst type-values to JDBC results, the interval APIs are not APIs and changed unexpectedly. It involves a lot of overhead. (For this reason, pan3793 and I propose a Casting way to solve it.)

2. Unfortunately, the casting way breaks things like #397. So this is a reverting PR.

3. I checked the spark `HiveResult` carefully, I noticed that the `nested` logic is not needed in Kyuubi as we already matched primitives ahead.
4. Also the date time formatter used in `HiveResult` is excessively packaged with massively complicated logic inside spark. It's not clear and simple enough to call.
5. (tiny breaking change)the trailing spaces of a timestamp in milliseconds may not be trimmed. But this is a correctness issue and acceptable.

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request

Closes #400 from yaooqinn/397.

388c86d [Kent Yao] nit
bbf458b [Kent Yao] time stamp formatter
e5a7436 [Kent Yao] more tests
83f3142 [Kent Yao] timezone
38f5a76 [Kent Yao] Merge branch 'master' into 397
563d69c [Kent Yao] mute flacky test
9d834b0 [Kent Yao] Merge branch 'master' into 397
e8e05b5 [Kent Yao] nit
2a2d47b [Kent Yao] Implement a simpler toHiveString to convert spark row

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: ulysses-you <ulyssesyou18@gmail.com>
2021-03-05 17:12:58 +08:00
..
src [KYUUBI #400] Implement a simpler toHiveString to convert spark row 2021-03-05 17:12:58 +08:00
pom.xml [KYUUBI #398] Move to hadoop shaded client 2021-03-04 23:33:31 +08:00