Skip to content

Conversation

@jf-tech
Copy link
Owner

@jf-tech jf-tech commented Sep 27, 2020

Currently if a custom FileFormat is given in HandlerParams to omniv2 handler creation call, this FileFormat becomes the only FileFormat for the omni handler. This behavior would make it difficult to deal with situation where we have to ingest many types of inputs using omni schema. (Saying it being difficult not impossible is because we can theoretically use 2 Extensions, each of which uses the same omni handler, but the first one with custom FileFormat and second with nil, thus the builtin FileFormats will kick in. Possible, but incredibly ugly.)

Instead, omni handler's HandlerParams should allow a list of custom FileFormats. During schema probing, we will combine them with the builtin FileFormats, with priority given the custom ones. If one FileFormat accepts the input then it will be used during ingestion; if not, omni handler will keep on probing the rest of the FileFormats.

jf-tech added 2 commits September 27, 2020 14:22
Currently if a custom `FileFormat` is given in `HandlerParams` to omniv2 handler creation call, this `FileFormat`
becomes the only FileFormat for the omni handler. This behavior would make it difficult to deal with situation where
we have to ingest many types of inputs using omni schema. (Saying it being difficult not impossible is because we can
theoretically use 2 Extensions, each of which uses the same omni handler, but the first one with custom `FileFormat`
and second with nil, thus the builtin `FileFormat`s will kick in. Possible, but incredibly ugly.)

Instead, omni handler's `HandlerParams` should allow a list of custom `FileFormat`s. During schema probing, we will
combine them with the builtin `FileFormat`s, with priority given the custom ones. If one `FileFormat` accepts the input
then it will be used during ingestion; if not, omni handler will keep on probing the rest of the `FileFormat`s.
@codecov
Copy link

codecov bot commented Sep 27, 2020

Codecov Report

Merging #66 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #66   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           29        29           
  Lines         1219      1225    +6     
=========================================
+ Hits          1219      1225    +6     
Impacted Files Coverage Δ
handlers/omni/v2/handler.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aba194b...53c7803. Read the comment docs.

@jf-tech jf-tech requested a review from liangxibing September 27, 2020 01:37
Copy link
Collaborator

@liangxibing liangxibing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jf-tech jf-tech merged commit aacc906 into master Sep 27, 2020
@jf-tech jf-tech deleted the omni_custom_format branch September 27, 2020 03:27
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

Successfully merging this pull request may close these issues.

3 participants