linkedin / linkedin/transport

Support for standard java.lang primitive types

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
306
Forks
75
PR merge metrics
No merged PRs in 30d

Description

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]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the existing specialized types such as StdString, StdLong, and StdInt with the linked Spark prototype in Add.java. Investigate how UDF primitive arguments are represented across Spark, Hive, and Presto, and determine the compatibility and realization requirements. Done means the project has an agreed design and verified support for standard JVM primitive types.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.