GitHub user cloud-fan opened a pull request:
https://github.com/apache/spark/pull/9497
[SQL][showcase] simplify encoder framework
Current we need to resolve, bind or rebind the encoder before use, which I
think is not a robust mechanism.
This PR shows that we can totally avoid the bind stuff and simplify the
encoder usage. To build the construct expression, we can use the type info to
bind field with ordinal directly(like what we did for tuple) instead of
depending on field name.
The only thing it breaks is the field reorder support. For example, a
internal row with schema `<a: Int, b: String>` can be decoded into `case class
(b: String, a: Int)`. However, I wanna argue that this feature is not very
useful and at least our internal execution doesn't need it.
cc @marmbrus @yhuai
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloud-fan/spark encoder
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/9497.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 #9497
----
commit ca491b70f0d0ebeb17f594a2ee402931a808cc1c
Author: Wenchen Fan <[email protected]>
Date: 2015-11-05T15:48:09Z
refactor encoder framework
----
---
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]