Skip to content
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

Support for standard java.lang primitive types #6

Open
rdsr opened this issue Jan 30, 2019 · 0 comments
Open

Support for standard java.lang primitive types #6

rdsr opened this issue Jan 30, 2019 · 0 comments

Comments

@rdsr
Copy link

rdsr commented Jan 30, 2019

Filing this ticket to investigate if we can have support for java.lang primitive types.

Today we have limited set of specialized primitive datatypes e.g StdString, StdLong, StdInt. These specialized types have no methods associated with them and are inferior to standard JVM types like String, Int and Long. A user writing a UDF with a primitive type arg will always want to use the standard jvm type, since they are easy to work with having a set of familiar methods (e.g consider the String class) and everyone understands them better [e.g String, Int, Long are very well understood and used throughout].

Also, as and when we add support for newer primitive datatypes, it will become more challenging to roll our own wrapper classes for Decimal, Date, Binary etc.

There is no performance concern here as users working on primitive types will always 'realize' the underlying primitive object into a standard jvm type. The performance may also be slightly better as we are not creating wrapper classes for them.

I've tried a prototype for Spark using standard JVM primitive types as shown here https://github.com/rdsr/t2/blob/master/examples/src/main/java/t2/examples/Add.java and the results look encouraging. The code is also much easier to read [without the specialized primitive wrapper]

@rdsr rdsr changed the title Better support for primitive types Support for standard Java primitive types Feb 2, 2019
@rdsr rdsr changed the title Support for standard Java primitive types Support for standard Java.lang primitive types Feb 2, 2019
@rdsr rdsr changed the title Support for standard Java.lang primitive types Support for standard java.lang primitive types Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant