-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add protobuf codegen decoder #12980
Add protobuf codegen decoder #12980
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12980 +/- ##
=============================================
- Coverage 61.75% 0.00% -61.76%
=============================================
Files 2436 2443 +7
Lines 133233 134535 +1302
Branches 20636 20824 +188
=============================================
- Hits 82274 0 -82274
- Misses 44911 134535 +89624
+ Partials 6048 0 -6048
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4615a6c
to
b64cfa1
Compare
b64cfa1
to
9ca47ac
Compare
@KKcorps Could you take a look. |
Can you link the overall design doc for this in the summary section? |
...not-input-format/pinot-protobuf/src/main/java/com/google/protobuf/ProtobufInternalUtils.java
Outdated
Show resolved
Hide resolved
...pinot-protobuf/src/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufUtils.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufCodeGenMessgeDecoder.java
Outdated
Show resolved
Hide resolved
...pinot-protobuf/src/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufUtils.java
Outdated
Show resolved
Hide resolved
public static final String NULLABLE_DOUBLE_FIELD = "nullable_double_field"; | ||
public static final String NULLABLE_FLOAT_FIELD = "nullable_float_field"; | ||
public static final String NULLABLE_BOOL_FIELD = "nullable_bool_field"; | ||
public static final String NULLABLE_BYTES_FIELD = "nullable_bytes_field"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the supported data types if pinot doesn't support the type natively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See: We support all the protobuf descriptor types at present in the version we are using. If in the future new types get added, the codegen will skip that filed and log an error.
https://github.com/apache/pinot/pull/12980/files#diff-84564c2ff3bb09e23abe31143340f4e5a2aea0613588e1131311cb3ea17d4a5eR159-R177
003bf3f
to
8bf1d6d
Compare
...rc/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufCodeGenMessageDecoder.java
Outdated
Show resolved
Hide resolved
...pinot-protobuf/src/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufUtils.java
Outdated
Show resolved
Hide resolved
Descriptors.FieldDescriptor keyFd = | ||
fd.getMessageType().findFieldByName("key"); | ||
Descriptors.FieldDescriptor valueFd = | ||
fd.getMessageType().findFieldByName("value"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
...pinot-protobuf/src/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufUtils.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
private static void addFieldToPinotSchema(Schema pinotSchema, FieldSpec.DataType dataType, String name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this code re-used from somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add it to a common package and use it. I can do that in a follow up pr.
4ce5008
to
2ccb920
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. can you ask for another stamp from Ting Chen
80bad7c
to
47b279b
Compare
…upport for complex type schema
"format" : "1:MILLISECONDS:EPOCH", | ||
"granularity" : "1:MILLISECONDS" | ||
} ] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(format) Please add a extra empty line
@@ -50,6 +50,11 @@ | |||
<groupId>com.google.protobuf</groupId> | |||
<artifactId>protobuf-java</artifactId> | |||
</dependency> | |||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason why we need to override this version? This can potentially cause version conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Only pinot-query-planner is using the org.codehaus.janino dependency. I's also using 3.1.6 version. There's no common version so I specified it here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have pinned its version to 3.1.12
in #12724. Maybe you didn't pull the latest code when merging this
* Add protobuf codegen decoder with unit tests * Add utils functions to convert protobuf schema to pinot schema with support for complex type schema
resolves #12679
Design doc: https://docs.google.com/document/d/186mVLISgYEmljla3-IHrFNJ2dGMJ21qJ-MWFtsx-ayI/
Test resources have the generated code we expect for the different test proto files.